# [Tex/LaTex] Prime in text mode

symbols

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.

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.:

\documentclass{article}
\newcommand*{\everymodeprime}{\ensuremath{\prime}}
\begin{document}
Prime in text mode: \everymodeprime

Prime in math mode: $\everymodeprime$
\end{document}


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.