44
votes
Accepted
Are ^ and _ the only commands in LaTeX not preceded by a backslash?
In TeX and LaTeX, it is vital to distinguish between "commands" or "control sequences" on the one hand and TeX-special characters on the other. Only the former begin, in general, with a backslash (\) ...
30
votes
Left and right subscript / superscript
The best solution I have seen so far was:
${}_{2}x_{1}$
For the more general case of left and right superscript and subscript, one writes:
${}^{1}_{2}x^{3}_{4}$
22
votes
Accepted
Smaller font for subscript within subscript in math mode
For even smaller, you could scale the sub-subscript:
\documentclass{article}
\usepackage{scalerel}
\begin{document}
$a_{b_{\scaleto{c}{1pt}}}$
\end{document}
If you need consistency across a range ...
20
votes
Accepted
Are there alternative methods to "_" for subscripting in math mode?
_ is equal to \sb. Just use $3\sb{x}$.
20
votes
Accepted
How to represent the "Triangle of Power" in LaTeX?
Working from Akiiino's answer I came up with this, which also works in display mode
\documentclass[a4paper]{article}
\usepackage{amsmath}
\newcommand{\dotriangle}[1]{%
\raisebox{-.7ex}{$\vcenter{...
19
votes
Smaller font for subscript within subscript in math mode
You can use \DeclareMathSizes; declare also other sizes if needed.
\RequirePackage{fix-cm} % arbitrary font scaling
\documentclass{article}
\DeclareMathSizes{10}{10}{7}{4}
\begin{document}
$a_{b_{c}...
18
votes
How to write superscripts and subscripts in math mode?
Try this one:
$F^{\mathrm{fr}}_{s\mathrm{MAX}}$.
In math mode ^ means superscript and _ means subscript.
17
votes
How to make a nice fraction in subscript?
You have several options:
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{textcomp}
\begin{document}
\begin{align*}
M_\text{\textonehalf}&= ... \text{ The smallest}\\
M_{\frac{1}{...
17
votes
Accepted
How to typeset chemical formulas in roman?
The standard today is to use mhchem (or similar packages), less typing
\documentclass{article}
\usepackage[version=4]{mhchem}
\begin{document}
\ce{CO2}
\end{document}
The the mhchem documentation ...
15
votes
Accepted
Having sub/super scripts on the side for \sum
You can achieve this by using either \nolimits or \textstyle:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Here is a sum:
\[\sum\nolimits_{i=1}^{n}X_i.\]
Here is another sum:
\[{\...
15
votes
Accepted
Put R under double integral
Apart from JouleV's nice answer, you can use \limits option to typeset the inline with equation with limits under the integral symbol.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\...
15
votes
Accepted
Curly braces with subscript and superscript
The subscript and the superscript should be below and [above] the ends of the right curly brace.
Something like this?
\documentclass{article}
\usepackage{amsmath} % for "\overunderset" ...
14
votes
Accepted
A macro that draws a half-disk for use in mathmode
Picture mode!
\documentclass{article}
\usepackage{amsmath}
\usepackage{pict2e}
\DeclareRobustCommand{\fullcircle}{%
\mspace{2mu}\mathord{
\sbox{0}{$\scriptstyle O$}%
\setlength{\unitlength}...
13
votes
Accepted
Redefine _ like _{\!_{ }}
Use \DeclareMathSizes. An extensive description of the command is given in [Yiannis Lazarides (2011)].
\documentclass[10pt]{article}
\usepackage{lmodern} % scalable font
%\DeclareMathSizes{10}{10}{7}...
13
votes
Accepted
How to make a nice fraction in subscript?
Don't forget nicefrac. And, as erik notes, \sfrac of the xfrac package. Finally, I added a \scriptscriptstyle\frac{}{}.
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{nicefrac,xfrac}...
13
votes
Accepted
Tilde below letter + subscript creates unwanted spacing
You maybe want to use accents:
\documentclass{article}
\usepackage{amsmath}
\usepackage{accents}
\newcommand{\ut}[1]{\underaccent{\tilde}{#1}}
\renewcommand{\vec}[1]{\ut{#1}}
\begin{document}
$\...
13
votes
Accepted
Merge double subscripts in macro with second subscript passed as argument
Here, I search the first argument for _. If not found, I use #1_{#2}. If found (breaking down #1 as #3_#4), it uses #3_{#4,#2}.
Thanks to Mico for pointing out that comma was being set in \...
13
votes
Accepted
non-italic font for equation when we use "Subscript"?
Assuming you want just the subscript to be upright, then you should use \mathrm here instead of the \mbox technique, since the \mbox will not preserve the fontsize decrease that you expect in the ...
13
votes
Accepted
Mismatched braces in subscript and superscript
There are quite a few issues with your code:
The \textit wrapper seems wholly unnecessary
You seem to be under the impression that the ( and ) symbols perform grouping in TeX. That's not the case. I ...
13
votes
Accepted
How do employ ' ("prime") in math mode at the correct depth?
If you want subscripts to be on the same level, just add \mathstrut to them. A strut is an invisible thin vertical rectangle used in vertical spacing.
\int_{G^d} \varphi_{\mathstrut l,i} \varphi_{\...
12
votes
Is it better to write the subscript or the superscript first (e.g. x_a^i vs x^i_a)?
The output by the TeX engine is the same in both situations. So the only question is whether one of them is more semantical than the other one. For example if $x_i^2$ means square of the $i$th item of ...
12
votes
Accepted
Has \textsubscript become a standard LaTeX command?
The \textsubscript command was for many years part of fixltx2e: code which the team felt should be in the kernel but for various reasons did not want to add. At the start of 2015, there was a policy ...
12
votes
Accepted
Is there a robust way to align the baseline of subscripts?
The common approach here is to use a \vphantom of the larger object, or \smash the larger next to a \vphantom of the smaller:
\documentclass{article}
\begin{document}
$T_a T_b$ vs
$T_a T_{\dot{b}...
11
votes
Accepted
Subscript like math but without the minus sign
I would do something like this (use \mathit if the "en" should be italic too)
\documentclass[a4paper]{article}
\usepackage{amsmath}
\newcommand\mathdash{\text{\normalfont -}}
\begin{document}
$
\...
11
votes
Accepted
Math subscript doesn't work in custom command
you're using the wrong syntax.
the optional argument should be in square brackets, not braces, and be input before the main argument, not after.
here's what you want: \LOC[1]{C}.
11
votes
Is there any way that I can put the subscript and superscript at the back of a symbol?
If all you need to do is place an occasional prefix sub- or superscript, you could simply write
${}_s S$ and ${}^t T$
to generate
If your typesetting needs are a bit more demanding, you could make ...
11
votes
Accepted
Non-italic (roman) subscripts in math mode
It is possible to overload _ to set all subscripts in roman type, but that seems like a bad idea since it might break something unexpected.
You may instead want to consider defining a macro that ...
11
votes
Accepted
Why do I have to put braces around my macro for subscripts / indices?
Well they are missing. Not to worry, though, you can easily add them since you don't need the literal brace characters used for delimiting macro/command arguments, but can use \bgroup and \egroup.
\...
10
votes
Accepted
What's wrong with arev's subscript placement?
Maybe you don't know about the sansmathfonts package.
\documentclass{article}
\usepackage{amsmath}
\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\rmdefault}{\sfdefault}
\...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
subscripts × 738math-mode × 245
superscripts × 225
spacing × 50
macros × 44
equations × 40
amsmath × 37
fontsize × 32
math-operators × 32
fonts × 28
formatting × 25
symbols × 22
vertical-alignment × 22
kerning × 19
positioning × 16
brackets × 14
horizontal-alignment × 13
errors × 13
matrices × 12
xetex × 11
typography × 11
unicode-math × 11
fractions × 11
mathtools × 11
beamer × 10