In latex.ltx, \protected@write is defined as:

\long\def \protected@write#1#2#3{%

Is there any side effect in using \immediate before \write in the definition of \protected@write?


If you change this in \protected@write the side effects are severe. For example, \protected@write is used in \label. The page number is not known right away in general. The delay of the \write without \immediate writes the entry at page shipout time, when the page number is known.

Thus do not change \protected@write. If you need immediate writing, use a new macro instead and do not use it for page numbers and such things that are reliably correct at shipout time only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy