Questions tagged [output-formatting]

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

Filter by
Sorted by
Tagged with
46
votes
4answers
1k views

How to create expanding summary boxes like the ones displayed for InterpolatingFunction, NearestFunction, etc.?

The display forms for objects like ClassifierFunction are nice clickable summary boxes I like this, and now I'm trying to create my a custom version of this for my ...
45
votes
4answers
8k views

Why does MatrixForm affect calculations?

This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
40
votes
7answers
2k 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 ...
33
votes
8answers
2k 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?
33
votes
2answers
5k 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: ...
31
votes
2answers
907 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 include:...
30
votes
5answers
20k 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 ...
30
votes
5answers
13k 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. ...
29
votes
1answer
378 views

How to speed up TextJustification in Mathematica 10

Based on this question: - Version 7 print environment - I set up two 10 page test documents in version 7.0.1 and version 10.1. The version 7 document exported to PDF in 4.18 seconds whereas the ...
25
votes
1answer
1k 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?
24
votes
6answers
4k 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 ...
24
votes
5answers
6k 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 ...
24
votes
3answers
12k 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, ...
24
votes
1answer
324 views

Recreational Challenge: Best looking output for Rubi integration steps

As some of you might know, I'm working with Albert Rich to improve the accessibility of his Rubi package for rule-based integration. I'm almost done with a first version that contains several ...
23
votes
7answers
3k 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 ...
23
votes
7answers
2k 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 ...
22
votes
4answers
4k 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 ...
22
votes
4answers
2k 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, there is an example at the end which doesn't make sense: This specifies ...
21
votes
7answers
6k views

Ugly output when combining 2 plots with GraphicsRow

Here are the data that I want to plot: ...
20
votes
3answers
3k 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.
20
votes
2answers
4k 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: ...
20
votes
2answers
468 views

Understanding evaluation and typesetting

Background So, one could be surprised by the fact that: Hold @ Grid[{{1, 2}}] (*or*) Hold @ Graphics @ Disk[] This issue and methods of prevention are ...
19
votes
4answers
3k 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: <...
19
votes
6answers
2k views

Display 10^n as power

How can I tell MMA to display input of the form 10^n as $10^n$ and not e.g. as 1000 for $n = 3$ or the rational $\frac{1}{1000}$ for $n = -3$. This would help to ...
19
votes
2answers
5k 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 ...
19
votes
2answers
1k 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 ...
18
votes
4answers
2k views

How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
18
votes
4answers
695 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+ \...
18
votes
5answers
618 views

Prevent graphics from rendering inside a held expression

Assuming each odd line is input I would like the even lines to be the output of the following lines. In the above the Graphics are inside ...
18
votes
2answers
3k views

Prepare mathematica output to be parsed in Python

I have Mathematica output that I would like to parse in python so I can generate equivalent expressions. So suppose I have the following: ...
18
votes
1answer
1k 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 ...
18
votes
3answers
287 views

How do I use the third and fourth arguments of Parenthesize?

Parenthesize seems to do a good job with constructing boxes that need to be appropriately parenthesized: ...
18
votes
3answers
494 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, <...
18
votes
2answers
895 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 ...
18
votes
1answer
273 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 ...
18
votes
1answer
247 views

Configuration to limit time spent on formatting output

A typical example: I type the expression DumpSave["/some/path/dump.mx", something] ...and hit Shift-Enter. Then the kernel goes off on a 15-minute evaluation. ...
17
votes
1answer
363 views

Grid cuts my images

Bug introduced in V9.0 or earlier and persisting through V11.2 pic2 = ImageResize[ ImageCrop@Rasterize@Graphics@Disk[], {Automatic, 40}] ...
16
votes
2answers
4k 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 ...
16
votes
3answers
2k 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 possible/...
16
votes
3answers
402 views

What does the symbol Continuation do?

There is a symbol Continuation (residing in the System` context). There is no usage or documentation for this symbol. ...
16
votes
1answer
357 views

Programmatically annotate code?

Is there a known way to programmatically annotate code like workflows (without using boxforms or drawing tools): Minimal example that doesn't work: ...
15
votes
4answers
866 views

How can I turn off SingleLetterItalics in PlotLabel, 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 ...
15
votes
3answers
1k 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 ...
15
votes
1answer
410 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 ...
15
votes
2answers
304 views

Dataset shows an “All” Key when it contains a List of Associations

From a process I have a Dataset similar to this minimal example. ...
14
votes
3answers
216 views

How to make the result of InputForm balance the bracket

I always use InputForm to check the result object,such as Dataset or Graphics or other ...
14
votes
3answers
9k 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?
14
votes
1answer
745 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 ...
14
votes
4answers
1k views

Automatically add appropriate prefix to Quantity

Is there a function that automatically adds the appropriate prefix to a Quantity object? For example, I would like a function ...
14
votes
1answer
214 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 ...