I have several commands with some math that I use inside and outside the sectioning commands (\section
, etc.). Of course, package hyperref
complains. I do not want to scan the sectioning commands to put \texorpdfstring
inside them. I thought to change the definitions so my commands use \texorpdfstring
. In this case \texorpdfstring
will appear outside the sectioning commands. I wonder wheter this will work, or I need another solution.
1 Answer
\texorpdfstring
works outside of \section
, I've used it several times to avoid issues with \and
in \author
(it's not rendered when filling the PDF metadata), and I don't get errors or warnings when I use it that way.
I think it's really just a one-liner to have an if-then-else branching instruction. I may be wrong, of course.
\texorpdfstring
is independently from the command\section
. For more details please provide a MWE.