14
votes
Is there a way to avoid having to add \mathit to eachword in an equation?
In fine math typesetting, it's very common to use an upright font shape for operators such as "log", "sin", "det", "abs", and so on. "erf" is no ...
13
votes
How to align amsmath matrices and make them look cleaner
You can first of all use align*. Also, fixed width columns make the display much more symmetric.
Since I'd not use \nicefrac even under physical threat, I changed it into \nf so you can, if you really ...
12
votes
Accepted
amsmath error: Multiple \label's: label 'xxx' will be lost
You cannot have two distinct \label commands in the same split environment.
The amsmath package tweaks \label to fulfill its needs, so it is redefined inside the alignment environments. But there's ...
12
votes
Accepted
How to properly align two numbered equations?
You can use IEEEeqnarray from IEEEtrantools. Here I specify alternating centered columns, one for ordinary material and one for relation/operation symbols.
I also add a simpler syntax for the ...
11
votes
Accepted
Height of \sin versus \tan in amsmath
You can notice that the exponent is a bit higher in \sin^2 than in \tan^2, which in turn is higher than in a^2. The height of i is larger than the height of t, but only to an extent that affects the ...
10
votes
How to align text under the brackets
You want to make the formulas to have the same height. Here I use \mathstrut, but in the optional argument you may use any \vphantom.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\...
10
votes
How to align text under the brackets
The reason the middle of the three underbraces isn't aligned vertically with the other two is that the first argument of the associated \underbrace directive doesn't contain material that protrudes ...
9
votes
Why do amsmath and \char interact in this way?
\char is the TeX primitive to access a character by number, so redefining that will break all kinds of latex constructs, not just amsmath
\documentclass{article}
\renewcommand{\char}{\stepcounter{...
9
votes
Stretch accent over fraction
I would like to suggest that you use \overbrace instructions instead of \accentset directives. In the code below, I also use a couple of \vphantom instructions, which insert typographical struts, to ...
9
votes
Height of \sin versus \tan in amsmath
You have already gotten ideas on how to get around it, so let me just elaborate a bit. (This is too long for being a comment.)
This is a nice example where several things coincide.
The radical come ...
9
votes
How to properly align two numbered equations?
In your case you could use the eqparbox package for example. It helps to make pairs of boxes of the same width. After making them, it is sufficient to use simple `align' for your equations to be ...
8
votes
Comma in amsmath breaks line
Never ignore error messages.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
B_i_$, $ _j = \begin{cases}
1$, $& \text{if } P_i_$,$_j\geq 1\\
0$, $& \text{...
8
votes
Accepted
Incompatibility between babel spanish and russian?
This is a bug that has been hidden for a couple of decades.
Both the Spanish and Russian modules for babel want to define “local” math operators, because of tradition.
In the past, with your setup, ...
8
votes
Accepted
Two matrices of same height, but different number of rows
Here is a solution with the environment {NiceArray} of the package nicematrix. In that environment, you merge cells with the command \Block both vertically and horizontally.
\documentclass{article}
\...
8
votes
Accepted
Dot derivative of vector that includes a hat misaligns
amsmath is working hard to enable a dot accent over a hat accent.
You can reset things inside \dot so it "forgets" it is in a nested accent construct.
\documentclass{article}
\usepackage{...
8
votes
Accepted
Displaying blackboard bold characters in LaTeX
Using the canonical amsmath and amssymb.
\documentclass[11pt]{article}
\usepackage{amsmath, amssymb}
\begin{document}
The blackboard bold letters
$\mathbb{ABCDEFGQRZ}$
\end{document}
8
votes
Accepted
Calligraphic style Math Font for letter Q
Using newtxtext and newtxmath packages to obtain the similar image below.
%% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage{newtxtext,newtxmath}
\begin{document}
\begin{...
8
votes
Accepted
Properly creating a boxed vertical vector of math symbols in TikZ
All AMS alignments have a ...ed form that is set natural width rather than being a full width display, so you can avoid minipage with gathered
\documentclass[tikz,dvipsnames]{standalone}
\...
8
votes
Titlespacing command not working for \subsection and also causing error for \section
You get
! Undefined control sequence.
<argument> ...on\endcsname \protect \@secnumpunct
l.9 \section{Main section}
% <- This line triggers the error
?
! Undefined ...
7
votes
Comma in amsmath breaks line
I guess you want something like
Pi,j
so the correct syntax would be
P_{i,j}
Certainly $,$ in that context is an error (and I can't think of situations where it would be correct, even if syntactically ...
7
votes
Accepted
cube shape in Latex Math
The fontawesome package has the symbol \faCube, which must be used in text-mode (not math mode):
\documentclass{article}
\usepackage{fontawesome,amsmath}
\begin{document}
$f_{\text{\faCube}}$
\...
7
votes
Accepted
`sfrac` with fraction numerator and denominator
The sole purpose of using \sfrac is to typeset fractions more compactly than is possible with \frac. Using \dfrac in the arguments of \sfrac flies in the face of using \sfrac to begin with.
If you ...
7
votes
Accepted
nicematrix: add ttfamily in the last-col
UPDATE
The latest version of nicematrix (v. 6.16) provides the ability to put directly the delimiters \lgroup and \rgroup (via \left\lbroup and \right\rgroup) in the preamble of an environment such as ...
7
votes
Accepted
Why do amsmath and \char interact in this way?
tl;dr
Is it possible to safely redefine \char? Not without a lot of work that would prove useless.
Never do \renewcommand on a command you don't know about. For your command do
\DeclareMathOperator{\...
7
votes
Accepted
Vertical alignment of \underset
(I've edited this answer to mention the \overunderset macro, which has the same issue as a nested combination of \overset and \underset.)
It would appear that \rightleftarrows is programmed to think ...
7
votes
Accepted
Special alignment of equations in an optimization problem
Note that y(b) is narrower (width-wise) than y(a) and J(y) (where the latter is the widest element that is used to align the relations). However, aesthetically, it's probably better to align the y's ...
7
votes
How to have two & in align?
I would like to suggest you employ an alignat{2} environment.
Do note that I wrote \mathopen] 0,\infty \mathclose[ rather than just ] 0,\infty [. This brings about an improved, i.e., larger, amount ...
7
votes
Writing multiline equation in align environment -> integrals become smaller?
Instead of inserting a number of \displaystyle directives ahead of \int statements in the denominators of various fractions, one could define a variant form of \frac called, say, \ddfrac -- short for &...
7
votes
Accepted
Adjusting the height of math floor symbol
TeX uses a discrete set of five bracket sizes (not counting the massive brackets around matrices, etc.). Using \left and \right invokes an algorithm that calculates which to use, based on what appears ...
6
votes
Accepted
Three-line intersection symbol
There really isn't enough room inside \Cap to fit a third cap, so here is a built-from-scratch solution using TikZ. At present not available for use in subscripts, but that could be done using \...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
amsmath × 3380math-mode × 967
equations × 666
align × 592
spacing × 211
horizontal-alignment × 193
symbols × 153
matrices × 151
math-operators × 126
mathtools × 124
numbering × 102
vertical-alignment × 83
fonts × 82
cross-referencing × 80
cases × 75
errors × 71
macros × 67
theorems × 64
tikz-pgf × 59
arrays × 59
formatting × 55
environments × 54
alignat × 53
line-breaking × 50
alignment × 48