Reading the aux with \globaldefs=-1 breaks `providecommand`.

Create issue
Issue #22 resolved
u_fischer created an issue

This problem has been reported on

The newest version of the standalone.cls (2015/07/15 v1.2) reads the aux-file in \sa@convert with \globaldefs=-1, and this breaks the internal latex command \renew@command which relies on an \xdef inside a group.

The following example demonstrates the problem. The error message can vary depending on the definition of \@gtempa and the location of the \providecommand.


    %  \begingroup \escapechar\m@ne\xdef\@gtempa{{\string#1}}\endgroup %<-- xdef breaks
    %  \expandafter\@ifundefined\@gtempa
    %     {\@latex@error{\noexpand#1undefined}\@ehc}%
    %     \relax
    %  \let\@ifdefinable\@rc@ifdefinable
    %  \new@command#1}
    \def\@gtempa{foo} % breaks the \providecommand because of the missing inner braces.


Side remark: Imho the issue is also caused by the reading of the aux-file in \sa@convert. As far as I can see the aux-file is read only to get the current value of \sa@multi@numpages. In my opinion this value should be better saved to some other external file. The aux-file can contain so many things that it is difficult to control side effects.

Comments (6)

  1. Falk Hanisch

    One approach would be to parse the file aux-line by line for \sa@multi@numpages and simply set the given value if it is found. So instead of using \@@input\sa@convert@subjobname.aux\relax within


    something like the following code snippet would fulfill the task

        \read\sa@read to\@tempb%
  2. Martin Scharrer repo owner

    This is also the cause of issue #16, as the AUX file is read before the babel package is loaded.

  3. Log in to comment