Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 14 down vote accepted

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}
share|improve this answer
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 '11 at 17:25
    
@Villemoes: An ' active does not expand directly to ^\prime but to some look-ahead code that deals with this case. –  Joseph Wright Apr 23 '11 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 :( –  Will Robertson Apr 24 '11 at 11:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.