Skip to content

Commit

Permalink
tests: expansion control, hook mngmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Jun 11, 2018
1 parent 5abaee3 commit 6469221
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion t/expansion/etoolbox.tex
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,46 @@ \subsubsection{Arithmetic definitions}
5mu = \muone
% ---
\subsection{Expansion control}
\def\lvlone{first}
\def\lvltwo{\lvlone}
\def\lvlthree{\lvltwo}
\edef\elvl{\lvlthree}
\edef\lvltest{\expandonce{\lvlthree}}
\edef\lvltesttwo{\csexpandonce{lvltwo}}
full expansion: \meaning\elvl

expand once: \meaning\lvltest

csexpandonce: \meaning\lvltesttwo

\subsection{Hook management}
% TODO
% Source: https://www.dickimaw-books.com/latex/admin/html/hooks.shtml

\newcommand{\mymacro}{x}%
\mymacro;
\appto\mymacro{AB}%
\mymacro;
\appto\mymacro{YZ}%
\mymacro.

\renewcommand{\mymacro}{x}%
\newcommand{\myothermacro}{AB}%
\epreto\mymacro{\myothermacro}%
\renewcommand{\myothermacro}{YZ}%
\eappto\mymacro{\myothermacro}
\mymacro.

\renewcommand{\mymacro}{x}%
\newcommand{\mymacroB}{\mymacroC}%
\newcommand{\mymacroC}{\mymacroD}%
\newcommand{\mymacroD}{Z}%
\eappto\mymacro{\mymacroB}
\mymacro.

\newcommand{\premacro}{x}
\bgroup\csgpreto{premacro}{pre-}\egroup
\premacro.

\subsection{Patching}
% TODO
\subsection{Boolean Flags}
Expand Down

0 comments on commit 6469221

Please sign in to comment.