Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
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
  • 510k
33 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}$
Asking Questions's user avatar
29 votes
Accepted

Superscripts appear in various weird places in fractions

There's nothing weird about the placement of the three superscript asterisks. They are placed at different heights because they occur in three distinct math styles. (Aside: TeX has 8 possible math ...
Mico's user avatar
  • 510k
25 votes

Making the " ' " symbol closer to the variable

The apostrophe is essentially equivalent to ^{\prime}, which is the reason for the output you get from ^{\dagger''}. It's a very handy shorthand in most cases, compare f'(x) with f^{\prime}(x). In ...
egreg's user avatar
  • 1.1m
25 votes
Accepted

TeX double script error even though all brackets are perfectly placed

From the TeXbook, Chapter 26: Summary of Math Mode, page 291 (emphasis mine on the last sentence) {<math mode material>}.  A character token of category 1, or a control sequence like \bgroup ...
24 votes

Minus sign not aligning with fraction

The cause of the misalignment is that the minus sign is in scriptstyle, but the fraction is being forced into displaystyle. Here are a few options: \[e^{\displaystyle -\frac{(x-\mu_2)^2}{2\sigma^2_2}}\...
Sandy G's user avatar
  • 43.5k
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
Accepted

Prime on the product symbol

The amsmath package has a \sideset command for this purpose: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \sideset{}{'}\prod_{n=-k}^k \frac{a_n}{n} \end{...
Andrew Swann's user avatar
19 votes
Accepted

Why should I “enclose the previous parenthesis with ‘{}’”?

Apparently, the developer of chktex advises to always do something like {(a+b)}^2 which is not what's normally done. There's no need for it and the output is very disputable in typographic terms: ...
egreg's user avatar
  • 1.1m
19 votes

Minus sign not aligning with fraction

Let's consider five separate typographic approaches to displaying the expression at hand: e^{-\dfrac{(...)}{...}} and e^{\dfrac{-(...)}{...}} e^{-\tfrac{(...)}{...}} and e^{\tfrac{-(...)}{...}} e^{-...
Mico's user avatar
  • 510k
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
18 votes
Accepted

Superscript simply refuses to be superscripted

You have \newcommand{\Ma}[1][]{.... The last pair of brackets mean that the macro has one optional argument, which by default is empty. #1 refers to this optional argument. To use an optional argument,...
Torbjørn T.'s user avatar
16 votes

Minus sign not aligning with fraction

If you want necessarily to use \dfrac with the minus sign you add \ooalign. \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \begin{document} \[e^{-\frac{(x-\mu_2)^2}{2\sigma^2_2}}...
Sebastiano's user avatar
  • 55.2k
15 votes

How should imaginary numbers be typeset?

According to ISO 80000-2:2009, Quantities and units---part2: Mathematical signs and symbols to be used in the natural sciences and technology, the upright i is the correct choice. Quantities which are ...
Timtro's user avatar
  • 1,430
15 votes
Accepted

Double Superscript

A superscript of a superscript should be grouped. So, depending on what you're after exactly, you can do: \documentclass{article} \begin{document} $2^{2^n}\ {2^2}^n$ \end{document} The first ...
Werner's user avatar
  • 605k
15 votes

equation beauty?

The following code shows four ways of creating this equation: Unchanged from your question (for comparison). Following this solution, I inserted a \strut directly before the superscript such that the ...
Tiuri's user avatar
  • 7,759
15 votes

Type powers of ten using a custom command

Perhaps a more versatile solution: \documentclass{article} \usepackage{siunitx} \begin{document} \num{e2} \num{1e5} \end{document} gives
Troy's user avatar
  • 13.8k
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
  • 510k
14 votes

Lowering the height of a superscript?

If you load the amsmath package, \hat{\bar{M}}^{a} will not only give you the desired, i.e., smaller height offset for the exponent term automatically, it'll also stack the "hat" and "...
Mico's user avatar
  • 510k
13 votes
Accepted

How to redefine the \today with superscript?

I suggest you use the datetime2 package with the option en-US: The instruction \DTMlangsetup{ord=raise} instructs datetime2 to treat the day number as an ordinal and to raise the st/nd/rd particles ...
Mico's user avatar
  • 510k
13 votes

Superscripts appear in various weird places in fractions

If a fraction appears when display style is in force, the numerator will use text style and the denominator will use “cramped” text style; similarly, the numerator and the denominator will be one ...
egreg's user avatar
  • 1.1m
13 votes
Accepted

Using a ^ outside math mode

There are good reasons for not using ^ in text mode. However, if you want to live dangerously, \documentclass{article} \catcode`^=\active \protected\def^{\ifmmode\expandafter\sp\else\expandafter\...
egreg's user avatar
  • 1.1m
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
  • 510k
12 votes
Accepted

How to write Superexponents

If you nest several super/subscripts, you should disambiguate the writing since it is not clear (for LaTeX) if you want to write (2^2)^65533 or 2^(2^65533). You should therefor use curly brackets ...
ebosi's user avatar
  • 11.7k
11 votes
Accepted

Circ above $D^3$ in a nice way

You should use \mathring{...}, rather than \overset{\circ}{...}. \documentclass{article} \usepackage{amsmath} \begin{document} \[ \mathring{D^{3}} \qquad \mathring{D}^{3} \] \end{document} The ...
egreg's user avatar
  • 1.1m
11 votes
Accepted

How can I move the superscript higher?

While this approach does not increase the size of the superscript font, it does raise the scripted fraction, by using x\strut^{\frac{b+c}{c-a}} instead of x^{\frac{b+c}{c-a}}, which places the ...
Steven B. Segletes's user avatar
11 votes
Accepted

Adjusting kerning with LuaTeX and realscripts

The problem is that realscript itself use locally \addfontfeature. And this means that you are actually using two different fonts for the A and the superscript. It works fine if you use for both the ...
Ulrike Fischer's user avatar
11 votes

Question about typesetting decimal numbers in LaTeX

In addition to encasing the number 1,09 in curly braces -- like so: {1,09} -- I would like to suggest that you add a layer of abstraction to the numeric input material, by (a) loading the siunitx ...
Mico's user avatar
  • 510k
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
  • 510k

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