7

Why does the following code does'nt work when i am using PDFLaTeX or just LaTeX ? I tried it in different editors as well.

This is the code

 $\{f^'_n\}$

Surprisingly it works on Math.SE site

1 Answer 1

15

In math mode, ' is active and is defined as ^\prime. Thus you should not use ^': just ' will work:

\documentclass{article}
\begin{document}
$\{f'_n\}$
\end{document}
3
  • 1
    Well, almost: Some trick is done (at least in LaTeX) to allow human-readable input such as $f''(x)$; if ' simply meant ^\prime this would lead to "double superscript" error.
    – Villemoes
    Apr 23, 2011 at 17:25
  • 1
    @Villemoes: An ' active does not expand directly to ^\prime but to some look-ahead code that deals with this case.
    – Joseph Wright
    Apr 23, 2011 at 17:39
  • As an aside, I tried (once) to get ^' style input working in unicode-math, but it ended up breaking the syntax in other places :( Apr 24, 2011 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .