Can't add \raisebox to ToC in XeTeX
You need to protect the fragile command \PoETeX
:
\addcontentsline{toc}{section}{\protect\PoETeX}
If you plan to often use \PoETeX
in moving arguments, it's better to use
\DeclareRobustCommand*{\PoETeX}{%
P\kern -.15em\raisebox{-0.21em}{O}\kern -.05em E\TeX}
so you won't have to put \protect
before the command in many places.
Roughly speaking, defining a command with \DeclareRobustCommand
is like having \protect
before it whenever it's needed. Don't take the habit of defining all commands like this: use the technique only where it proves necessary.
Alternative definition:
\protected\def\PoETeX{%
P\kern -.15em\raisebox{-0.21em}{O}\kern -.05em E\TeX}
This is actually more efficient than \DeclareRobustCommand
, but has the disadvantage of using low level commands.