Specify and control how Mathematica formats its output, including rich text, equations and graphics.

learn more… | top users | synonyms

1
vote
2answers
99 views

What is the default file path used by the Put function and how do I pre-evaluate an expression to use in Put?

I have a problem of trying to store some output in an external file. In one note book I define a function f[x_]:=AdvancedCalculation, where this function generates ...
11
votes
1answer
473 views

Formatting and printing lists with Mathematica scripts

I'm just starting out with Mathematica and I'm using MathematicaScript rather than the GUI. However, I'm having trouble formatting a list when printing it. Suppose ...
3
votes
2answers
465 views

Calculate with units

If I want to calculate with units, for example using Pythagoras theorem, I would do this: c = Sqrt[(3m)^2 + (5m)^2] The result will be ...
4
votes
4answers
252 views
11
votes
1answer
627 views

How to put terms in lexicographic order?

Is it possible to have terms like f[w-c] be formatted like this and not like f[-c + w]. I use Mathematica (7.0) for simplifying ...
6
votes
2answers
744 views
2
votes
1answer
342 views

Substituting Symbol font for Mathematica's custom font in exported plots and other graphics

Mathematica includes some custom fonts that allow you to use a wide range of mathematical symbols in output. For example, one can write: ...
11
votes
1answer
287 views

Formatting Framed - some FrameStyle graphic directives don't work?

The FrameStyle option in Framed seems to work for some graphics directives but not others, eg: Framed["yo", FrameStyle -> Blue] But ...
13
votes
5answers
3k views

Formatting a number with fixed number of significant digits

I need a formatting function (say format[x_, n_]) which outputs numbers with fixed n significant digits without unnecessary dot. ...
-2
votes
2answers
716 views

How to write output in TraditionalForm into external text files?

I'd like to write output in TraditionalForm into external text files ofile.txt. I tried to use ...
0
votes
2answers
764 views

How to generate table without comma and bracket or get rid of those?

I want just data without comma and brackets. Even TableForm is not working for me. For example, the general pattern of my table is ...
3
votes
1answer
286 views

Formatting data tables with Grid + Dividers vs. SplitBy --> GridBy?

A quick method to format human-readable data tables with headers, is to use Grid, eg: ...
10
votes
5answers
372 views

TableAlignments -> Left not working

Bug present in versions 7 through 10.0.0. For a very simple dataset TableAlignments->Left does not work: ...
13
votes
2answers
781 views

Mathematica Sec and Csc

How can I prevent Mathematica from using the "old fashioned" functions "Sec" and "Csc"? In Germany these functions are "old fashioned" as they are not taught anymore at school.
5
votes
1answer
249 views

Display Log with desired notation in output

I wish to display logarithms with different bases in the single-term rather than numerator/denominator form during output: ...
9
votes
3answers
3k views

Expressing a decimal as a fraction in lowest terms

How can I express a decimal such as 0.1845095405274387 as a fraction in its lowest terms?
3
votes
1answer
243 views

How to write output to an external text file in addition to the standard output stream?

How to write output to an external text file in addition to the standard output stream, i.e. a notebook for a session with FE and stdout for command-line session?
1
vote
3answers
2k views

How to write values of function to file?

For example, say I wanted to plot Sin(x) like this: Plot[Sin[x],{x,0,2 Pi}] But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a ...
5
votes
1answer
133 views

New display format needed: “drag box”

I want to create a new display type, especially for numbers or text, but potentially for arbitrary objects as well. I want a "drag box" where not all of the number (object) is visible, but dragging ...
6
votes
1answer
2k views

Formatting Ticks and FrameTicks labels with a function

Is there a convenient way to format tick labels? In this example I would like to use the default Mathematica tick intervals, but simply convert the X axis labels to strings with "s" added. As you ...
3
votes
3answers
206 views

Subscripts in programatically generated section headers

Consider the following command: TextCell["\!\(\*SubscriptBox[\(H\), \(2\)]\)", "Section"] How can I display the string as section header and get the DisplayForm? ...
8
votes
5answers
319 views

How to resize the text content of a grid with it?

I am in a resizing mood these days. This code works quite well, up to a point. ...
9
votes
4answers
221 views

Leave expression tree formatting the same when a replacement rule is applied

If I type e1 := 3 x + 2 (1 + y) z // TreeForm, I get an expression tree. If I then type e1 /. x -> 3, I get another ...
3
votes
2answers
2k views

Mathematica output doesn't work as input

Sometimes when I do, for example, a series expansion Mathematica gives me output that it won't take as input. For example if I do a series expansion: ...
2
votes
2answers
921 views

How to display a different number of significant digits in each column of TableForm output?

Say I create a table with three columns of numbers. Is there a way to control the number of significant digits displayed in each column. To make this concrete, take the following command: ...
1
vote
4answers
164 views

Applying a for loop on Out[]

I have a number of expressions, each one is an output: Out[135], Out[136], etc. I wish to print all of these outputs in a C++ form using the function: CForm. I can apply it on each Out[] separately ...
5
votes
1answer
451 views

Command to Show Full Output

