Skip to main content
The 2024 Developer Survey results are live! See the results
43 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 (\) ...
Mico's user avatar
  • 515k
27 votes
Accepted

Is it bad style to write x^2, 2^\frac{1}{2} and 2^\sqrt{2}?

x^2 is mildly bad style: the LaTeX manual always braces superscripts and subscripts also in cases like this. 2^\frac{1}{2} is bad style and works by chance. See later. 2^\sqrt{2} is an outright ...
egreg's user avatar
  • 1.1m
23 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 ...
Steven B. Segletes's user avatar
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{...
Erik Olesen's user avatar
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}...
egreg's user avatar
  • 1.1m
18 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}{...
AboAmmar's user avatar
  • 46.7k
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.
javadr's user avatar
  • 2,414
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 ...
daleif's user avatar
  • 55.3k
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} $\...
Raaja_is_at_topanswers.xyz's user avatar
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" ...
Mico's user avatar
  • 515k
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}...
egreg's user avatar
  • 1.1m
14 votes
Accepted

A subscript that is closer to the tip of the nabla symbol

Define a new command that nudges in the subscript (when present). \documentclass{article} \usepackage{amsmath} \NewDocumentCommand{\Nabla}{e{_^}}{% \nabla \IfValueT{#1}{_{\!#1}}% \IfValueT{#2}{^...
egreg's user avatar
  • 1.1m
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}...
Henri Menke's user avatar
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}...
Steven B. Segletes's user avatar
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} $\...
egreg's user avatar
  • 1.1m
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 \...
Steven B. Segletes's user avatar
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 ...
Alan Munn's user avatar
  • 221k
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 ...
Mico's user avatar
  • 515k
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_{\...
Boris's user avatar
  • 38.3k
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 ...
Joseph Wright's user avatar
  • 262k
12 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 ...
Circumscribe's user avatar
  • 10.9k
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}...
Werner's user avatar
  • 608k
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}.
barbara beeton's user avatar
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 ...
Mico's user avatar
  • 515k
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. \...
Donald Arseneau's user avatar
11 votes
Accepted

Subscript alignment problem with \int\limits

The difference between both symbols comes from the italic correction. According to rule 13a in appendix G of The TeXbook, the lower limits are shifted left by half the italic correction (and the upper ...
Heiko Theißen's user avatar
10 votes

Smaller font for subscript within subscript in math mode

Using someone's idea in How to get an even smaller font? to scale \scriptscriptstyle content down by 30%: \documentclass{article} \usepackage{graphicx} \begin{document} $a_{b_c}$ $a_{b_{\scalebox{...
Werner's user avatar
  • 608k
10 votes
Accepted

Sub and super scripts touching lines in table

You can add some vertical padding to the cells, either with cellspace, which defines a minimal white space at the top and bottom of cells in columns with specifier prefixed with the letter S, or with ...
Bernard's user avatar
  • 273k
10 votes
Accepted

How to use Arabic symbols as mathematical variables?

You can do it, but I don't think your readers will be happy. \documentclass{article} \usepackage{amsmath} \DeclareRobustCommand{\waw}{{\text{\usefont{U}{xnsh}{m}{n}\symbol{240}}}} \begin{document} $...
egreg's user avatar
  • 1.1m

Only top scored, non community-wiki answers of a minimum length are eligible