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

learn more… | top users | synonyms

5
votes
4answers
1k views

How can I format a table to look nice?

I have this code, but i would like to see the results well formated, How can I obtain a well formatted data with aligment?, similar to this one insted what i obatin, you can see here Here is ...
5
votes
4answers
570 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
4answers
207 views

Concatenating strings, unevaluated expressions and evaluated expressions/values

Maybe this is something very simple to some of you. Anyway, I think this can be useful to many others like me. I would like to build an output that involves strings, unevaluated expressions and ...
5
votes
3answers
485 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
3answers
126 views

Why does TraditionalForm[Inactivate[x y]] show x * y ? instead of x y?

Given that both x and y are expressions, in my case x is ...
5
votes
3answers
271 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
547 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
1answer
2k views

How to ask Mathematica to display answer in “$\LaTeX$” form

I am not sure how to explain it, but whenever I compute something in Mathematica, the output always spits back the result in a Mathematica language as opposed to easy-to-read equations. It's ...
5
votes
3answers
451 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
166 views

Restrict Mathematica command to what is inside parentheses

I have a bunch of expressions like this one: $\frac{e^{-\frac{7 J}{2 k T}} \left(2 e^{-\frac{2 g H \mu _B}{k T}}+e^{-\frac{g H \mu _B}{k T}}-e^{\frac{g H \mu _B}{k T}}-2 e^{\frac{2 g H \mu _B}{k ...
5
votes
2answers
133 views

Fractions formatting in Column / Grid

Fractions are squished in GridBox: ...
5
votes
2answers
106 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
161 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
253 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
162 views

Incompatibility of Row and TeXForm

Bug introduced in 9.0. persist as of 10.0.2 Update: Since no one has been able to give a reason for this change in behavior or provide a solution I am tagging this as a bug. Please report it to ...
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 ...
5
votes
2answers
400 views

10bits per rgb / 1024 shades of gray?

Can we display 10 bits per rgb in Mathematica? I'm using a quadro card and 30 bit monitor and can get a smooth gradient using Psychtoolbox in matlab. The following Mathematica should produce a bar ...
5
votes
1answer
270 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
204 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
462 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
129 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 ...
5
votes
1answer
345 views

Easiest Way to Use ShowGroupOpener in Mathematica

I currently edit manually the cell contents of a notebook (Ctrl+Shift+A or Cmd+Shift+A) to "recycle" cells containing the ShowGroupOpener option. Is there an easier way to create documents hiding ...
5
votes
1answer
408 views

how can I convert a Grid object to a Graphics object?

I have a figure (which is by combining different plots) that I generated using Grid[]. The problem is, I want to specify the ...
4
votes
4answers
157 views

How to get a list of pairs into the form $(x,y)$?

I want to put the solutions of the equation $y = (x + 3)/(x - 3)$, where $x$, $y$ are integers, into the form $(x,y)$. For example, $(2, -5)$ instead of $\{2,-5\}$. When I evaluated ...
4
votes
4answers
281 views

Filling and Shading an Harmonic Curve

Suppose I have an equation plotted as shown: ...
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: ...
4
votes
2answers
1k views

How to make traditional output for derivatives

Hello again after some pause. i have a problem how to present partial derivatives in traditional form, not as Mathematica gave it to me in its notation. So I want to present this ...
4
votes
4answers
4k views

How to export data files using specific format

Very often, I have to export data files from Mathematica. These output files contain several columns and hundreds of lines with data. For the sake of the question let's create a sample list ...
4
votes
4answers
257 views
4
votes
2answers
177 views

Character display color

I'm looking to cause the front end to display individual characters in a specific color, just in general, as a default sort of thing. For instance, the character "1" would always display as a red 1, ...
4
votes
1answer
681 views

Reduce an equation by putting a new variable

I have the following equation given: $$ (26-x)\cdot\sqrt{5x-1} -(13x+14)\cdot\sqrt{5-2x} + 12\sqrt{(5x-1)\cdot(5-2x) }= 18x+32. $$ In order to solve it, I want to substitute $t = \sqrt{5x - ...
4
votes
2answers
182 views

Plots using TextAlignment with SwatchLegend to left align multi-line items

I have Legends that stretch over multi-lines and the only way I can get them left aligned is by adding white space to the end of the legend item. Does anyone know if there is a way to use ...
4
votes
1answer
102 views

How to substitute $x$ in a expression $f(x)$ but not calculate the value of the $f(x)$ at the point $x$?

I want to subtitute $x = 1$ into the expression $$f(x)=x^2 + 3 (x^2 - m^2) + \sqrt{x^2 + 1}$$ but I don't calculate the value $f(1)$, that is mean, I want $$1^2 + 3(1^2-m^2)+\sqrt{1^2 + 1}.$$ If I ...
4
votes
2answers
1k views

How do I set the font for output in my stylesheet?

I'd like to change the font that Mathematica uses for output by setting the font of the corresponding style in my stylesheet; bit simply overriding the default ...
4
votes
1answer
170 views

Frame thickness in Framed[] [duplicate]

I need to change the frame thickness in Framed[] in order to create a legend box. How can I set the frame thickness in Framed[]? ...
4
votes
2answers
472 views

specify field width in Print

I would like to format the output. For example, the following code gives ...
4
votes
1answer
116 views

Why this code is considerably slower in version 9?

I have a Mathematica code for computing and plotting the density which corresponds to a given potential. The following code was written few years ago using version ...
4
votes
3answers
605 views

Simplify function notation

I have some calculations with arbitrary functions. In the output, Mathematica always shows the functions with its arguments. I would like to tidy the notation a bit, by hiding the arguments in the ...
4
votes
2answers
118 views

Sorting out atom types in an XYZ file

I am trying to rewrite the output of "VertexCoordinates" such that instead of a hybrid list of atoms and coordinates that result from using the following input program, I want all coordinates of the ...
4
votes
2answers
56 views

numerical precision in output file

I want to write the numerical results of a computation to a file which is to be read in Fortran. The data looks like: ...
4
votes
1answer
311 views

Unexpected behavior: CForm converts rationals to floating numbers

One line question: How to make CForm[1/2] generate 1/2 instead of 0.5? (Thanks Nasser's ...
4
votes
1answer
97 views

Manipulate Demo Full Screen

Is it possible to create a demo using Manipulate and then open it in a document that can be expanded to full screen?
4
votes
2answers
74 views

Why can't I pass in a product of matrices in my modified matrixform? [duplicate]

In attempt to build a function that would work like MatrixForm but would wrap a matrix with brackets, I tried the following function: ...
4
votes
2answers
198 views

How to prevent Grid from breaking the line upon export

I want to create a legend for my plots (a mixture of RegionPlots and ContourPlots). The legend should show the meanins of colors as boxes with text in them and the meaning of contours as framed number ...
4
votes
1answer
69 views

SuperscriptBox question

I am trying to define an object type in Mathematica as follows ...
4
votes
1answer
217 views

Row Alignment in Grid

I've been working on creating tables of differences in MAA similar to the image below, but with a bit more detail: I've written a function that will take an anonymous function, a range of values ...
4
votes
2answers
489 views

DisplayFormula not working as expected

How do I use the styles "DisplayFormula" and "DisplayFormulaNumbered"? Why is there no margin (or empty space) around the ...
4
votes
2answers
78 views

TableHeadings align to the right

Is there away to get TableHeadings align to the Right instead of the default to the Left? ...
4
votes
1answer
84 views

Is it possible to Print into a collapsable CellGroup?

During rather long computation I have intermediate steps Printed with useful information which should be collected for possible use in future inside of the ...
4
votes
1answer
478 views

How can I efficiently write formatted data to a Gaussian Cube file?

I am working with data files that contain information about electronic wave functions. The data format is specified by the quantum chemistry program Gaussian. I need to import the data, manipulate ...