TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


Surprisingly it works on Math.SE site

share|improve this question
up vote 14 down vote accepted

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

share|improve this answer
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


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.