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

learn more… | top users | synonyms

5
votes
1answer
234 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
559 views

Why does Mathematica order polynomial forms in reverse from traditional order?

I could very well be missing something obvious, but this has always bugged me with Mathematica and I don't know why it does it or how to fix it. If I enter any polynomial, say, x^2 + x - 1 for ...
5
votes
1answer
132 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
239 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
196 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
369 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
124 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
0answers
50 views

Bug in TreeForm: “Plot” formatted as True

I believe I have come across a rather curious bug in TreeForm: {"foo", "bar", "Plot"} // TreeForm Note that the string ...
4
votes
4answers
773 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 ...
4
votes
4answers
156 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
254 views

Filling and Shading an Harmonic Curve

Suppose I have an equation plotted as shown: ...
4
votes
2answers
1k 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
919 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
2answers
168 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
4answers
3k 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
230 views
4
votes
3answers
104 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 ...
4
votes
1answer
646 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
136 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
100 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
2answers
459 views

specify field width in Print

I would like to format the output. For example, the following code gives ...
4
votes
1answer
115 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
547 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
1answer
251 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
2answers
73 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
100 views

Fractions formatting in Column / Grid

Fractions are squished in GridBox: ...
4
votes
1answer
68 views

SuperscriptBox question

I am trying to define an object type in Mathematica as follows ...
4
votes
1answer
192 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
1answer
90 views

PaddedForm adds an additional padding character

I would like to get a sequence from "01" to "10". I tried ...
4
votes
2answers
431 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
3answers
181 views

Why do quote marks appear in output when saved with Save Selection As?

Update: As Simon Woods astutely observed this problem only occurs when you select the cell contents rather than the entire cell via the bracket. Those two tested this and reported, please check again ...
4
votes
2answers
356 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 ...
4
votes
1answer
79 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
261 views

Printing Block Matrices

I have a 2D matrix, such as: d=2; M=Array[a, {d^2,d^2}]; and I would like to print it in a way which emphasizes its dxd block matrix structure. If ...
4
votes
1answer
106 views

displaying Laurent polynomials nicely

I have some 2-variable Laurent polynomials in $q$ and $t$, and I'd like to collect powers of $q$ and display them without using fractions, and to sort the terms by the power of $q$. For example, I'd ...
4
votes
2answers
254 views

Context Sensitive Formatting for a Table

Suppose I am calculating the correlation of a a set of vectors. Correlation[RandomReal[1, {5,5}]] I would like to display the output using TableForm or Grid ...
4
votes
1answer
315 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 ...
3
votes
2answers
163 views

Why don't these styling rules work when viewed in TableForm?

m = RandomInteger[{-5, 5}, {10, 10}]; m /. {x__, y_ /; y > 0} -> Style[{x, y}, Red] % // TableForm When m without style ...
3
votes
2answers
429 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
2answers
182 views

Can I ask Mathematica to replace the arguments of my functions with a replacement rule?

I have an equation that I evaluate at some point (let's say $x=1$) that have terms of the form f[1,y] D[g[1,y],{y,2}] Is there an easy way to replace [1,y] by ...
3
votes
2answers
161 views

ScientificForm is not being applied

I am looking to compute the value of $\sum^{3249}_{n=58} 2^{n \choose 2}$, but when I try to execute ScientificForm[Sum[2^Binomial[n, 2], {n, 58, 3249}]], I get a ...
3
votes
3answers
201 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? ...
3
votes
1answer
149 views

Control over the way matrix is displayed

I am wondering how to change the output format in Mathematica. For example, I have $x=\binom{3}{1}$ and $y=\binom{2}{5}$, and I want to find what linear combination of $x$ and $y$ produces ...
3
votes
1answer
110 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[]? ...
3
votes
1answer
272 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: ...
3
votes
2answers
127 views

Real and/or improved CForm of expressions

I'd quite like to be able to automatically generate C++ versions of certain mathematical expressions that I've manipulated in Mathematica. The resultant C++ code fragment is then going to be used ...
3
votes
3answers
168 views

Generating a list of questions (simultaneous equations)

I am trying to create a list of simultaneous equations showing steps, where I only need to change a, b and the question number, and maybe a couple of minor things about q (where q is the factored ...
3
votes
1answer
113 views

Is it possible to show Tooltips in a ListPicker menu?

Is it possible to show Tooltips in a ListPicker menu? This effect is possible using TabView, but I would much prefer using ListPicker. Below is a simplified version of my code. ...
3
votes
2answers
207 views

Manually adjust graph vertex location by dragging?

Sometimes I have a graph and I want to make tweaks to the vertex locations. Is there any way to manually adjust graph vertex location by dragging? If I double click to edit, I can move around the ...