I am trying to transition to using the etoolbox package, but seem to have run into some difficulties and they appear related to the hyperref and bm packages which to me seem totally unrelated. The MWE example compiles since \RemoveEToolbox is defined and shows that there is no apparent problem before etoolbox was used.
Commenting out the \def\RemoveEToolbox{} line produces two problems:
With both the
\renewcommand, and theusepackage{hyperref}commented, this results in "Runaway argument? Paragraph ended before \bm@test@token was complete".Including the
usepackage{hyperref}(with\renewcommandcommented) results in "Undefined control sequence. \Call@AtVeryEndDocument ...cumentHook \@undefined"
But if uncomment the \renewcommand{\bm}{#1} line (effectively doing without any \bm), then this seems to compile.
I have been using this for a while now and things appeared to have been working fine, but now that I attempt to use etoolbox I seem to run into problems.
\documentclass{standalone}
\def\RemoveEToolbox{}% Shows that this works fine without {etoolbox}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{bm}
\ifdefined\RemoveEToolbox
\newcommand*{\iftoggle}[3]{#2}% Default to true value of "if"
\else
\usepackage{etoolbox}
\newtoggle{paper}
\toggletrue{paper}
%\renewcommand{\bm}[1]{#1}% Why can't I have a normal \bm with {etoolbox}?
\fi
% \usepackage{hyperref}
\begin{document}
This document is intended for
\iftoggle{paper}{paper}{electronic}
distribution.
\bm{\textcolor{blue}{Solve $x^2-1=0$}}
\begin{align*}
a &= b\\
\iftoggle{paper}{
c &= d\\
}{}
e &= f\\
\end{align*}
\end{document}
standalonepackage, not the class which is used here. However, the class code is quite similar. – Martin Scharrer Jul 13 '11 at 19:46documentenvironment and therefore both have this issue anyway. – Martin Scharrer Jul 13 '11 at 19:51