Questions tagged [output-formatting]

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

Filter by
Sorted by
Tagged with
0
votes
3answers
106 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
84 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
63 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
252 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
85 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
309 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
61 views

How can I force results to be expressed in exact fractions rather than approximate decimals? [duplicate]

I have a table that where the elements are the results of Solve: ...
3
votes
2answers
85 views

How to define floor/ceiling like TraditionalForm?

We have Floor[x]//TraditionalForm with output ⌊x⌋ If we define ...
0
votes
1answer
165 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
84 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 ...
2
votes
1answer
188 views

Adjust font size in `Grid` [closed]

I have a simple table given by ...
3
votes
1answer
82 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
74 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
61 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
82 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
95 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
71 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
127 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 ...
5
votes
0answers
48 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 ...
2
votes
1answer
250 views

How to force 2=={} as a Boolean output?

I have a code as below:- x = 2; If[x == {}, 1, 0] I want the output to be 0, but the output I got is the entire ...
2
votes
1answer
29 views

How to add another sets of data to the BubbleChart3D without impacting the shape of bubbles?

I have some codes as below:- Data points ...
0
votes
2answers
184 views

Why does my Solve output contain this symbol? [duplicate]

I have a pair of coupled polynomial equations that I need to solve, so I tried using Mathematica's solve tool. This is the code that I wrote: ...
1
vote
1answer
72 views

Distributing complex conjugate

If you have a statement like: Conjugate[a+b] you get back Conjugate[a+b] but I'm expecting ...
0
votes
2answers
66 views

How to make the legend with color more compact in a plot?

I have a plot as below:- ...
4
votes
2answers
94 views

How to get the input string of Entity as output?

I have the following codes:- ...
8
votes
1answer
111 views

How to make GeoListPlot rectangular?

I have a GeoListPlot as below:- gr = {{20, 70}, {-30, 30}}; GeoListPlot[Entity["City", {"Paris", "IleDeFrance", "France"}], GeoRange -> gr] As you can see, ...
5
votes
2answers
137 views

Convert floating point numbers to string like sprintf/fprintf?

I am trying to export some floating point numbers into a csv/txt file. I would like to have a efficient way to control the space between numbers as well as the accuracy of the numbers, as we do in C: ...
1
vote
0answers
58 views

Make exponents line up with their base in terminal

For some reason, the exponents displayed on a terminal (Mac OS X 10.13) Mathematica 11.2 do not line up with their bases: ...
4
votes
1answer
288 views

How to convert entity to string?

I have an entity city. For example, I run {city} = GeoNearest["City", GeoPosition[{41.8, -87.7}]] and then I got The entity "...
0
votes
1answer
53 views

Format numerical input as text [closed]

I currently have the following code: ...
0
votes
1answer
96 views

How to format Print to display in Panel

The following code prints the the value of the solution $x(t)$ to an ODE at a user defined time $t_f$. I want the value (0.350232) to appear within the Panel and not below the Panel as the following ...
0
votes
0answers
47 views

Decimal representation in Mathematica 10

I am using a slider to assign the value for a dynamic variable x, and want to display the value of y=10^Dynamic@x in decimal ...
13
votes
4answers
582 views

Neural network illustrations

(Since this post was met with a certain reluctance to be given answers, a version of it is also posted in Community.) Please share neural networks diagrams you have made in Mathematica / WL. Here is ...
0
votes
1answer
58 views

How can I Reduce the covariance Matrix?

How can I reduce this covariance matrix? And also plot its eigenvalues? and how to compute its eigenvectors? Can we compute its eigenvalues and eigenvectors without reducing in compact form? ...
0
votes
1answer
226 views

How to force Mathematica to show the plots in one row? [closed]

Consider we have two different plot commands in Mathematica. In the output there are one plot and another one below. But I want the output to be organized in one row: on the left there is one plot, ...
0
votes
0answers
16 views

Maintain written order in expression (lexicographic sorting rules) [duplicate]

Is there any way I can get output to follow the exact order that I wrote it? For instance (simple example) x = z + a - b + c^2 comes out as ...
24
votes
1answer
329 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 ...
1
vote
0answers
65 views

How to write a power using `WriteString` function

I have a solution of an equation: aa = N[Rationalize[g6[[3, 2]], 0], 16] (* Out: 2.691607147352649*10^-6 *) I want to save this result in a file using ...
2
votes
0answers
75 views

When print or save as PDF the font size is too large

When I print or save as pdf the font size is too large I have printed the whole notebook to pdf or saved it to pdf, but the font size was too large, and I have set the ...
2
votes
1answer
59 views

Space between elements using `Write`

I have the code: ...
1
vote
1answer
193 views

How does one specify numerical precision for FortranForm[] and CForm[]

I have a long function composed of polynomials and exponentials that I would like to convert to an appropriate form to cut and paste as an equation into SolidWorks. FortranForm gets me close and with ...
0
votes
1answer
39 views

Forcing nice positions of summation Σ 's under and overscript in FractionBox

Apologies if this has been asked before. The expression ...
6
votes
1answer
369 views

How to export a List with the values separated by a simple empty space?

I have this: list=Range[1,4] and I want to Export the values in a text-file. But the values should be separated by a single ...
2
votes
1answer
70 views

Make Reduce produce nicer output

I am trying to reduce a bunch of inequalities using the Reduce command in Mathematica. But the output is very convoluted and I am wondering if there's a way to systematically organize it so that I can ...
0
votes
0answers
31 views

Controlling Output Format when Sending Output to different Notebook

I want to use Mathematica to generate reports, containing tables, plots and (a bit of) text. Now plots and text, I've got pretty much figured out, but I'm sort of stuck at tables. For plots, I've read ...
1
vote
4answers
113 views

Making fractions cancel

I have an equation that Mathematica really wants to display as $$\frac{1}{4\pi G} \bigg( 4\pi G A + 4\pi G B\bigg)$$ where $A$ and $B$ are some terms and $G$ a constant. No amount of ...
0
votes
1answer
53 views

How to export numbers to txt in ScientificForm

I need to write data in scientific notation in a .dat file. For example Export["1.dat", {123.}]. I want to get 1.23e2 in ...
8
votes
3answers
577 views

Change the color of a word in text from green to red when the cursor moves over it

This example displays text that changes from green to red when clicked: ...
1
vote
0answers
116 views

Fortranform output in double precision

I want to take the output in fortran form but written in double precision notation. For example, exp=1 + 8*as^2*Log[2*x] which gives ...
2
votes
1answer
48 views

Printing text in colour without having a newline added automatically at the end

I want to write a line of letters one by one, each with a different font colour and background. WriteString with stdout lets me ...