Specify and control how Mathematica formats its output, including rich text, equations and graphics.
11
votes
1answer
214 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 ...
2
votes
2answers
300 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 ...
3
votes
3answers
108 views
How to output an expression to an external file in “plain text” format without breaking lines?
Given a pretty long expression, such as
...
10
votes
1answer
307 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 ...
5
votes
2answers
442 views
3- dimensional plot of 2-dimensional systems of differential equations
Let's take this first example of a 2D output:
...
2
votes
1answer
200 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:
...
8
votes
1answer
124 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
...
8
votes
4answers
617 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
341 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
297 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
164 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:
...
7
votes
5answers
239 views
TableAlignments->Left not working
For a very simple dataset TableAlignments->Left does not work:
...
10
votes
2answers
323 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
167 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:
...
5
votes
3answers
1k 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?
2
votes
1answer
114 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
497 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
109 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 ...
5
votes
1answer
705 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
157 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
185 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
172 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 ...
2
votes
2answers
631 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
211 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
129 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 ...
4
votes
1answer
144 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 ...
10
votes
7answers
256 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:
...
13
votes
4answers
312 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 ...
11
votes
2answers
412 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 ...
9
votes
2answers
795 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
660 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
216 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
141 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
284 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
150 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 ...
7
votes
2answers
131 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
288 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
331 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
591 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:
...
10
votes
6answers
444 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
...
11
votes
1answer
227 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 ...
17
votes
6answers
535 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 ...
12
votes
4answers
333 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 ...
17
votes
1answer
180 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
297 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
152 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 ...
2
votes
2answers
87 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 ...
6
votes
2answers
187 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
126 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 ...
7
votes
4answers
582 views
Bold face formatting for vectors instead of overarrows like latex \mathbf{}?
OverVector can be used to make a symbol look like a vector in text sections of documents. I happen to like bold symbols for vectors better, as in latex ...

