Skip to content

"You can't use a prefix with `\begingroup' " #29

@urrameu

Description

@urrameu

Hi,

Writing the wrong combination of \providebool + \global\booltrue to the aux file may cause the error mentioned in the title.

The MWE below crashes on the second pass, but uncommenting the \def\blah{} lines makes the problem go away (I got this from a remark by Joseph Wright somewhere on tex.stackexchange.com).

Thanks!

\documentclass{article}
\usepackage{etoolbox}

\makeatletter
\AtEndDocument{ % or AtBeginDocument
  \immediate\write\@mainaux{\providebool{myboolI}}
  \immediate\write\@mainaux{\global\booltrue{myboolI}}
  %\immediate\write\@mainaux{\string\def\string\blah{}}

  \immediate\write\@mainaux{\providebool{myboolII}}
  \immediate\write\@mainaux{\global\booltrue{myboolII}}
  %\immediate\write\@mainaux{\string\def\string\blah{}}
}
\makeatother

\begin{document}\end{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions