# Questions tagged [output-formatting]

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

968 questions
Filter by
Sorted by
Tagged with
1answer
217 views

### Pretty print nested list by inserting linebreaks and indentation

Consider following command ...
2answers
43 views

### Is there any way that in Piecewise we have just introduce condition? [closed]

I have the following code: Piecewise[{{Sin[x], 0 <= x <= 1}}] I just want the mathematica consider the sinus condition, i.e ...
2answers
172 views

### How to prevent Mathematica from complete evaluation of special functions?

Recently I tried to check a result of integration which should be a linear combination of the Riemann $\zeta\;$-function at various arguments, the coefficients of the combination being of primary ...
1answer
61 views

### Output giving a description of iterator values

I have a program like this: ...
0answers
21 views

### Output with a message [duplicate]

If I have, for example, z[w_] := w^2 and then z 4 I'd like to get ...
0answers
62 views

### Can one convert output from the Cloud to Latex? [closed]

I have the following command in Mathematica Developer Cloud: ...
1answer
30 views

### How to merge the output of grouped cells?

I'd like to keep my cells grouped with the output displayed at the end of the group. Is it any way how to suppress the output within each cell and print all evaluated results together at the end of ...
2answers
65 views

### Changing the display ordering of orderless functions?

If I write x = -(1 - 2 G M/r) \[DoubleStruckD]t^2 + (1 - 2 G M/r)^-1 \[DoubleStruckD]r^2 + r^2 \[DoubleStruckD]θ^2 + r^2 Sin[θ]^2 \[DoubleStruckD]ϕ^2; x I see ...
1answer
40 views

### Printing out reals in a table with a specified number of digits

I would like to print out an list of reals in a table with perfectly identical number of digits so that they can be perfectly right-aligned. However, once I convert them to strings, ...
2answers
136 views

### Removing numbers with trailing zeros from a list

Suppose I have a list of numbers, list = {1.25, 4.5, 3.430000, 6.800, 1.250, 8.9, ...}. I would like to construct a function that removes all the numbers with ...
3answers
181 views

### how to make DSolve not generate Assumptions in the solution?

Sometimes Mathematica generates solutions to a PDE which are hard to read, since it attaches assumptions to the result. If a user knows these assumptions are obvious physically, they might want to ...
2answers
100 views

### How to change the output of an expression (e.g. a vector) into a form that can be easily copied to Maple?

I am trying to write the result of the equation of the line passing through points pA, pB. My code ...
1answer
25 views

### Cannot get column heading to display

I'm trying to generate simple Row-Column headings for the Josephus survivor problem, but I can't get the column heading "Survivor" to display. As far as I can tell, I'm dong what is required from the ...
1answer
128 views

### Pull out the common denominator of fractions

I have this code: ...
1answer
129 views

### Is it possible to embed HTML webpage in a Mathematica notebook?

I am trying to display a webpage as an iframe in Mathematica. The only option I have found is with EmbededHTML, but I can't get it to work for me. Example: <...
1answer
37 views

Writing: ...
1answer
78 views

### Line wrapping in a PDF document

Writing: list = ConstantArray[0, {2, 35}]; doc = CreateDocument[ExpressionCell[TableForm[list, TableSpacing -> {2, 2}], "Output"]]; Export["test.pdf", doc]; ...
1answer
68 views

### How can I put data into a form suitable to export for loading into Excel?

I hope you can help me with some questions about the format of the exported data. I am using NIntegrate to calculate one integral that depends on a parameter ...
1answer
97 views

### Pull the variable out of the fraction

