[Tex/LaTex] Prime in text mode


How do I produce the prime symbol in text mode? In math mode the prime symbol is produced by ' but in text mode it produces something else.

Best Answer

If you really want the math prime symbol you may simply use $'$ or $\prime$, or if you want to use it in text and math mode \ensuremath{'} or \ensuremath{\prime}, e.g.:

Prime in text mode: \everymodeprime

Prime in math mode: $\everymodeprime$

I've used \prime instead of ' to avoid typo mistakes.

\ensuremath does only switch to math mode, if math mode it not already active. So it is often useful to define commands, that uses math mode commands and should work in text and math mode.