[Tex/LaTex] How to typeset 2pii in LaTeX

amsmathtypography

Using LaTex, how can I typeset 2pii in the following formula (as shown on the MathJax's home page but they are using MathML). I tried 2\pii and 2\pi\i but, as suspected, that did not work.

enter image description here

Best Answer

TeX and LaTeX macros whose names consist of a backslash character (\) followed by one or more letters (i.e., a thru z and A thru Z -- known in TeX jargon as category-code-11 characters) -- such as \pi -- must be followed by a non-category-11 character if TeX is to figure out when the end of the macro's name is reached. Thus, expressions such as \pi\approx3.14159, \pi/2, {\pi}i and \pi{}i are valid syntactically, but \pii is not.

How to typeset "2pii" in LaTeX?

The simplest solution is to write 2\pi i. This is valid because whitespace has category code 10, not 11.

\documentclass{article}
\begin{document}
\[f(a)=\frac{1}{2\pi i}\oint_{\gamma}\frac{f(z)}{z-a}dz\]
\end{document}

Blockquote