\documentclass{article}
\begin{document}
\begin{enumerate}
\item $x + y = z$
\item $e^{i\pi} + 1 = 0$
\end{enumerate}
\end{document}
I have a long list in which 95% of the entries are to be written in math mode. I'd rather not have to wrap each entry with $...$
again and again. Is there any way to set the default mode to math mode just for the list entries?
Best Answer
Here's a
enumitem
way and a patch that starts\(
afteritem
and ends\)
before\item
or at the end of the environment, checking with\ifmmode
whether we are in math mode or not.Note:
\item[...]
is not catched here! -- Since the patch is inside the environment group, all other\item
definitions in other environments are not changed.It's possible to jump out of math mode with
\item $ Non math content
, but perhaps a\item \text{Non math stuff}
would be better then!The automatic math mode works with any math content, that expects the math mode, i.e. a
\begin{pmatrix}...\end{pmatrix}
would also be possible.