I would like to redefine the \section macro in my document and I found that LaTeX3e was one of the easiest way to make integer operations inside it. But I get a "Missing $ inserted" error when I compile. A minimal example is the following :
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
\int_zero_new:N \g_int
\ExplSyntaxOff
\newcommand\fooinc{
\ExplSyntaxOn
\int_incr:N \g_int
\ExplSyntaxOff
}
\begin{document}
\fooinc
\end{document}
Why doesn't the above code work ?
\ExplSyntaxOnand\ExplSyntaxOffmarkers should go around the definition, not inside it. – egreg Jul 08 '16 at 12:57\makeatletterhere. – Manuel Jul 08 '16 at 13:22