I can't understand why the following doesn't work:
\documentclass{beamer}
\newif\iftemp \tempfalse
\iftemp
\csname if@chapter@pp\endcsname
\addcontentsline{toc}{part}{Appendices}
\fi
\fi
\begin{document}
\begin{frame}{Test}
\end{frame}
\end{document}
while the following works:
\documentclass{beamer}
\usepackage{ifthen}
\def\temptemp{temp}
\ifthenelse{\equal{\temptemp}{wrong}}{
\csname if@chapter@pp\endcsname
\addcontentsline{toc}{part}{Appendices}
\fi
}{}
\begin{document}
\begin{frame}{Test}
\end{frame}
\end{document}
Seems like \iftemp ... \fi
does NOT ignore it's content even when \iftemp is false.
For a separate reason, I want to use \iftemp
instead of \ifthenelse{...}
.
Any hotfix here?
\if(true|false) ... \fi
paired, try the trick\expandafter\ifx\csname if@chapter@pp\expandafter\endcsname\csname iftrue\endcsname
from Heiko Oberdiek's previous answer