\documentclass{article}
\usepackage{afterpage}
\newcommand{\showSEs}[2]{#1}
\begin{document}
\afterpage{\clearpage
\renewcommand{\showSEs}[2]{#2} % To not show SEs
\showSEs{this one}{or this one}
\renewcommand{\showSEs}[2]{#1} % To show SEs
}
\end{document}
> The following simple file fails with " Illegal parameter number in
> definition of \AP@." Can anyone tell me what is wrong?!
Try doubling the #s until it works. If \afterpage ends up putting your
argument inside a macro definition (\AP@) itself, your #2 wants to look at
the second argument to \AP@, not \showSEs.
HTH
Ulrich
Ulrich M. Schwarz offers good advice, but I think even better advice is
to avoid the redifinition of macros (with arguments) inside moving
arguments.
\documentclass{article}
\usepackage{afterpage}
\newcommand{\showSEsone}[2]{#1}
\newcommand{\showSEstwo}[2]{#2}
\newcommand{\showSEs}{\showSEsone} % shorter: \let\showSEs=\showSEsone
\begin{document}
\afterpage{\clearpage
\renewcommand{\showSEs}{\showSEStwo} % or \let\showSEs=\showSEstwo
\showSEs{this one}{or this one}
\renewcommand{\showSEs}{\showSEstwo} % or \let\showSEs=\showSEsone
}
\end{document}
For bonus points, note that \showSEsone and \showSEstwo are already
internal LaTeX macros named \@firstoftwo and \@secondoftwo.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
> Ulrich M Schwartz and Bertrand Russell --
> Thank you!! What great responses!
I'm glad you found the Bertrand Russell quote helpful.
Never knew philosophy could be so useful in solving TeX problems.
8-)