Questions tagged [output-formatting]

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

Filter by
Sorted by
Tagged with
49
votes
4answers
10k 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 ...
25
votes
3answers
14k 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, ...
19
votes
2answers
6k 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 ...
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 ...
57
votes
4answers
2k 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 ...
19
votes
5answers
704 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 ...
16
votes
6answers
13k views

How to export data files using specific number 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: ...
23
votes
3answers
4k 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.
34
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?
32
votes
5answers
15k 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. ...
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 ...
20
votes
4answers
3k views

How to keep Collect[] result in order?

For example, Collect[(1 + x + Cos[s] x^2)^3, x] gives the result ...
18
votes
2answers
949 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 ...
9
votes
2answers
871 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: ...
4
votes
2answers
4k views

I get weird <<...>> symbols in my output — what does it mean?

After I input the following: data = Table[{3 + i + RandomReal[{-3, 7}], i + RandomReal[{-2, 5}]}, {i, 1, 20}]; model = LinearModelFit[data, x, x] I got ...
10
votes
2answers
1k 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 ...
9
votes
2answers
3k views

How do I set the fonts for Input and 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, but simply overriding the default ...
11
votes
4answers
566 views

Incompatibility of Row and TeXForm

Bug introduced in 9.0 and persisting through 11.0 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 ...
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
1k 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:...
23
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 ...
33
votes
5answers
26k 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 ...
19
votes
2answers
5k 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: ...
10
votes
3answers
1k 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
1k views

How do I edit the background of Axis labels in my plot?

I'm using the standard report stylesheet in Mathematica and when I output a plot, I've set it up so that I get a white background, however the axis labels still have a gray background. How do I change ...
9
votes
2answers
5k 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 ...
7
votes
3answers
317 views

Wrapper for inexact numeric complex numbers that maintains polar form

Related question: How can I convert a complex number into an exponent form Mathematica insists on displaying complex number in form a+I b when ...
27
votes
4answers
6k 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 ...
21
votes
2answers
549 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 ...
28
votes
6answers
7k 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 ...
10
votes
3answers
694 views

is it possible to change/customize some conversions done by TeXForm?

I use TeXForm to convert output of some computation to Latex. I'd like to ask if there is a way to override/change/customize some of these conversions, related to just the name Mathematica assigns to ...
5
votes
3answers
580 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 ...
2
votes
1answer
702 views

Problem with using GraphicsColumn

I have three plots defined as: ...
8
votes
2answers
1k 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
3answers
2k 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 ...
26
votes
1answer
2k 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?
16
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 ...
12
votes
3answers
12k 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, e.g. ...
11
votes
8answers
1k views

Displaying equations, how to combine strings and values without evaluating everything.

Say I'm trying to make a simple multiplication table and used Table[i"x"j"="i*j,{i,1,9},{j,1,9}] I'm trying to make it so that I can get a table of equations, ...
9
votes
4answers
2k 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: ...
8
votes
4answers
481 views

How to set the output be generated in a cell different from "Output"

I would have some functions, for instance Plot, to generate their output using a different Cell's style rather than ...
15
votes
1answer
873 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
3answers
635 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 ...
8
votes
1answer
309 views

How do I alter this \$PreRead + \$PrePrint statement so it can be selectively deactivated?

Background I have a block of code, reproduced at the bottom of this post, consisting of combined \$PreRead and \$PrePrint statements, that automatically formats outputs as 'input = output', and also ...
7
votes
1answer
3k 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 ...
2
votes
2answers
509 views

Lossless TIFF or PNG export

I'd like to export an output from MatrixPlot[], however, the output file size seems to depend on my specification of the ImageSize -> {..., ...}. How might I export a TIFF with all of the data in the ...
2
votes
1answer
700 views

How to apply multiple format to a list

I have a nested list like matrix = {{1.2345664, 2.38673956, 3.567846}, {0.00034554, 124.4554654, 6.34543}, {0.0000233, 244.34454, 2}} and I want to apply ...
42
votes
7answers
3k 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 ...
20
votes
2answers
5k 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: ...
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/...

1
2 3 4 5
7