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

learn more… | top users | synonyms

8
votes
2answers
1k views

Printing a string in a Mathematica script

Here's a simple script saved in the file hello #!/usr/local/bin/MathematicaScript -script Print["Hello world"] I can then run ...
8
votes
5answers
249 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. ...
8
votes
2answers
202 views

Is there a way to programmatically set global preferences?

Can I set global preferences that are accessible via "Edit"->"Preferences" programmatically from within a notebook? As learned from this question, turning off anti-aliasing can make a huge difference ...
8
votes
3answers
236 views

Grid without lines, but with dots

I want to build a grid to look like the top-left table shown below, but without an outside frame. Here is what I've tried to do: ...
8
votes
1answer
339 views

How to align two overlayed plots, one being rotated?

I have two plots which I want to present on a single figure. The bottom left corner is a point of origin of the first plot. The top right corner is a point of origin of the second plot. Also, the ...
8
votes
2answers
383 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, ...
8
votes
1answer
173 views

How do I indent C code generated by SymbolicC?

I'm continuing to experiment with the SymbolicC` package, and it's crucial to be able to inspect the generated code in order to do, well, anything useful with it. ...
8
votes
3answers
404 views

How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?

The first three expressions evaluate as expected and the polynomial is displayed in what I would call "textbook" form. The last expression, however, switches the order of terms. Mathematica employs ...
8
votes
1answer
167 views

How can I make CurrentValue for font characteristics pick up the font of the output not the input cell?

The command CurrentValue (documentation) allows you to access various properties of fonts, such as x-height, line height, and various measures of width such as ...
7
votes
4answers
976 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 ...
7
votes
3answers
167 views

Wrapper for inexact numeric complex numbers that maintains polar form

Related question: How can I convert a complex number a+b I to the exponent form A Exp(I phi)? Mathematica insists on displaying complex number in form a+I b when ...
7
votes
2answers
147 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: ...
7
votes
2answers
553 views

How to change an expression to Fortran90 form?

I have a large expression produced by Mathematica. To use this expression in my Fortran program I need to change it to a Fortran90 form. I am not satisfied with the ...
7
votes
1answer
258 views

How to change brackets in TraditionalForm output

I'm trying to improve TraditionalForm's output by using different brackets when there are more than one. For instance, instead of $u(v(r(b))))$, I'd like to get ...
7
votes
3answers
245 views

Making large tables easy to read with frozen headings and scrollbars [duplicate]

I would like to represent a table containing a large amount of information in such a way that I can (a) use scrollbars and (b) have table headings that don't scroll off the screen [just like the Free ...
7
votes
1answer
304 views

Guides for programming CDFs

Are there any tutorials for programming high-quality CDFs, like the interactive calculus textbook presented at wolfram.com? Mathematica's Help is extremely impressive but it really does not help much ...
7
votes
1answer
102 views

Problem with exporting nested Rows/Columns to HTML

I will show the problem on the following MWE: Export["test.html", Column[{ Row[{"test", "1"}] }], "HTML", "CSS" -> None] ...
7
votes
1answer
207 views

Can the Notation function support complex structures on its left hand side?

In my investigation of the possibilities offered by the Notation package, I came over a limitation in the complexity of the left hand side symbol. For instance, although I am able to enter ...
7
votes
1answer
481 views

How do I get Mathematica to show a number in non-exponential form? [duplicate]

Sometimes I make a calculation in Mathematica that produces a big number, which Mathematica shows like so: -1.52522*10^7 This is annoying to me, because I want ...
6
votes
4answers
370 views

How do I display an expression with negative powers?

How do I display an expression with negative powers? Mathematica seems to always invert a term with a negative rational power. None of the following work: ...
6
votes
3answers
231 views

Wrapping EventHandler by Table

I am making a grid on the screen. The grid is composed of different expressions. I want all of them to have a Gray background, which turns into a ...
6
votes
1answer
465 views

How can I get better control over StreamPlot?

I'm having some difficulties with the command StreamPlot in Mathematica 7.0. Here's the basic plots I'm doing : ...
6
votes
3answers
98 views

Multiplication sign in TeXForm?

How do I get Mathematica to produce TeX output that does not omit the multiplication signs ? For example, this expression: ...
6
votes
2answers
223 views

Add arrows over matrix

How can I plot this graph g1 = Table[x[i, j], {i, 5}, {j, 5}] // Grid; Rasterize@g1 I added these arrows by Ctrl+D's graphics tool. This way maybe hard ...
6
votes
1answer
336 views

Multi-column table layout the right way

How do I create book-like multi-column table formatting for a long, narrow tables in a preferably elegant way? Should I be thinking of stylesheets, instead of formatting? I guess this is a solved ...
6
votes
3answers
225 views