I have some rather long output from a notebook I run on a remote server. There is a time limit on processes so I typically do NotebookSave[] after any important ...
11
votes
7answers
326 views

Question about evaluation control

I want to make a function that takes a function as a parameter and prints an integral with the function inside. I've tried this: ...
14
votes
4answers
501 views

How can I turn off SingleLetterItalics in PlotLabels, etc, when the Options Inspector won't do it?

One of the requirements set for the graphing project I am working on is that plot and axis unit labels sometimes need to include superscripts. Here is an approximately minimal example (I have some ...
12
votes
3answers
810 views

Why doesn't PlotMarker option None return no PlotMarkers?

After reading the PlotMarkers documentation it seems to be all or nothing. For example if you wanted markers on some of you lines the code below seems ...
11
votes
2answers
3k views

About the number format in ticks

I want to LogPlot a function, but I have the trouble in the number format in the ticks. For example, ...
19
votes
5answers
1k views

Rationalize the Denominator by Default

In Mathematica 7, if I input Sqrt[2/7], Mathematica outputs $\sqrt{\frac{2}{7}}$, but I want it to output $\frac{\sqrt{14}}{7}$ instead. How do I make Mathematica output values without radicals in the ...
9
votes
1answer
285 views

How can I add row and column header images to my TableForm output?

I am experimenting with the Eigenfaces algorithm and have my notes and experimental data collected in a Mathematica notebook. The result of an experimental run is a table of scores, where the smallest ...
10
votes
2answers
174 views

Unsatisfactory view of Panel, when transformed to pdf

I like very much to wrap Mathematica images by Panel, which gives many of them a much better view. To be precise, if image is some illustration, plot etc. I would ...
10
votes
3answers
505 views

Vertical alignment of FrameTicks Text

The text box of a FrameTick/Tick is, by default, vertically centered on the tick mark. Is there a way to adjust the vertical alignment of FrameTick text? Specifically, along the lines of Baseline, ...
13
votes
1answer
176 views

Width-dependent MatrixForm

When writing fractions, Mathematica has a quite intelligent behaviour: If the fraction gets too long to fit on the width of the notebook, it is automatically replaced by ...
10
votes
2answers
167 views

GridBox/packed array behaviour

I have never used low-level formating functions, so this problem might have a simple solution. I'm currently pulling my hair out trying to solve it, however. Consider the following example: ...
9
votes
3answers
457 views

How to format numbers with at least one figure after the decimal point

I'm searching for a way to get Reals formatted with at least one figure after the decimal point. So e.g. 3. should be printed as 3.0 and ...
8
votes
2answers
423 views

TeX and TraditionalForm

I have a little problem, and hope, with your help, I'll be able to solve it. As you got from the title, I have some trouble with TeX in Mathematica. Imagine, I want to output a nice DisplayFormula, ...
4
votes
2answers
2k views

ArcTan expressed as a radian fraction?

This type of answer is what I'm looking for: In[58]:= ArcTan @ 1 Out[58]= π/4 This is what mathematica gives me: ...
17
votes
6answers
1k views

Annoying display truncation of numerical results

I have a lot of data to inspect. An example of a number in my program is 123.189094 This gets displayed as 123.189 ...
13
votes
1answer
321 views

How one can programmatically transform a text into Gothic, DoubleStruck, or something similar?

In the pieces of text created programmatically I would like to be able to fix that the text is done in one of the styles available in the special characters palette, such as Gothic. It may be useful ...
19
votes
6answers
1k views

Formatting a fraction as a mixed number

Is there a command that will take a rational number and rewrite it in a mixed-number-like form? That is, I'd like to apply a command to something like 10/7 and get ...
13
votes
4answers
785 views

Constructing a list that includes a leading zero (01,02,03 … 55, 56, etc.)

I am constructing a list for use in file operations. Say I want to create list which contains values from 01 to 87. The kicker is that the first nine integers need ...
18
votes
1answer
211 views

hat not big enough

I like to use Mathematica text cells for creating draft technical documents. When entering equations in a text cell, the ^ (hat accent) does not dynamically adjust its size to fit. It looks good if ...
11
votes
1answer
551 views

Rearranging a Polynomial

In Mathematica 8.04 on Windows, I want to display a formula in standard textbook format. The formula is the variance of an $N$-security portfolio. For two securities it is: ...
2
votes
1answer
170 views

How to draw a pane with rounded corners?

Pane[ Style["text is here", Bold, FontColor -> Darker[Gray, .6], Background -> Red ], Alignment -> {Center, Center} ] How to let the pane have ...
3
votes
2answers
117 views

Getting the complete Cell expression some input would generate as output

I can think of calling Print and then SelectionMove to copy the expression and then delete it. Is there any more transparent ...
7
votes
2answers
266 views

Creating a TeXForm/TraditionalForm/etcForm - like function

How could we go about creating a function that behaves like those? After a while thinking, my best try is with CellPrint printing an ...
5
votes
1answer
160 views

CellEvaluationFunction or $PreRead stripping inline cells from text cells

I want to create a textual style that has some CellEvaluationFunction that processes the contents of the cell a certain way. Particularly, it has to do something ...