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

learn more… | top users | synonyms

37
votes
6answers
1k views

How to “Copy as Unicode” from a Notebook?

I spent some time manually editing a post replacing Mathematica ASCII \[Alpha] with Unicode α. I did this by laboriously ...
26
votes
7answers
817 views

Nice formatting for the results of a dice game simulation

One of my Mathematica interests is in problems related to the formatting of output. Getting nice formatting from Mathematica is often frustrating, but occasionally Mathematica will delight me by ...
21
votes
7answers
848 views

How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?

I want Mathematica to express the equation $$-11 - 2 x + x^2 - 4 y + y^2 - 6 z + z^2=0$$ in the form $$(x - 1)^2 + (y - 2)^2 + (z - 3)^2 - 25=0$$ How do I tell Mathematica to do that?
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 ...
18
votes
6answers
989 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 ...
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 ...
17
votes
4answers
518 views

How do I introduce a new variable in a trigonometric equation?

I have the trigonometric equation \begin{equation*} \sin^8 x + 2\cos^8 x -\dfrac{1}{2}\cos^2 2x + 4\sin^2 x= 0. \end{equation*} By putting $t = \cos 2x$, I have \begin{equation*} \dfrac{3}{16} t^4+ ...
17
votes
3answers
2k views

Way to improve “show me this decimal number to M places, don't use scientific notation”?

The best way I can come up with to say "show me this fraction as a decimal number to M places, don't use scientific notation" is: ...
17
votes
1answer
204 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 ...
16
votes
0answers
289 views

How can I make a notebook with two column layout?

How can I make a notebook with two column layout? Is it possible? I saw something tools could do such thing? Author Tools?
14
votes
5answers
2k views

sprintf() or close equivalent, or re-implementation?

Is there a sprintf() command (some command that takes a printf-style format string and a list of values to insert into the ...
14
votes
4answers
843 views

Converting a large floating-point number to a single-line string

When I feed a large (or small) enough floating-point number to ToString, it produces a two-line string, with the first line containing only the exponent of 10: ...
14
votes
4answers
4k views

Remove tick labels, but retain tick marks in RegionPlot (and related functions)

I would like to remove the numbering on the axes of the following RegionPlot. I would like to keep the tick marks but drop the numbering, I haven't figured out how ...
14
votes
4answers
464 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 ...
13
votes
4answers
667 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 ...
13
votes
3answers
555 views

How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
13
votes
1answer
307 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 ...
13
votes
2answers
670 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.
13
votes
1answer
174 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 ...
12
votes
5answers
2k 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. ...
12
votes
3answers
293 views

TeXForm and large brackets (\Biggl[ etc)

Goal I am trying to export a very long expression like expr = c1*bracket1[a+b+c2*bracket2[d+e+f...]]+... to LaTeX using ...
12
votes
3answers
290 views

Notebook vs. DocumentNotebook; display a Notebook inline, like a DocumentNotebook

If you evaluate a DocumentNotebook[] expression in the front-end, it nicely displays inline, inside of an output cell in the current notebook: For my purposes, ...
12
votes
3answers
309 views

Format and TeXForm does not work as expected

Recently, we had a nice question which brought up an issue that I believe is a bug. In the tutorial Defining Output Formats is an example at the end which doesn't make sense This specifies the ...
11
votes
7answers
317 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: ...
11
votes
2answers
689 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
369 views

Soft-Match String Comparison

I have a list of names in which I would like to check for duplicates. However, within the list, the duplicates may not show up as exact duplicates of each other - for instance, ...
11
votes
1answer
265 views

What are all the named Mathematica styles?

This question came to mind because of this answer to a recent question. Under Style, the Mathematica Documentation Center says the following about named styles. A few common named styles ...
11
votes
1answer
458 views

Any way to make my equations look better, more Latex like?

I find that the equations I write in Mathematica are not always publication quality. Here is a typical example: If I copy as Latex, then I get the following code: ...
11
votes
1answer
507 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: ...
11
votes
2answers
391 views

How can I make a cell that contains an image which can be shifted?

When you're looking at some help pages, they may have cells containing images which can be shifted within the cell by left-clicking and dragging the mouse. Here is a sample: ...
11
votes
2answers
349 views

Notebook formatting - easier descriptions for equations and results?

When I do computations in mathematica, I generally try to make it readable for myself-in-the-future. This can be a cumbersome task in mathematica, where it often requires me to switch betwee a text ...
11
votes
1answer
401 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 ...
11
votes
3answers
479 views

Labeling plots without evaluation

This is my first question here so please excuse my mistakes. Let us consider a rather contrived example: ...
11
votes
1answer
197 views

How to suppress Tooltip in built-in templates?

...or maybe switch the message. But I will be happy with no Tooltip at all. I've naively tried with ...
10
votes
6answers
579 views

Ugly output when combining 2 plots with GraphicsRow

Here are the data that I want to plot: ...
10
votes
2answers
2k 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, ...
10
votes
3answers
453 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, ...
10
votes
2answers
169 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
577 views

How to make Mathematica graphs in Microsoft Word independent from Mathematica?

When I open a .docx file containing Mathematica graphs on a computer without Mathematica software installed, the graphs look corrupted. For example, ...
10
votes
2answers
165 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: ...
10
votes
1answer
565 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 ...
10
votes
1answer
250 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 ...
10
votes
2answers
319 views

Paste data into Mathematica with formatting

Select the following Mathematica code and paste it into a notebook. In Windows 7(Mathematica 8) the line breaks are not interpreted in the expression. In fact any data copipasted from stackexchange ...
9
votes
4answers
452 views

Show path with arrows in a matrix

I have a matrix, for example, 5x5 matrix Partition[Range[25], 5]. And I am given a list, for example: ...
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?
9
votes
2answers
200 views

How can I make Which format its output?

Functions like Piecewise have cool, easy-to-read formatting. In the same vein, I think it would be wonderful if the Which ...
9
votes
2answers
244 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 ...
9
votes
4answers
216 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 ...
9
votes
3answers
421 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 ...
9
votes
3answers
349 views

Inconsistent display of TraditionalForm in version 9

After installing version 9, the default style sheet uses Arial font in text and formula cells. So far, so bad. At least one would hope this is done consistently. But now I see this: You can see ...