All Questions
Tagged with best-practices math-mode
82 questions
0
votes
1
answer
85
views
What symbol is commonly used to denote scaling product in LaTeX [closed]
In $1D$, scaling an object by a scalar $s$ produces the same quantity than "multiplying" (making copies). But that's not general in other dimensions. For example scaling a square by $s$, ...
0
votes
1
answer
80
views
Should one put nested exponents in-line, or displayed as an equation?
(I didn't immediately see this question already asked, but perhaps it has, since it seems an obvious question to me!)
This is more of a typographical/style/best-practices question, but I am wondering ...
3
votes
1
answer
181
views
How can we typeset a multi-line expression with both an equation number and a comment?
What is your favourite way of typesetting (multi-line) mathematical expression (with an equality or inequality symbol in the middle) that needs to have both a number and a comment? Here, a comment ...
3
votes
0
answers
127
views
What are some practical approaches to generally improving fluency and range of knowledge/skills in TeX?
Excuse me if this question is better fitted for another SE, as it is somewhat more of a meta question, but still on-topic.
As a background, I'm an undergraduate Mathematics major in my final semester, ...
4
votes
2
answers
1k
views
Is it okay to do $\bf Text$?
For a math report, we often use name of a category in bold letters, ie, Set. Out of laziness, i found that just writing $\bf Set$ seems to do the trick without apparent side effects. Is this okay to ...
1
vote
1
answer
170
views
Aligning multiline formula to the right of equal sign
I would like to align a multiline formula to the right of an equal sign, as suggested by the AMS Style Guide (see below screenshot from p. 118).
I am not able to reproduce the same behavior. Here is ...
6
votes
2
answers
1k
views
How to decide if a comma or punctuation between math mode content should be inside math mode or in text mode?
Which of the two is the preferred way of writing LaTeX code that has punctuation between math mode content?
Example 1:
Therefore the solutions to the given equation are \( 2 \), \( 4 \), \( 6 \), \( 8 ...
8
votes
2
answers
2k
views
LaTeX Convention for displaymath
I'm interested in where the convention for using the backslash-bracket (\[ ... \]) for math display environments originates. I really can't stand slash-bracket notation because most people write it on ...
3
votes
2
answers
176
views
Aligning multiline formula: Break within fences and AMS style
I have a rather long formula and I would like to align it in accordance with AMS Style Guide (see below screenshot from page 119).
I am not able to reproduce this behavior. Here is a minimal working ...
2
votes
1
answer
442
views
Correct spacing rules for functions in math mode
I have a question about spacing in math mode. Suppose you have a document that contains many times the nabla symbol. I have read in different answers in this website that it is advisable to write
\...
9
votes
0
answers
2k
views
When is \ensuremath really needed?
A rather popular question is
When not to use \ensuremath for math macro?.
Some good answers there explain why \ensuremath is often overused.
egreg has an "\ensuremath-only-when-really-needed campaign"....
8
votes
1
answer
302
views
Is it good practice to use a custom command for logical (consistent) markup of functions?
I am only recently learning about the importance of being consistent with markup when typesetting a document in LaTeX (Separate content from formatting - i.e., "just type"). For instance,
\...
3
votes
3
answers
362
views
Mingled math and text in math mode
I frequently encounter the situation of wanting to, say, write a set where the set-membership condition involves some text. If I wanted to describe, say, the set of all even integers this way, then ...
10
votes
3
answers
417
views
Best practice for printing and evaluating formulas with the minimal coding
Can the following MWE be reduced by creating a command that can accept a formula then print and evaluate it without the need to write it twice in two different forms for both evaluating and printing ...
3
votes
4
answers
250
views
A universal method for left-hand alignment of a sequence of equalities
With this code
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools, mathrsfs}
%% Code for '\widebar' macro is courtesy of
%% https://tex.stackexchange.com/a/60253
\makeatletter
\let\save@...
2
votes
2
answers
419
views
Derivatives specifying dependency of a function on its arguments
I want to write the partial derivative of a function, while making the parameters of that function explicit, like so:
\dfrac{\partial f(x, y)}{\partial x}
But this leads to an elongated horizontal ...
4
votes
2
answers
986
views
$x_1, \dotsc, x_n$ vs. $x_1$, $\dots$, $x_n$
For example, if I want to say something like
Let x_1, ..., x_n be real numbers.
should I use
Let $x_1, \dotsc, x_n$ be real numbers.
or
Let $x_1$, $\dots$, $x_n$ be real numbers.
Note that if ...
4
votes
0
answers
1k
views
Best Practices Compilation in Math Mode [closed]
I consider myself a relatively experienced latex user. I am looking for best practices for math mode in LaTeX. Looking around the exchange I couldn't find a post that captures this question broadly. ...
0
votes
0
answers
125
views
When (and why) to use manual kerning for mathematical content?
I recently asked here, a question about the choice of OpenType Unicode fonts for my PhD thesis. After considering the comments and answers to the question, I decided to use Libertinus for both text ...
1
vote
0
answers
1k
views
Best LaTeX practices for writing "N objects", and so on [closed]
Q1: If I want to write in a mathematical article, the following sentence:
Consider N real numbers $x_i$...
Q2: Is it better practice to write "$N$" or simply "N"? Similarly, if one is writing:
Let $...
3
votes
2
answers
1k
views
What to do about \ldots in lists and ending a sentence?
Consider the following
\documentclass{article}
\begin{document}
Let $X_1, X_2, \ldots$ be IID random variables.
We also consider an independent set of coin flips $Y_1, Y_2,\ldots$.
\end{document}
...
2
votes
1
answer
3k
views
Math expression and number in text mode
I am writing an article for an IEEE journal. At one paragraph, I put explanation about a preceding equation like this:
where c1 = 0.0123 is a coefficient from this document.
My question, how ...
0
votes
0
answers
403
views
Should I use $ or \( for inline math mode? [duplicate]
My friends told me that the sophisticated way to use display math in LaTeX is \[ instead of $$. Reading about the issue here on tex.stackexchange and in the l2tabu, it seems like the consensus reason ...
2
votes
1
answer
130
views
In math mode, when is it appropriate to use ~ as opposed to \,? [closed]
In math mode, a whitespace may be inserted using either a tilde (~) or a comma command (\,).
E.g.:
W=\{x,y~|~x+y=3\}
% or
W=\{x,y\,|\,x+y=3\}
Are either of these frowned upon in general? Is it ...
1
vote
1
answer
367
views
Axis label with units to a power - use \left( and \right)?
I'm using Gnuplot to produce my figures and I typeset the axes and labels with LaTeX in the final document from the resulting .eps figure.
My question is regarding the axis label style. Say I have an ...
14
votes
1
answer
3k
views
Bracket in math and text
When I write the pair (x,y) with Latex, which way is correct: ($x,y$) or $(x,y)$? Thanks in advance.
7
votes
1
answer
453
views
"$a, b$" vs. "$a$, $b$"
I have two questions.
Would you use Let $x, y$ and $z$ be real numbers. or Let $x$, $y$ and $z$ be real numbers. ?
Which one is better?
Would you use For $x, y\in\mathbb R$ we have ... or For $x$, $y\...
5
votes
2
answers
841
views
Fixing overfull \hbox with mdframed containing an equation
When creating a boxed environment with mdframed, I ran into an issue with a line with an equation, that also happens to be the first line of a definition.
Is there a way to fix the problem ...
41
votes
2
answers
4k
views
Finishing math with a period
I am new to this site and couldn't find this question after a quick search but it may have been asked before.
This is possibly the most inconsequential issue one can have, but it has been bothering ...
12
votes
2
answers
6k
views
Using \big| and \right| versus \bigr\rvert and \right\rvert
Based on the answers to this question (about \bigl, \bigr, \big, etc.) and this question (about \lvert, \rvert, |, etc.), I would think that anytime one used a vert bar to delimit on the right they ...
34
votes
5
answers
53k
views
"Evaluated at" bar for derivatives: \Bigr, \biggr, or \left...\right?
I'm trying to determine if there is a best practice for typesetting the "evaluated at" bar for derivatives. The three possibilities I'm thinking of are shown in the code excerpt below:
\begin{gather*}...
8
votes
2
answers
4k
views
Best Practice: Package for Mathematical Documents - amsmath and Beyond
I am aware that best practice questions are not always appreciated
since there there's not "one size that fits all".
I am going to give a LaTeX introduction for phd students at my company. All of ...
3
votes
1
answer
1k
views
Math command that works in text and math mode
The command
\newcommand{\rsim}{\text{$\overset{r}{\sim}$ }}
works in text and math mode. That said, the workaround looks somewhat ugly, as text mode and math mode are summoned for a single character....
9
votes
2
answers
1k
views
Is it better to write the subscript or the superscript first (e.g. x_a^i vs x^i_a)?
Is it better to write subscripts or superscripts first (e.g. $x_a^i$ vs $x^i_a$)?
8
votes
1
answer
2k
views
Renaming \d for differentials
I know this question might sound dangerously like asking for an opinion, but I nevertheless give it a try. Since I never used the "underdot accent" \d I renamed it to get a differential in math mode
\...
1
vote
0
answers
164
views
Is there any difference between math mode and text mode for numbers? [duplicate]
Take the sentence: "The answer is 42". Is there any difference between
The answer is $42$.
and
The answer is 42.
In the final PDF I cannot see any difference. Does it make a difference whether I ...
20
votes
1
answer
13k
views
Math symbol in section heading
I have a section heading which includes an epsilon. Furthermore I am using the "hyperref" package to create links in my PDF document.
When compiling I get a strange warning that a math symbol is not ...
3
votes
2
answers
4k
views
Math symbols in text mode
I need to write a text which contains some math symbols. In detail those include \rightarrow, \forall and \exists. I know I can switch into math mode with the $ symbol, but I have quite a lot of text ...
1
vote
0
answers
199
views
How should I write math? [closed]
I'm new to TeX and I would like to use it to write math (on a Mac). I've just downloaded MacTex and I'm wondering what's the recommended workflow. Am I supposed to write math in TeX macros/code and ...
8
votes
1
answer
2k
views
How can I make it easier to write LaTeX documents with elaborate mathematics?
I'm a severely visually handicapped student of mathematics. I wonder how I can speed up my latex document creation.
I'm pasting below solution to a problem in a functional analysis book by Kreyszig. ...
10
votes
1
answer
2k
views
Subscript equivalent of ' for \prime?
I am working through the TeXbook and I came across the section (pg. 130) where ' and \prime are discussed. Knuth mentions that TeX treats \prime as a large symbol that appears only in superscripts ...
3
votes
4
answers
1k
views
How to break a product of three polynomials
I have
$$(1+x+x^2+x^3+x^4+x^5+x^6)(1+x^2+x^4+x^6+x^8+x^{10})(1+x^5+x^{10}+x^{15}+x^{20})$$
but is too long to fit the page. How to break this?
4
votes
2
answers
808
views
Double tagged equations?
In the following example
the inequality (2.26) is obtained in the environment equation, but the equations (2.27) and (2.28) by dirty tricks, destroying the structure of the document. This is because ...
9
votes
1
answer
7k
views
Typesetting mathematical constants
Is there any command for typesetting constants in mathematical formulas?
I would imagine something similar to \operatorname or \DeclareMathOperator, but for constants.
I want the constant to be ...
1
vote
0
answers
152
views
Upright math in italic lemma [duplicate]
I naively entered the following math-mode/text mix in a theorem environment, but the way LaTeX treats the parenthesis doesn't seem right. Especially upright math formulas in italic text parenthesis ...
4
votes
1
answer
246
views
Why are certain mathematics operators not defined and how do I replicate them?
I noticed that while \ker renders correctly as the "kernel" operator in Linear Algebra, the corresponding \im for the "image" is not defined (I tried everything that could possibly be an abbreviation ...
3
votes
1
answer
334
views
Subscripts on Variables uneven
When I write something like
$|x_n y_n - xy|<\epsilon$
the n's in the subscripts are placed at different depths, which looks awkward in my opinion. For instance, see this post over on ...
42
votes
2
answers
95k
views
Fractions with large elements
What is best practice for typesetting fractions with large objects in the numerator and denominator?
For example, fractions with limits, integrals, summations, etc... cause the expressions to look ...
11
votes
3
answers
6k
views
Inline math or \textit for author defined math constants?
Wondering if people here have a thought on what the best practice is here (if it matters).
I used to use baskerville (well, the baskervald package) as my main font and charter as my math font (since ...
8
votes
1
answer
3k
views
How to format mathematical and programming variables in text?
I am describing an algorithm in a journal paper. In this algorithm I have a few variables. I gave them the same names as in my source code (C++ source of the algorithm, not LaTeX source). So I have ...