Questions tagged [formatting]
Questions on typesetting and making your expressions, matrices, operators, equations or formulae look how you want them to.
830
questions
2
votes
1
answer
54
views
Create by hand a formatted form of quantities
If I evaluate the following cell:
Quantity["PlanckConstant"]
I get as an output a very concise format of this quantity:
Also, compare the legibility of ...
1
vote
1
answer
68
views
How do I use \mathbf in an inline TeX cell?
I’m pretty new to Mathematica and I’m not sure how to get \mathbf working in inline TeX. I am using a ‘Text’ cell and clicking the ‘Insert TeX’ button (or doing ...
1
vote
1
answer
81
views
Extracting pattern from an equation
I have for example the following eqn
$
j(\text{tl},0,1,1,0,0,0,1)'(s)+\frac{(d-4) j(\text{tl},0,1,1,0,0,0,1)}{2 s}
$
I want to find out the pattern with the prime or the derivative, in this case ...
5
votes
4
answers
329
views
How to display Latin Modern Math font correctly in Mathematica?
I just used Latin Modern Math font to display $\LaTeX$-like formulas in Mathematica.
My expected effect is shown as follows:
Using the following code:
...
0
votes
0
answers
37
views
Turn string with () as function brackets into expression
I have a text file with an equation where all the brackets are formatted as (). For example I read in the equation 2*(Re(a)+Im(b)) as a string. Now I am wondering if I can make this into an expression ...
1
vote
0
answers
36
views
Message converts argument to string before formatting it
How to pass automatically, context-dependently formatted arguments to Message? Interestingly, StringForm correctly interprets ...
0
votes
1
answer
219
views
How to set the default screen style environment to elegant code?
I want to set the default screen style environment to elegant code. How can I do this?
2
votes
2
answers
113
views
Problem with LaTeX format
I am trying to write the following function via latex
\begin{equation}
u(x,t)=\begin{cases}
\frac{x^2}{2}+(t-x) ,\quad 0<x<t \\
xt-\frac{t^2}{2}+sin(x-t),\quad x>t>0
\end{cases}
\end{...
0
votes
0
answers
34
views
Formatting and Indentation of Comments
Is there a way to force/control indentation in a multiline comment within an INPUT CELL?
I often end up with some random indentation like the following. I know if I move the comment to a different ...
1
vote
1
answer
49
views
How to tell Mathematica to collapse all of its sections/subsections in one command?
Is there any command allowing one to collapse all the heading sections in Mathematica (each title content, each chapter, and so on)?
I am interested not in the buttons combination, but rather in the ...
1
vote
2
answers
147
views
Associating a string variable with a numeric variable
There is a translation operation from a numeric variable to a string variable:
a[i_, j_] := Symbol["a" <> ToString[i] <> ToString[j]]
How ...
2
votes
1
answer
75
views
Sequence of lists
Let's say I have the following table,
y=40;
b=Flatten[Table[{i, j}, {i, 1, 2.25, 1.25}, {j, y - 5, y - 8, -3}], 1]
then c is equal to,
...
2
votes
2
answers
44
views
Creating ChartLabels in scientific format over a range
I would like to shorten this repetitious code. Personally, I would save the labels in a separate variable and then just refer to the variable, like for example "ChartLabels -> mylabels". ...
1
vote
0
answers
56
views
Trying to use SetOptions on Style to set some default plotting options
I want to set some default options for Style. I tried this:
...
0
votes
1
answer
31
views
How to "unwrap" Panel from a list of strings?
I'm working with existing code that wraps a list in Panels. When I'm done with the portion needing Panel, how do I get just the list of strings back? Thank you!
...
1
vote
0
answers
37
views
How to make Mathematica treat Subscript[x, j] as a standalone variable? [duplicate]
When i use Replace[] or /., I find that Mathematica does not treat $x_{j}$(Subscript[x, j]) ...
1
vote
0
answers
80
views
How get this kind of group opener?
Some notebooks of mine have Section (and Subsection) cells formatted like the following, so that clicking on the icon to the right of the Section's title opens the entire group of cells in that ...
4
votes
1
answer
109
views
Purple color text related with RowBox
Type the first line of following code and press enter key.
...
1
vote
1
answer
61
views
Format[] and Power[]
Suppose I have a simple dot product function DP that I want to display nicely, I might use e.g.
Format[DP[x,y],StandardForm]:= (x\[CenterDot]y)
If x == y, then I'll ...
0
votes
1
answer
60
views
The shortcuts for typing subscript is valid
I installed the Mathematica 13.2 in my new computer, everything worked well excepted that the shortcuts for typing the subscripts "ctrl+ _" doesn't work. I tested that the "ctrl" ...
0
votes
0
answers
23
views
Set TeXForm for user-defined functions [duplicate]
I defined a function gamma in short for a long function.
Now I have an expression (just an example here)
...
1
vote
1
answer
42
views
How to avoid spaces before parenthesis in DisplayFormula cells?
When I write a formula in a DisplayFormula or DisplayFormulaNumbered cell, I like to use "traditional notation", i.e. function-parenthesis-argument instead of function-squarebracket-argument....
0
votes
0
answers
30
views
How can I make UnIconize produce formatted Strings? (or, how can I get UnIconize Wrap RawBoxes around Boxes?)
UnIconize from the menu turns RawBoxes into Box forms:
If I Iconize the right-hand side of this:
And then Uniconize it,
the formatted strings are appear as Box forms:
...
3
votes
2
answers
161
views
Precise control of fraction expression
It seems that expression for fraction differs
when the number of terms in the numerator is more than 2.
...
0
votes
0
answers
36
views
How does cell style work with cell form?
I am writing some text in Mathematica that includes equations. I have an option for equation box by entering ctrl+( but it seems that is designed for inline math ...
0
votes
1
answer
68
views
How do we make HoldForm reads from external list?
In[716]:= Block[{d = 10^6}, HoldForm[ # A] & /@ d]
Out[716]= 1000000
I would like to get this
...
0
votes
0
answers
37
views
Bug? Version 13.2.0 GridBoxAlignment->{"Columns" -> {{"\[AlignmentMarker]"}}...} "Tabs" the first column after upgrade from 12.0
After upgrading to 13.2.0 for Microsoft Windows (64-bit) I have found that Grid boxes with columns aligned on AlignmentMarker are acting as if there is a Tab in front of the column.
For example, the ...
1
vote
1
answer
46
views
Combination of RowBox and SuperscriptBox create a new line "\n"?
Given the following code:
...
0
votes
1
answer
75
views
How to arrange the obtained results according to the descending power of x?
The function of the code is to obtain a univariate quadratic equation about x by simultaneous equation
the code is this:
...
4
votes
2
answers
117
views
How to discard the repeating elements of a list [closed]
Lets say there is a random list of expressions :
a={Sin[x], Sin[3 x], Sin[4 x], Sin[x], Sin[4 x], Sin[x], Sin [5 x], Sin[3 x], Sin[5 x]}
Plot[{a}, {x, 0, 2 Pi}]
...
1
vote
1
answer
69
views
Remove background colors within cells
I've gotten in the habit of changing the background color of modified chunks of code using the Format - Background Color menu on the selected code. E.g.
Now I'd ...
0
votes
0
answers
49
views
Cannot generate an array of results for my numerical method
I want to apply the following scheme:
$$
\begin{aligned}
\psi_{i, j+1} &=-\psi_{i, j-1}+\left(\frac{\Delta t}{\Delta r_*}\right)^2\left(\psi_{i+1, j}+\psi_{i-1, j}\right) \\
&+\left(2-2\left(\...
0
votes
0
answers
15
views
How can I prevent spelling out the path to my user-specific Default.nb in references to private stylesheets of newly created notebooks?
This question came up with Mathematica 12.3.0.0. It probably also applies to other versions with slight variations, e.g. the initialization cells in Mma 13.0 are said to be shaded pink instead of gray....
0
votes
1
answer
70
views
More than 14 decimal places in settings
In the default settings of Mathematica, it is possible to work with 14 decimal places: Edit - Preferences - Appearance - Numbers - Formatting, in Samples hear it's 14-digit decimal only. Can I ...
0
votes
0
answers
36
views
Plotting a list with variable(chemical formula, number)
I have a list like this
List=((co2-Teo2,12),(Al2o3,15),(Ta2O5,16));
I want to plot the list so that the x axis I have the right format of chemical formula and have chemical formula in my plot legends.
...
3
votes
1
answer
151
views
How to get output in MatrixForm in this context?
The following code implements matrix arithmetic:
...
3
votes
2
answers
78
views
0
votes
1
answer
62
views
How to produce a graphic-algabric figure in Mathematica with proper alignment?
Given a symmetry $S$, we can block-diagonalize a Hamiltonian, i.e, $S^\dagger H S = H_{\text{block}}$. The following image demonstrates that. I wonder how one can combine equations and plots with ...
3
votes
1
answer
121
views
Aligning equal signs in the numerator and denominator of a fraction?
I am trying to make a fairly complicated plot that involves LineLegend.
As part of the LineLegend's label, I am using ...
0
votes
2
answers
110
views
Parentheses control
I have an equation with random integer coefficients. The structure is to demonstrate the distributive property.
...
2
votes
0
answers
56
views
Classification of Forms and understanding what goes into \$PrintForms, \$OutputForms, Out[x]//XXXForm=, and what does not
Mathematica has lots of Forms. Some of those appear in $PrintForms, like InputForm, ...
3
votes
1
answer
128
views
Traditional form of product
How to convert the following formula into the traditional form of product?
...
2
votes
1
answer
150
views
Mathematical typography for input of derivative
I prefer to enter mathematical expressions using typography that closely mirrors traditional mathematical typography... as for instance is found in a scientific paper or textbook. Thus if I see the ...
0
votes
0
answers
39
views
How can we Rasterize only 3dplots profile without box, axes or labels?
I would like to export a 3dplot where box, axes, and labels are in a vector format, but the 3d plot profile can be an image, similar to this.
...
3
votes
4
answers
154
views
Showing the keystrokes to enter mathematical symbols without converting to the symbol itself
In a Text cell I'd like to show readers the keystrokes to enter mathematical symbols, for instance $\backslash$[Integral]. However, whenever I type those keystrokes, the interpreter converts the ...
6
votes
1
answer
164
views
Python compatible fortran form for complex numbers
I am trying to use the Mathematica output of a complicated expression as input for python. As suggested in this answer, the FortranForm of an expression already ...
0
votes
1
answer
72
views
InputField - change text alignment to center
Is it possible to align text in InputField Right/Centered?
(Seems Left is default)
Seems there is no alignment option for InputField.
What I want is center - More specifically, Real-time centered : I ...
7
votes
4
answers
371
views
Fit text within a button
Column[Table[
Button["ABCDEFGHIJKLMNOPQRS", Null,
ImageSize -> i], {i, {50, 100, 150, 200}}]]
will output
As in the above example, Mathematica ...
11
votes
4
answers
212
views
How to detect errors that happen in the FrontEnd? [duplicate]
Some errors only seem to be produced at the point of typesetting, making it very difficult to detect them early. For example:
...
2
votes
0
answers
44
views
Automatically iconize all Associations in output cells
I work with expressions containing large associations (<|…|>) as subexpressions, and I want to automatically iconize all such subexpressions in all output ...