Skip to main content
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
  • 519k
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
  • 519k
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.2m
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.2m
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
  • 46.8k
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
  • 96.5k
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.2m
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
  • 519k
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,424
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
  • 56.8k
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
  • 610k
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,829
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
  • 519k
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
  • 519k
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.2m
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.2m
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
  • 519k
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.8k
12 votes

Superscript and subscript

I presume you are in math mode and I assume you want to have both superscript and subscript horizontally aligned next to the symbol you are super-/subscripting. You can achieve this like this: $A_b^c$....
Frederic Schneider's user avatar
12 votes
Accepted

Problem with superscripts on fractions

Rather than using an explicit phantom or strut, you could also use \sideset except that that is intended for operators like \sum so you need a \mathop here which is a bit unfortunate. \documentclass{...
David Carlisle's user avatar
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
  • 519k
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
  • 519k
11 votes
Accepted

How to lower the superscript in a math mode manually

Capture the height of \overline{P} via {\vphantom{\overline{P}}} and use that to add a superscript: \documentclass{article} \begin{document} $\dot{\overline{P}}^A$ $\overline{P}^A$ $\dot{\overline{...
Werner's user avatar
  • 610k
10 votes
Accepted

Place prime after subscript

Place w_2 inside a group to displace the prime: \documentclass{article} \begin{document} $w_2' \ {w_2}' \ w_2$ \end{document}
Werner's user avatar
  • 610k

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