Is there something like etoolbox
's \appto
, that also works for \chapter
and \addchap
?
edit: I intend to use it to re-enable page numbering (which may or may not be disabled using \renewcommand\thepage{}
) after each chapter's first page, but if page numbering is already enabled the chapter's first page should also be numbered.
edit2: I am tryng to create a command, that disables page numbering until next chapter, including the first page of next chapter. I was going to do this by using \renewcommand\thepage{}
at first and adding some code to \chapter
that checks if page numbering has been disabled (using a toggle) and if it is sets chapter's first page's style to plain
and re-enables page numbering.
Best Answer
\appto
only works for macros without any parameters. Try\apptocmd
(or\pretocmd
or\patchcmd
) instead. See section 3.4 of theetoolbox
documentation for the syntax of these commands and other details.EDIT: Here's a MWE that removes
\clearpage
from the definition of\chapter
.EDIT 2: In response to your second edit: It's a somewhat strange requirement, but here we go: