I'm using package lineno for proofreading of my documents. So I usually have something like the following MWE:
\documentclass{article}
\usepackage{blindtext}
\usepackage{ifthen} % to use if then else
\newboolean{korrektur} % for proofreading: true/false
\setboolean{korrektur}{true} % choose one, comment the other
%\setboolean{korrektur}{false}
% What we need for proofreading
\ifthenelse{\boolean{korrektur}}% proofreading wanted?
{% YES:
\usepackage{showframe} % shows type area
\usepackage{lineno} % numbers lines
\pagewiselinenumbers % lines per page
}%
{% NO:
% error if lineno was used before:
\typeout{***** Please delete .aux files if you get errors! *****}
% What to add here so that I get no errors? %<=================
}
\begin{document}
\Blindtext
\end{document}
Run it two times. Everything should be well, blindtext is numbered.
Now please move the % sign from line 8 (false) to line 7 (true).
Because we had had the run before there is an .aux-file, including lines with the macro \@LN.
If you compile now you will get the following error message (and some more):
***** Please delete .aux files if you get errors! *****
(C:\Users\...\LaTeX\_TeX.SX\lineno\test-lineno.aux
! Undefined control sequence.
l.2 \@LN
{0}{0}
Question:
Is it possible to add in line 20 (see %<===========) something to get rid of the error messages? Something that resets the meaning of macro \@LN?
***** Please delete .aux files if you get errors! *****, so they're aware that removing the aux file is a solution. But they're trying to find a more automated way to handle the issue. – Teepeemm Dec 08 '21 at 22:04