latex2e icon indicating copy to clipboard operation
latex2e copied to clipboard

\tracingnone resets too much

Open PhelypeOleinik opened this issue 3 years ago • 8 comments

Brief outline of the enhancement

Currently \tracingnone resets all TeX's tracing parameters to zero, which may be a nuisance if a document wants them on throughout, so changing \tracingnone should restore the tracing parameters to what they were before the \tracingall instead.

Minimal example showing the current behaviour

See how \nullfont b doesn't throw an error (whereas it probably should due to the setting in the preamble).

\RequirePackage{latexbug}
\documentclass{article}
\tracinglostchars=3 % I want \tracinglostchars=3 throughout the document
\begin{document}
\nullfont a

\tracingall
% <some debugging>
\tracingnone

\nullfont b % no longer errors
\end{document}

Minimal example showing the desired new behaviour

\tracingall/none could take an approach similar to what \ExplSyntaxOn/Off do for catcodes: Normally \tracingnone is a no-op, then \tracingall defines \tracingnone on-the-fly to reset the tracing parameters to what they were when \tracingall was issued (with proper handling of two consecutive \tracingall). Here's a sample for some of the parameters:

\RequirePackage{latexbug}
\documentclass{article}
\tracinglostchars=3 % I want \tracinglostchars=3 throughout the document

\let\tracingnone\relax
\def\tracingall{%
  \edef\tracingnone{%
    \tracinglostchars=\the\tracinglostchars\relax
    \tracingmacros=\the\tracingmacros\relax
    \tracingonline=\the\tracingonline\relax
    % and more
    \let\noexpand\tracingnone\relax
  }
  \tracinglostchars=3
  \tracingmacros=2
  \tracingonline=1
  % and more
}

\begin{document}
\nullfont a

\tracingall
% <some debugging>
\tracingnone

\nullfont b % no longer errors
\end{document}

PhelypeOleinik avatar Apr 20 '21 14:04 PhelypeOleinik

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Jun 28 '21 11:06 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Oct 22 '21 08:10 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Aug 13 '22 04:08 stale[bot]