How to make rational expressions formatted using FractionBox

This is what I get using Mathematica 9.0.1. Instead I want this: I know how to use MakeBoxes, Format and I thought this code would work: ...
6
votes
2answers
99 views

Can I Print to a different notebook? (within the context of the same kernel)

Please imagine a simple loop: For[i=1,i<=100,i++, Print[i]; ]; We can ask Print[] to output $(1,2,3,4,...)$ to a ...
6
votes
2answers
304 views

Displaying index as subscript on output: e.g. C[i] -> C_i with Notation[…] or Interpretation[..]?

You have all convinced me not to type in formulas with subscripts. However, in order to be able to match the subscripts in my whiteboard math, I figure a 2nd best solution is to want to display ...
6
votes
1answer
614 views

Possible to export Excel formulas?

I would like to export an .XLS file complete with data and formulas. Is this possible using Export? For example, here is data and a formula :- I can import ...
6
votes
1answer
196 views

Telling mathematica to output * instead of space for multiplication, so I can copy as plain text

I am trying to get some symbolic expressions in Mathematica which I would like to paste into my C/MATLAB codes. This can be accomplished nicely by selecting the expression and right-clicking to ...
6
votes
1answer
1k 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 ...
6
votes
3answers
448 views

Expression of uncertainty in measurement.

I have a problem with writing a Mathematica function. I have been requested to show the results of my experiments with the measurement uncertainty (mu) like below: ...
6
votes
2answers
266 views

How to eliminate the zero real part of a purely imaginary number?

In Mathematica 9, a purely imaginary number, e.g. 0.9 I, will display as 0. + 0.9i in the output form. How can I eliminate the ...
6
votes
2answers
234 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
4answers
321 views

Display a number in Mathematica 9 in periodic form

I want to display a rational number in Mathematica in periodic style. PeriodicForm isn't working anymore. It worked in Mathematica 5 and now I'm using Mathematica ...
5
votes
3answers
301 views

Replace very small numbers by zero in the output of a list

I have a long nested list, but many elements are numbers of order 10^-18 or less, eg ...
5
votes
4answers
495 views

How to transform the result of this integral into powers of $\sin\,x$?

I want to calculate the integral $I = \displaystyle\int{\cos ^5 x\, \mathrm dx}$. Using the variable $t = \sin x$, I get $$I = \sin x - \frac{2}{3}\sin^3 x + \frac{1}{5}\sin^5 x + C.$$ With ...
5
votes
2answers
669 views
5
votes
3answers
232 views

How to change the color of specified digits in a number?

I've been playing with numerical approximations for irrational numbers, and would find it convenient to be able to highlight where these approximations deviate from the known correct answers. For ...
5
votes
2answers
444 views

How to receive the result of the integral $ \int\frac{1}{x}dx$ is $\ln|x|$?

When I input \[Integral]1/x \[DifferentialD]x in Mathematica, I get Log[x]. How can I make the result of the integral ...
5
votes
3answers
394 views

Show[] combines my Graphics3D objects in an undesirable way

Thanks to those (Heike, Jens, MrWizard, and R.M.) who helped me yesterday with figuring out how to plot an EM wave. Now I am running into trouble with the Show ...
5
votes
1answer
139 views

How to substitute the following conditions into an expression?

I have an expression: $p=a\;b\; x + b^2\; y + a\;c\; z$. I want to substitute $a\;b=1$, $b^2 = 2$ and $a\;c = 4$ to obtain $p = x + 2y + 4z$. How can I tell Mathematica to do that? I dont know how to ...
5
votes
2answers
95 views

Why does MakeBoxes mess up RowBox ordering?

When I use RowBox for MakeBoxes the order of the elements is changed for TraditionalForm, if there is a plus (+) in the list of elements. ...
5
votes
1answer
147 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 ...
5
votes
1answer
213 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
1answer
126 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
208 views

How can I fix Mathematica's text line-breaking algorithm not to line-break so soon?

I have some custom plotting functions that simplify the placement of footnotes and source notes under the plot. It is important that the line length of the footnotes fills up the available space and ...
5
votes
1answer
185 views

Using CellPrint with a TraditionalForm string

I am trying to use CellPrint to print a cell that asks a user to solve an equation. This equation is randomly generated right beforehand, and I would like to have it print in Blue. The whole Cell ...
5
votes
1answer
291 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 ...
5
votes
1answer
114 views

How to apply tags to expression terms?

I often see on this site and at the mathgroup the repeated questions on how to rearrange expression that Mathematica "likes" to keep in one form, but the user prefers in another. Consider this trivial ...