I have a code which outputs a polynomial, the last line is of the form: K[f[#]/g[#] &, 6], with f and g being some functions. The coefficients are fractions, ...
4answers
398 views

### Mathematica function which formats Physics calculation

One small step toward automating homework :) My lecturer doesn't accept calculations done in Mathematica code as homework. I have 30 pages of small calculations such as the one below. I don't want to ...
2answers
77 views

### How to create ordered and custom formatted random matrices?

I'm trying to generate square grid templates to drill holes on a plate for a fragmentation experiment. I have three different problems that I'm not finding a way to solve using the documentation, they ...
2answers
172 views

### Formatting problem

Writing: "x =" <> ToString[1/2] I get: and even if I tried in the forum I could not find a way to get rid of this problem, namely to obtain: or better ...
2answers
67 views

### Different behavior for Dividers in Column

I just used Column with Dividers and found the following surprising (from the documentation of Column). Here Dividers at ...
2answers
164 views

### MatrixForm with zeroes formatted in gray

I would like to define a version of MatrixForm that prints entries equal to zero in gray. The definition ...
1answer
394 views

### How to Custominze the Output of TeXForm

When working with complicated expressions I would like to easily export specific expressions to LaTex. The ideal solution for me is the TeXForm command, but many times when using it I would like to ...
1answer
37 views

### Setting the style of the output in a text file

My problem is related to FormatType of the Output of Print[]. Look at this example code <...
1answer
62 views

### Absolute width specification for Short

I repeatedly found myself needing to display a (possibly long) expression to the user inside another structure. Short seems perfect for this usecase: ...
1answer
41 views

### How can I make a table showing $x$ and $3\,x^2$ for a sequence of values of $x$ [closed]

How can I evaluate $3\,x^2$ for $x = 0,1,2, \ldots,10$ and display the answer as a two-column table, the 1st column being the values of $x$ and the 2nd column being the value of $3\,x^2$.
1answer
47 views

### How to make the RHS integer numbers by multiplying both sides?

I have a list of identities as follows. ...
2answers
47 views

### Paste Print output in a text file [duplicate]

I have a For[...] cycle which calls a function. When the function is at work, it prints some text-string through the command Print[...]. Since I iterate the action of the function for 1000 times, the ...
1answer
164 views

### Improving paclet formatting

Cross posted on Wolfram Community For such an increasingly relevant data type the Paclet has a particularly useless formatted form. Can we do better? In ...
2answers
75 views

### How can I fix this output?

The following segment of code is part of a project I am making and therefore I cannot show all the code. I hope the one below is enough. The input is ...
3answers
179 views

### Easiest way to create a formatting-rich plot label?

How can I make a formatting-rich label and put in on a 2D plot? Example: Please note superscripts, different colors and a need to avoid evaluating the expression.
1answer
76 views

### Limiting window width of Summary Box

I am creating objects in Mathematica, which I'd like to compactly display in the front end notebook as a SummaryBox. However, in many cases, the items that I wish ...
3answers
355 views

### Scientific notation in plot title

I have problem with displaying variables in scientific notation in plot title. Below is my code sample, ...
1answer
50 views

### Delete Part of Deferred Expression

Szabolcs provided an elegant answer to my previous question about printing executable code that uses Defer: ...
1answer
265 views

### MaTeX and \phantom

My understanding of the \phantom directive is that it should preserve the sizes of all elements in the expression. But when I try this: ...
2answers
1k views

### How to avoid the scientific notation in output?

I was trying with DecimalForm, but I read that the suitable one is NumberForm[0.5^20, 12] from version 11. But when I evaluate ...
1answer
71 views

### Forcing particular notation for derivatives

I was wondering if it is possible to force particular style of displaying derivatives in Mathematica. For example if I type: $$AB\partial_\mu C[\mu]$$ After execution it automatically be displayed ...
1answer
51 views

### How to get all horizontal Frame lines in Grid, including topmost and bottom-most?

How can I get the option Frame in TextGrid to do all horizontal lines, including top and bottom? I want: ---- a b ---- c d ----...
2answers
61 views

### How to represent $set1=\{a b, a c\}$ as $set2=\{\{a, b\}, \{a, c\}\}$?

I need representation $set1=\{a b, a c\}$ as $set2=\{\{a, b\}, \{a, c\}\}$ set1={a b, a c} Note I have seen some questions and found the opposite direction <...
4answers
353 views

### Make a custom object look like MatrixForm of a matrix?

Let's say I have a custom object that I denote Obj[a,b,c,...] There are always n^2 entries in the object for some integer <...
1answer
264 views

### display Conjugate[…] as superscript star

For some complex expressions, I want to display the Conjugate[x] as $x^*$ (keyboard input as esc-conj-esc) to make the expression cleaner. I can get the desired ...
1answer
55 views

### How to make an integer displayed separated by “,”?

I would like an integer to be displayed in output like this, with "," separating the integer. eg. 256,856,669,999,887,878,452 eg. 23,242,456 However, I can't find any option. Is it ...
1answer
404 views

### Easy printing of executable code

I'm working on a package that has functions that call other existing and packaged functions. I'd like a way to output what some of those key calls are, so users can see what's happening under the ...
0answers
106 views

### Remove decimal point from N function [duplicate]

For aesthetic reasons I want to remove the decimal point when I use the function N. For example when put in N I get out <...
0answers
46 views

### Unexpected behavior with output formatting for numbers

In documentation for EngineeringForm states: prints with all real numbers in expr given in engineering notation. However, if one evaluates the following ...
3answers
54 views

### Which function should I use to replace variables in an expression?

I tried to search around but could not find a good solution. What I want to do is simple, for example, if at the beginning I define the three variables as: ...
1answer
75 views

### Why my code for format change doesn't work? (Format Rules)

I want to write the following in mathematica $$(\sum_{k=1}^n a^2_k)$$ Now I've written this as an indexed variable Sum[(a^2)[k], {k, 1, n}] which in ...
0answers
175 views

### Printing Precision of Machine Numbers

Is Mathematica making the print precision rounding judgment more stringent based on whether or not the number is above or below the rounding target? If so, why? In my real case, I have many numbers ...