I am currently working on a very math-heavy document with a lot of lists. Is it possible to define an \item that automatically puts its content in math mode to avoid having to write \item $ $ all the time? I imagine something like this:

    \mathitem some math
    \item some text

I know you can make a math version of the entire itemize environment, but that does not really help since there are many lists with both math and text entries.

  • 1
    Welcome to tex.sx. This can undoubtedly be done, but since \item is only started, not ended, the text would probably be best entered between braces -- \mathitem{...} -- which isn't really an improvement. Nov 10, 2019 at 18:29

1 Answer 1


The following solution could be useful for you. But you have to avoid (at least) two things:

  1. avoid empty arguments of \mathitem,
  2. the content of \mathitem must be placed within one line (in fact, the end of the line is the argument separator of \mathitem).

enter image description here

Here is the code...


% https://tex.stackexchange.com/questions/125549/using-end-of-line-delimiter-in-plain-tex-macro
% (OPmac-solution)
% ------------------
    \def#1{\begingroup \catcode`\^^M=12 \eoldefA#1}%

% definition of \mathitem (avoid empty arguments)
\eoldef\mathitem #1{%
    \item $#1$}

  \item first item
  \item second item
  \mathitem 4x^2\cdot\sinh (x)
  \item third one
  \mathitem \zeta ^\star (2,1)=2\zeta (3)
  • Although paragraph breaks are not permitted within a math environment, I can envision such an item that should be more than one "paragraph". I guess it could be handled as \mathitem ...$\endgraf$... Nov 10, 2019 at 18:56
  • Dearest Marian, always thank you for your attention to me. +1
    – Sebastiano
    Jan 3, 2022 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .