Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [output-formatting]

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

1
vote
1answer
49 views

Fine tuning PlotLabel graphics - Lissajous Curves

Overall, I'm quite happy with my Lissajous Curves poster maker; however, getting the final touches of the graphics just right has been a challenge. I've tried two different ways of constraining ...
2
votes
1answer
28 views

How to use InputForm for printed and output expressions in console mode

When I run Mathematica in console mode (math.exe/wolfram.exe) without a GUI frontend, then printed and output expressions are (...
3
votes
2answers
213 views

Outputting expressions in the order in which they're entered

Background For display purposes, I sometimes find it desirable to defeat Mathematica's canonical ordering of variables, and instead have it output terms in the order in which I type them. E.g., ...
1
vote
1answer
25 views

Formatting InputForm output

I have a function that operates on EventData and has a return value that has Properties (or things that act like Properties). I'd like to clean up the return InputForm when queried, but I'm not quite ...
0
votes
0answers
25 views

Formatting copied output

is there any way to change global preferences or in another way avoid copied output to be displayed with a lot of digits? For instant. This calculation gives me the following output: ...
6
votes
3answers
112 views

CompiledFunction showing its contents

CompiledFunctions usually appear very compactly, for instance: ...
2
votes
3answers
45 views

Appending/Prepending a vector to a TableForm

How do i Append(Prepend) to a List? A = {{a,b},{c,d}} // TableForm B = {x, y} MapThread[Prepend, {A,B}] does not work. If i leave out the TableForm it does. This ...
0
votes
1answer
88 views

Removing zero dot after solving

I've a question regarding "zero dots". Im using a lot of calculation in an application which i am building within mathematica. However when i use the output of solve for instant i will not have the ...
2
votes
1answer
59 views

How to Text justify that includes StringSplit and MapAt in it?

I am preparing a practical class of physics in which I need to justify the following text that is very extensive. But when I use StringSplit or ...
0
votes
1answer
30 views

PDE's numerical integration: simplify output: get rid of $[t,r]$'s and ${}^{(0,1)}$'s

When numerically integrating PDE's systems mathematica output can be chaotic and therfore time-consuming or even impossible to understand and use. A major source of confusion are the $[t,r]$'s and ${...
0
votes
0answers
24 views

Linking multipage forms together

I am trying to develop a web form wherein the first page asks users how many cities they would like to compare, and the second page dynamically creates that many input boxes. Once the user inputs the ...
0
votes
0answers
39 views

Undo added line breaks PutAppend

I used PutAppend to write away a some results. It turns out that Mathematica has inserted annoying line breaks. This is discussed in Why there are line breaks when ...
0
votes
1answer
79 views

Output formatting

Is it possible to format a mathematica output in a way that all the fractional numbers are written first followed by other constants or functions? Example: ...
2
votes
6answers
879 views

Another way to write equation of the line passing through two points? [closed]

I am trying to write equation of the line passing through two points pA={1, -3} and pB={-33, -1} in the form ...
16
votes
1answer
346 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: ...
8
votes
3answers
235 views

HoldForm: Display exactly as entered?

Sometimes, Mathematica's internal representation of expressions can give somewhat surprising results. Specifically, I noticed this when I tried to preserve products of fractions for display. E.g. ...
2
votes
1answer
58 views

How to change space between y-axis and first bar in a stacked barchart

I have a stacked barchart like this one: BarChart[{{1, 3, 5}, {4, 7, 9}}, ChartLayout -> "Stacked"] Is there a way to change the space before and after the ...
2
votes
0answers
24 views

The default FormLayoutFunction

FormLayoutFunction allows you to specify a custom layout for form's items. But what if you want to only slight fix the default layout? It is not so clear what is ...
0
votes
1answer
41 views

Formatting a list of values and dependent formatting of corresponding errors list

I am making a table of data that I wish to output using TeXForm. Rather than manipulate the values in LaTeX (e.g. using the ...
2
votes
0answers
78 views

How to draw such boxes in Netron?

How to draw a box like this: This was drawn by https://github.com/lutzroeder/netron My attempt: ...
1
vote
1answer
70 views

Copy-paste with annoying trailing 0s

When one copies an output containing machine-precision numbers to a input, many trailing 0s appears. For example : Evaluate the following expression : ...
0
votes
0answers
18 views

Outputting a concatenation of a string and a variable within a loop [duplicate]

In this question, it was mentioned that one can output the concatenation of a string and a variable by using StringForm[]: ...
0
votes
1answer
43 views

How to export histogram legends correctly?

Found it really hard to export a high resolution .png while keeping the legends. Here is the code: ...
0
votes
0answers
35 views

How can I suppress traditional form output in a frame label? [duplicate]

When I draw a plot with the frame label $P_z$, the $P$ is shown in italic auto. What I want is a normal $\rm P_z$. How can I get it? Here is an example: ...
2
votes
1answer
57 views

creating a data framework using matrix tensor

I want to create a data framework using matrix tensor. The framework should have the following features: An (n,n) matrix, ...
2
votes
1answer
41 views

Unexpected behavior of ScientificForm when applied to a list [duplicate]

Consider a = Table[1, 100] la = Length[a] b = ScientificForm[a] lb = Length[b] la = 100 and ...
1
vote
0answers
63 views
1
vote
2answers
84 views

Mathematical symbols appear grey/faded/opaque

I admit this is quite a strange question. The mathematical symbols in my output appear as grey and faded, instead of bold black like my input. I attach a photo. Both the curly brackets and the minus ...
3
votes
1answer
52 views
1
vote
1answer
56 views

Simplifying a Sum of Fractions by Removing Fractions in Denominators

I have a sum of fractions of the form $x1 - \frac{(x2 + x3)}{(x4 + x5)} - \frac{(x6 + \frac{x7}{x13})}{(x8 - x9 - \frac{x10}{(x11 + x12)})}.$ How might I simplify it to remove fractions from the ...
4
votes
3answers
178 views

Handling expression differently for display vs. calculation?

I have a function I wrap a lot of my numbers with to factor them and display them out a certain way. Usually I do this at the last step of a calculation, but sometimes it would be nice if I could ...
1
vote
2answers
75 views

About writing a file using Do loop

I want to write a file using Do loop. The loop computes a list of 9 functions whose outputs are floating point numbers. One of the functions produces large numbers ...
0
votes
3answers
98 views

Replacements within a mathematica expression?

Say I have many expressions of the form $$\text{expr} = \frac{1}{AB(C+D)^n E^m}$$ where $A,B,C,D$ and $E$ are symbols and $n,m$ arbitrary powers. In order to convert between the mathematica output and ...
3
votes
2answers
82 views

How to convert the solution of this recurrence like this form?

I am trying to solve the recurrence sequence. I tried RSolve[{a[n] == 1/2 (a[n - 1] + 9/a[n - 1]), a[1] == 1}, a[n], n] // Simplify I got {{a[n] -> 3 Coth[...
2
votes
2answers
56 views

Maximizing number of positive elements in formatted output

The following code $Assumptions = {0 < x < 1, 0 < y < 1, z > 1}; myexpr = Expand[(1 - x) (1 - y) (z - 1)]; TraditionalForm[Simplify[myexpr]] ...
7
votes
1answer
226 views

How does Mathematica determine when to use scientific notation?

I have code that takes an initial guess for a set of parameters to use in a function that I want to minimize, calculates the function, prints the value, recalculates new parameters via the gradient ...
1
vote
2answers
83 views

For loop not working as expected from a C programmer's perspective [closed]

Why does Print[n] produce output inside a For loop, while Sqrt[n] (as well as many other ...
5
votes
3answers
302 views

How can I stop $\sqrt{1}$ from being evaluated in a recursively defined sequence?

I want to list five terms of a sequence $(u_n)$ with $u_1 = 0$ and $u_{n+1}= \sqrt{1 + u_n}$, but I don't want to reduce them. My code ...
0
votes
0answers
59 views
0
votes
1answer
44 views

Dynamically updating the output of a loop

Consider the following simple loop: n=0; Do[n++;Print[n],{10}] Mathematica writes: 1 2 3 ... I want mathematica to ...
3
votes
2answers
62 views

Manipulate: Show result in Engineering/Scientific Form

I have a simple definition as follows and the result expected is in either EngineeringForm or ScientificForm ...
1
vote
1answer
64 views

Adjust font size in `Grid` [closed]

I have a simple table given by ...
3
votes
1answer
51 views

Replacement rule to display negative exponents as denominators

Suppose I have an expression of the form: expr=f[t]^b + f[t]^a g[t]^-a + g[t]^-c And I want to create a rule to convert negative exponents to denominators. In ...
1
vote
1answer
65 views

How do I hold the form of terms in an output?

Consider the following expression: EXPR = Map[Simplify@Exp[#] &, b Log[f[t]] + a (Log[f[t]] - Log[g[t]]) - c Log[g[t]]] whose output is: $f(t)^a g(t)^{-a}+...
3
votes
1answer
52 views

Why the parenthesis for the output -CenterDot[x,y]?

Why do 2 CenterDot[x,y] - CenterDot[x,y] produce output that looks like $2 \, x\cdot y$ for the former but $-(x\cdot y)$ with parentheses for the latter? Both ...
1
vote
2answers
54 views

How do I get more control over table headings when using TableForm? [closed]

I'm creating some multi-column tables with multi-line headings. The following is an example I created the above table using the Table statement as follows ...
0
votes
1answer
79 views

Padding a number doesn't work when transferring to LaTeX

I have some numbers which I calculate via some previous code. The calculation works fine. However since I want to compare it with experimental data I only need the numbers to a certain number of ...
0
votes
1answer
44 views

`PlotLegends` formatting mixing italics and upright letters

If I do: ListPlot[Range[10] ,PlotLegends->Placed[LineLegend[{"Subscript[N, σ] f(m; μ, p)"},LabelStyle->{FontFamily->"Times"}],{0.8,0.35}] ] where ...
6
votes
4answers
115 views

Suppress trailing 0s in numerical values

For example, this is what I want In[1]:= N[Table[4^(i/4), {i, 1, 4}]] Out[1]= {1.41421, 2., 2.82843, 4.} But if I want a few more digits only from the irrational ...
4
votes
0answers
36 views

Is it possible to embed the Manipulate into a WordPress post?

I have a manipulate Manipulate[n, {n, 1, 100}], I want to put it in my Wordpress blog post. Should I CloudDeploy it as below ...