% $Id: etoolbox.sty,v 1.4 2008/01/24 22:25:08 lehman stable $ % Copyright (c) 2007--2008 Philipp Lehman, author-maintained. % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License % (LPPL), version 1.3. % % This software is provided `as is', without warranty of any kind, % either expressed or implied, including, but not limited to, the % implied warranties of merchantability and fitness for a particular % purpose. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{etoolbox}[2008/01/24 v1.4 eTeX tools for LaTeX] \begingroup \@ifundefined{eTeXversion} {\PackageError{etoolbox} {Not running under e-TeX} {This package requires e-TeX. Try compiling the document with\MessageBreak `elatex' instead of `latex'. When using pdfTeX, try `pdfelatex'\MessageBreak instead of `pdflatex'. This is a fatal error. I'm aborting now.}% \aftergroup\endinput} {} \endgroup \RequirePackage{etex} \edef\etb@restore{% \catcode\number`\&=\the\catcode`\&\relax \catcode\number`\|=\the\catcode`\|\relax} \catcode`\&=3 \catcode`\|=3 \AtEndOfPackage{% \etb@restore \undef\etb@restore} % {}[][]{} \newcommand*{\newrobustcmd}{} \protected\def\newrobustcmd{% \@ifstar {\let\l@ngrel@x\protected\etb@new@command} {\def\l@ngrel@x{\protected\long}\etb@new@command}} \def\etb@new@command#1{\@testopt{\etb@newcommand#1}0} \def\etb@newcommand#1[#2]{% \@ifnextchar[%] {\etb@xargdef#1[#2]} {\@argdef#1[#2]}} \long\def\etb@xargdef#1[#2][#3]#4{% \@ifdefinable#1{% \expandafter\protected \expandafter\def \expandafter#1% \expandafter{% \expandafter\@testopt \csname\string#1\endcsname{#3}}% \expandafter\@yargdef \csname\string#1\endcsname\tw@{#2}{#4}}} % {}[][]{} \newrobustcmd*{\renewrobustcmd}{% \@ifstar {\let\l@ngrel@x\protected\etb@renew@command} {\def\l@ngrel@x{\protected\long}\etb@renew@command}} \def\etb@renew@command#1{% \begingroup \escapechar\m@ne \xdef\@gtempa{{\string#1}}% \endgroup \expandafter\@ifundefined\@gtempa {\@latex@error{\noexpand#1undefined}\@ehc} {}% \let\@ifdefinable\@rc@ifdefinable \etb@new@command#1} % {}[][]{} \newrobustcmd*{\providerobustcmd}{% \@ifstar {\let\l@ngrel@x\protected\etb@provide@command} {\def\l@ngrel@x{\protected\long}\etb@provide@command}} \def\etb@provide@command#1{% \begingroup \escapechar\m@ne \xdef\@gtempa{{\string#1}}% \endgroup \expandafter\@ifundefined\@gtempa {\def\reserved@a{\etb@new@command#1}} {\def\reserved@a{\etb@renew@command\reserved@a}}% \reserved@a}% % {} \@onlypreamble\robustify \newrobustcmd*{\robustify}[1]{% \ifundef#1% {\@latex@error{\string#1 undefined}\@ehc} {\begingroup \edef\etb@resrvda{\meaning#1}% \edef\etb@resrvdb{% \noexpand\protect\expandafter\noexpand \csname\expandafter\@gobble\string#1 \endcsname}% \edef\etb@resrvdb{\meaning\etb@resrvdb}% \ifx\etb@resrvda\etb@resrvdb \letcs#1{\expandafter\@gobble\string#1 }% \global\csundef{\expandafter\@gobble\string#1 }% \fi \edef\etb@resrvda{% \def\noexpand\etb@resrvda####1\detokenize{macro:}####2->####3&{% \protected####1\def\detokenize{#1}####2{####3}}% \edef\noexpand\etb@resrvda{% \noexpand\etb@resrvda\meaning#1&}}% \etb@resrvda \etb@scantoks\endgroup\etb@resrvda}} % {}{}{} \newcommand*{\ifdef}[1]{% \ifdefined#1% \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi} % {}{}{} \newcommand*{\ifundef}[1]{% \ifdefined#1% \ifx#1\relax \expandafter\expandafter \expandafter\@firstoftwo \else \expandafter\expandafter \expandafter\@secondoftwo \fi \else \expandafter\@firstoftwo \fi} % {}{}{} \newcommand*{\ifcsdef}[1]{% \ifcsname#1\endcsname \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi} % {}{}{} \newcommand*{\ifcsundef}[1]{% \ifcsname#1\endcsname \expandafter\ifx\csname#1\endcsname\relax \expandafter\expandafter \expandafter\@firstoftwo \else \expandafter\expandafter \expandafter\@secondoftwo \fi \else \expandafter\@firstoftwo \fi} % {}{}{} \newcommand*{\ifdefvoid}[1]{% \ifundef#1% {\@firstoftwo} {\ifx#1\@empty \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}} % {}{}{} \newcommand*{\ifcsvoid}[1]{% \ifcsundef{#1}% {\@firstoftwo} {\expandafter\ifx\csname#1\endcsname\@empty \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}} % {}{}{}{} \newcommand*{\ifdefequal}[2]{% \ifundef#1% {\@secondoftwo} {\ifundef#2% {\@secondoftwo} {\ifx#1#2% \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}}} % {}{}{}{} \newcommand*{\ifcsequal}[2]{% \ifcsundef{#1} {\@secondoftwo} {\ifcsundef{#2} {\@secondoftwo} {\expandafter\expandafter \expandafter\ifx \expandafter\expandafter \csname#1\endcsname \csname#2\endcsname \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}}} % {}{}{} \newcommand{\ifblank}[1]{% from url.sty \etb@ifblank@i#1&&\@secondoftwo\@firstoftwo:} \long\def\etb@ifblank@i#1#2#4#5:{#4} % {}{}{}{} \newrobustcmd{\ifstrequal}[2]{% \begingroup \edef\etb@tempa{\detokenize{#1}}% \edef\etb@tempb{\detokenize{#2}}% \ifx\etb@tempa\etb@tempb \aftergroup\@firstoftwo \else \aftergroup\@secondoftwo \fi \endgroup} % {} \newrobustcmd*{\newbool}[1]{% \expandafter\@ifdefinable\csname if#1\endcsname{% \expandafter\newif\csname if#1\endcsname}} \newrobustcmd*{\providebool}[1]{% \ifcsundef{if#1} {\expandafter\newif\csname if#1\endcsname} {\begingroup \edef\@tempa{\expandafter\meaning\csname if#1\endcsname}% \ifx\@tempa\etb@isfalse \else \ifx\@tempa\etb@istrue \else \@latex@error{`\@backslashchar if#1' defined but not a switch}\@eha \fi \fi \endgroup}} \edef\etb@istrue{\meaning\iftrue} \edef\etb@isfalse{\meaning\iffalse} \newrobustcmd*{\booltrue}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}} {\csname#1true\endcsname}} \newrobustcmd*{\boolfalse}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}} {\csname#1false\endcsname}} % {}{} \newcommand*{\ifbool}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}\@gobbletwo} {\csname if#1\endcsname \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi}} % {}{} \newcommand*{\notbool}[1]{% \ifcsundef{if#1} {\etb@err@nobool{#1}\@gobbletwo} {\csname if#1\endcsname \expandafter\@secondoftwo \else \expandafter\@firstoftwo \fi}} \protected\def\etb@err@nobool#1{% \let\relax\relax \@latex@error{Switch `\@backslashchar if#1' undefined}\@eha} % {} \newrobustcmd*{\newtoggle}[1]{% \ifcsdef{etb@tgl@#1} {\@latex@error{Toggle `#1' already defined}\@eha} {\cslet{etb@tgl@#1}\@secondoftwo}} \newrobustcmd*{\providetoggle}[1]{% \ifcsdef{etb@tgl@#1} {} {\cslet{etb@tgl@#1}\@secondoftwo}} \newrobustcmd*{\toggletrue}[1]{% \ifcsdef{etb@tgl@#1} {\cslet{etb@tgl@#1}\@firstoftwo} {\etb@err@notoggle{#1}}} \newrobustcmd*{\togglefalse}[1]{% \ifcsdef{etb@tgl@#1} {\cslet{etb@tgl@#1}\@secondoftwo} {\etb@err@notoggle{#1}}} % {}{} \newcommand*{\iftoggle}[1]{% \ifcsdef{etb@tgl@#1} {\csname etb@tgl@#1\endcsname} {\etb@err@notoggle{#1}\@gobbletwo}} % {}{} \newcommand*{\nottoggle}[1]{% \ifcsdef{etb@tgl@#1} {\csname etb@tgl@#1\endcsname\@secondoftwo\@firstoftwo} {\etb@err@notoggle{#1}\@gobbletwo}} \protected\def\etb@err@notoggle#1{% \let\relax\relax \@latex@error{Toggle `#1' undefined}\@eha} % {}{}{} \@onlypreamble\ifpatchable \newrobustcmd{\ifpatchable}{% \begingroup \@makeother\#% \etb@ifpatchable} \def\etb@ifpatchable#1#2{% \endgroup \ifundef{#1} {\@firstoftwo} {\begingroup \edef\etb@resrvda{% \def\noexpand\etb@resrvda####1->####2&{% \noexpand\etb@resrvdb####2\detokenize{#2}&}% \def\noexpand\etb@resrvdb####1\detokenize{#2}####2&{% \endgroup\noexpand\noexpand\noexpand\ifblank{####2}}% \edef\noexpand\etb@resrvda{% \noexpand\etb@resrvda\meaning#1&}% \noexpand\etb@resrvda}% \etb@resrvda} {\@secondoftwo} {\@firstoftwo}} % []{}{}{}{}{} \@onlypreamble\patchcmd \newrobustcmd*{\patchcmd}{% \begingroup \@makeother\#% \etb@patchcmd} \newcommand{\etb@patchcmd}[4][########1]{% \etb@ifpatchable{#2}{#3} {\begingroup \edef\etb@resrvda{% \def\noexpand\etb@resrvda####1\detokenize{macro:}####2->####3&{% #1\def\detokenize{#2}####2{\noexpand\etb@resrvdb####3&}}% \def\noexpand\etb@resrvdb####1\detokenize{#3}####2&{% ####1\detokenize{#4}####2}% \edef\noexpand\etb@resrvda{% \noexpand\etb@resrvda\meaning#2&}}% \etb@resrvda \etb@scantoks\endgroup\etb@resrvda \@firstoftwo} {\@secondoftwo}} \def\etb@scantoks#1#2{% \begingroup \edef\etb@resrvda{\endgroup \unexpanded{#1\makeatletter\scantokens}{#2}% \catcode\number`\@=\the\catcode`\@\relax}% \etb@resrvda} % {}{} \@onlypreamble\apptocmd \newrobustcmd*{\apptocmd}{% \begingroup \@makeother\#% \etb@hooktocmd\etb@apptocmd} \@onlypreamble\pretocmd \newrobustcmd*{\pretocmd}{% \begingroup \@makeother\#% \etb@hooktocmd\etb@pretocmd} \long\def\etb@hooktocmd#1#2#3{% \endgroup \ifundef{#2} {\def#2{#3}} {\begingroup \edef\etb@resrvda{% \def\noexpand\etb@resrvda####1\detokenize{macro:}####2->####3&{% ####1\def\detokenize{#2}####2{#1{####3}{\detokenize{#3}}}}% \edef\noexpand\etb@resrvda{% \noexpand\etb@resrvda\meaning#2&}}% \etb@resrvda \etb@scantoks\endgroup\etb@resrvda}} \long\def\etb@apptocmd#1#2{#1#2} \long\def\etb@pretocmd#1#2{#2#1} % {} \newcommand*{\expandonce}[1]{% \unexpanded\expandafter{#1}} % {} \newcommand*{\csexpandonce}[1]{% \expandafter\expandonce\csname #1\endcsname} % {} \newcommand*{\protecting}{} \def\protecting#{% \ifx\protect\@typeset@protect \etb@protecting\@firstofone \fi \ifx\protect\@unexpandable@protect \etb@protecting\etb@unexpandable \fi \ifx\protect\noexpand \etb@protecting\unexpanded \fi \ifx\protect\string \etb@protecting\detokenize \fi \relax\@firstofone} \def\etb@protecting#1#2\relax\@firstofone{\fi#1} \long\def\etb@unexpandable#1{\unexpanded{\protecting{#1}}} % {} \newrobustcmd*{\csdef}[1]{\expandafter\def\csname#1\endcsname} \newrobustcmd*{\csedef}[1]{\expandafter\edef\csname#1\endcsname} \newrobustcmd*{\csgdef}[1]{\expandafter\gdef\csname#1\endcsname} \newrobustcmd*{\csxdef}[1]{\expandafter\xdef\csname#1\endcsname} \newrobustcmd*{\protected@csedef}{\etb@protected\csedef} \newrobustcmd*{\protected@csxdef}{\etb@protected\csxdef} \def\etb@protected{% \let\@@protect\protect \let\protect\@unexpandable@protect \afterassignment\restore@protect} % {}{} \newrobustcmd*{\cslet}[2]{% \expandafter\let\csname#1\endcsname#2} % {}{} \newrobustcmd*{\letcs}[2]{% \expandafter\let\expandafter#1\csname#2\endcsname} % {}{} \newrobustcmd*{\csletcs}[2]{% \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} % {} \newcommand*{\csuse}[1]{% \ifcsname#1\endcsname \csname#1\expandafter\endcsname \fi} % {} \newcommand*{\undef}{} % {} \newcommand*{\csundef}{} \begingroup \catcode`\%=11 \protected\gdef\undef#1{\let#1\etb@un%de%fi%ned} \protected\gdef\csundef#1{\cslet{#1}\etb@un%de%fi%ned} \endgroup % {}{} \newrobustcmd{\appto}[2]{% \ifundef#1% {\edef#1{\unexpanded{#2}}} {\edef#1{\expandonce#1\unexpanded{#2}}}} \newrobustcmd{\eappto}[2]{% \ifundef#1% {\edef#1{#2}} {\edef#1{\expandonce#1#2}}} \newrobustcmd{\gappto}[2]{% \ifundef#1% {\xdef#1{\unexpanded{#2}}} {\xdef#1{\expandonce#1\unexpanded{#2}}}} \newrobustcmd{\xappto}[2]{% \ifundef#1% {\xdef#1{#2}} {\xdef#1{\expandonce#1#2}}} \newrobustcmd*{\protected@eappto}{\etb@protected\eappto} \newrobustcmd*{\protected@xappto}{\etb@protected\xappto} % {}{} \newrobustcmd{\preto}[2]{% \ifundef#1% {\edef#1{\unexpanded{#2}}} {\edef#1{\unexpanded{#2}\expandonce#1}}} \newrobustcmd{\epreto}[2]{% \ifundef#1% {\edef#1{#2}} {\edef#1{#2\expandonce#1}}} \newrobustcmd{\gpreto}[2]{% \ifundef#1% {\xdef#1{\unexpanded{#2}}} {\xdef#1{\unexpanded{#2}\expandonce#1}}} \newrobustcmd{\xpreto}[2]{% \ifundef#1% {\xdef#1{#2}} {\xdef#1{#2\expandonce#1}}} \newrobustcmd*{\protected@epreto}{\etb@protected\epreto} \newrobustcmd*{\protected@xpreto}{\etb@protected\xpreto} % {}{} \newrobustcmd*{\csappto}[1]{\expandafter\appto\csname#1\endcsname} \newrobustcmd*{\cseappto}[1]{\expandafter\eappto\csname#1\endcsname} \newrobustcmd*{\csgappto}[1]{\expandafter\gappto\csname#1\endcsname} \newrobustcmd*{\csxappto}[1]{\expandafter\xappto\csname#1\endcsname} \newrobustcmd*{\protected@cseappto}{\etb@protected\cseappto} \newrobustcmd*{\protected@csxappto}{\etb@protected\csxappto} % {}{} \newrobustcmd*{\cspreto}[1]{\expandafter\preto\csname#1\endcsname} \newrobustcmd*{\csepreto}[1]{\expandafter\epreto\csname#1\endcsname} \newrobustcmd*{\csgpreto}[1]{\expandafter\gpreto\csname#1\endcsname} \newrobustcmd*{\csxpreto}[1]{\expandafter\xpreto\csname#1\endcsname} \newrobustcmd*{\protected@csepreto}{\etb@protected\csepreto} \newrobustcmd*{\protected@csxpreto}{\etb@protected\csxpreto} % {}{} \newrobustcmd*{\numdef}[2]{% \ifundef#1{\let#1\z@}{}% \edef#1{\the\numexpr#2}} \newrobustcmd*{\numgdef}[2]{% \ifundef#1{\let#1\z@}{}% \xdef#1{\the\numexpr#2}} % {}{} \newrobustcmd*{\csnumdef}[1]{% \expandafter\numdef\csname#1\endcsname} \newrobustcmd*{\csnumgdef}[1]{% \expandafter\numgdef\csname#1\endcsname} % {}{} \newrobustcmd*{\dimdef}[2]{% \ifundef#1{\let#1\z@}{}% \edef#1{\the\dimexpr#2}} \newrobustcmd*{\dimgdef}[2]{% \ifundef#1{\let#1\z@}{}% \xdef#1{\the\dimexpr#2}} % {}{} \newrobustcmd*{\csdimdef}[1]{% \expandafter\dimdef\csname#1\endcsname} \newrobustcmd*{\csdimgdef}[1]{% \expandafter\dimgdef\csname#1\endcsname} % {}{} \newrobustcmd*{\gluedef}[2]{% \ifundef#1{\let#1\z@skip}{}% \edef#1{\the\glueexpr#2}} \newrobustcmd*{\gluegdef}[2]{% \ifundef#1{\let#1\z@skip}{}% \xdef#1{\the\glueexpr#2}} % {}{} \newrobustcmd*{\csgluedef}[1]{% \expandafter\gluedef\csname#1\endcsname} \newrobustcmd*{\csgluegdef}[1]{% \expandafter\gluegdef\csname#1\endcsname} % {}{} \newrobustcmd*{\mudef}[2]{% \ifundef#1{\def#1{0mu}}{}% \edef#1{\the\muexpr#2}} \newrobustcmd*{\mugdef}[2]{% \ifundef#1{\let#1\z@}{}% \xdef#1{\the\muexpr#2}} % {}{} \newrobustcmd*{\csmudef}[1]{% \expandafter\mudef\csname#1\endcsname} \newrobustcmd*{\csmugdef}[1]{% \expandafter\mugdef\csname#1\endcsname} % {} \newcommand*{\rmntonum}{} \begingroup \catcode`\%=12 \catcode`\&=14 \gdef\rmntonum#1{\number\numexpr\etb@rti@i#10%} \gdef\etb@rti@i#1#2{& \expandafter\if\expandafter%\detokenize{#2}& +\etb@rti@ii{#1}\expandafter\relax \else \ifnum\etb@rti@ii{#1}<\etb@rti@ii{#2} & +\etb@rti@ii{#2}-\etb@rti@ii{#1}& \expandafter\expandafter\expandafter\etb@rti@i \else +\etb@rti@ii{#1}& \expandafter\expandafter\expandafter\etb@rti@i \expandafter\expandafter\expandafter#2& \fi \fi} \endgroup \def\etb@rti@ii#1{% \ifcsname etb@rmn@\detokenize{#1}\endcsname \csname etb@rmn@\detokenize{#1}\expandafter\endcsname \else \expandafter\z@ \fi} \def\etb@rmn@i{1} \def\etb@rmn@v{5} \def\etb@rmn@x{10} \def\etb@rmn@l{50} \def\etb@rmn@c{100} \def\etb@rmn@d{500} \def\etb@rmn@m{1000} \def\etb@rmn@I{1} \def\etb@rmn@V{5} \def\etb@rmn@X{10} \def\etb@rmn@L{50} \def\etb@rmn@C{100} \def\etb@rmn@D{500} \def\etb@rmn@M{1000} % {}{} \newrobustcmd*{\DeclareListParser}[2]{% \@ifdefinable#1{% \expandafter\expandafter\expandafter\etb@defparser \expandafter\expandafter\expandafter{% \expandafter\@gobble\string#1}{#2}}} \def\etb@defparser#1#2{% \begingroup \edef\@tempa{\endgroup \long\csdef{#1}####1{\expandafter\noexpand \csname etb@dolist@#1\endcsname####1\noexpand#2&}% \long\csdef{etb@dolist@#1}####1\noexpand#2####2&{% \noexpand\ifblank{####1} {} {\noexpand\etb@doitem####1&}% \noexpand\ifblank{####2} {\noexpand\listbreak} {\expandafter\noexpand \csname etb@dolist@#1\endcsname####2}&}}% \@tempa} \long\def\etb@doitem#1#2&{\do{#1#2}} \newcommand*{\listbreak}{} \long\def\listbreak#1&{} % {,,...} => \do{}\do{}... \DeclareListParser{\docsvlist}{,} % {}{} \newrobustcmd{\listadd}[2]{% \ifblank{#2}{}{\appto#1{#2|}}} \newrobustcmd{\listeadd}[2]{% \ifblank{#2}{}{\eappto#1{#2|}}} \newrobustcmd{\listgadd}[2]{% \ifblank{#2}{}{\gappto#1{#2|}}} \newrobustcmd{\listxadd}[2]{% \ifblank{#2}{}{\xappto#1{#2|}}} % {}{} \newrobustcmd{\listcsadd}[1]{% \expandafter\listadd\csname#1\endcsname} \newrobustcmd{\listcseadd}[1]{% \expandafter\listeadd\csname#1\endcsname} \newrobustcmd{\listcsgadd}[1]{% \expandafter\listgadd\csname#1\endcsname} \newrobustcmd{\listcsxadd}[1]{% \expandafter\listxadd\csname#1\endcsname} % {}{}{}{} \newrobustcmd{\ifinlist}[2]{% \begingroup \def\etb@tempa##1|#1|##2&{\endgroup \ifblank{##2}\@secondoftwo\@firstoftwo}% \expandafter\etb@tempa\expandafter|#2|#1|&} \newrobustcmd{\xifinlist}[1]{% \begingroup \edef\etb@tempa{\endgroup\ifinlist{#1}}% \etb@tempa} % {}{}{}{} \newrobustcmd{\ifinlistcs}[2]{% \expandafter\etb@ifinlistcs@i\csname #2\endcsname{#1}} \long\def\etb@ifinlistcs@i#1#2{\ifinlist{#2}{#1}} \newrobustcmd{\xifinlistcs}[1]{% \begingroup \edef\etb@tempa{\endgroup\ifinlistcs{#1}}% \etb@tempa} % {} => \do{}\do{}... \newcommand*{\dolistloop}[1]{% \expandafter\etb@listloop\expandafter{#1}} \DeclareListParser{\etb@listloop}{|} % {} => \do{}\do{}... \newcommand*{\dolistcsloop}[1]{% \expandafter\dolistloop\expandafter{\csname#1\endcsname}} % {} \newcommand*{\AtEndPreamble}{\gappto\@endpreamblehook} \@onlypreamble\AtEndPreamble \newcommand*{\@endpreamblehook}{} \patchcmd{\document} {\endgroup} {\endgroup \let\AtEndPreamble\@firstofone \@endpreamblehook \undef\@endpreamblehook} {} {\PackageInfo{etoolbox}{% Patching \string\document\space failed.\MessageBreak Will try to fork \string\document\@gobble}% \let\etb@document\document \def\document{% \endgroup \let\AtEndPreamble\@firstofone \@endpreamblehook \undef\@endpreamblehook \begingroup \etb@document}} % {} \newcommand*{\AfterEndDocument}{\gappto\@afterdocumenthook} \newcommand*{\@afterdocumenthook}{} \patchcmd\enddocument {\deadcycles} {\let\AfterEndDocument\@firstofone \@afterdocumenthook \deadcycles} {} {\PackageInfo{etoolbox}{% Patching \string\enddocument\space failed.\MessageBreak Will try to fork \string\@@end\@gobble}% \let\etb@@end\@@end \def\@@end{% \let\AfterEndDocument\@firstofone \@afterdocumenthook \etb@@end}} % {} \newrobustcmd*{\AfterPreamble}{\AtBeginDocument} \AtEndPreamble{\let\AfterPreamble\@firstofone} \endinput