I'm trying to toggle linenumbers when the class option man
is passed.
So far I've tried the recommended answer from this answer but it doesn't work. LaTeX complains with an Undefined Control Sequence
error.
Here's my code:
\documentclass[a4paper,man]{article}
\usepackage{lineno}
\usepackage{etoolbox}
\newtoggle{manu}
\makeatletter%
\newcommand*\DetectManuscriptOption{%
\ifsa@man \toggletrue{manu}\else \togglefalse{manu}\fi}
\makeatother%
\begin{document}
\maketitle
\DetectManuscriptOption
\iftoggle{manu}{%
\linenumbers
}
\end{document}
The result is that line numbers are not shown.
How can I fix this so that linenumbers are shown when the man
option is specified?