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
217 views

Pretty print nested list by inserting linebreaks and indentation

Consider following command ...
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 ...
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 ...
61 views

Output giving a description of iterator values

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

Output with a message [duplicate]

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

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

I have the following command in Mathematica Developer Cloud: ...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
128 views

Pull out the common denominator of fractions

I have this code: ...
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: <...
37 views

Writing: ...
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]; ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 <...
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: ...
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$.
47 views

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

I have a list of identities as follows. ...
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 ...
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 ...
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 ...
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.
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 ...
355 views

Scientific notation in plot title

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

Delete Part of Deferred Expression

Szabolcs provided an elegant answer to my previous question about printing executable code that uses Defer: ...
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: ...
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 ...
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 ...
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 ----...
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 <...
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 <...
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 ...
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 ...
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 ...
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[30] I get out <...
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 ...
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: ...
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 ...