8

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.

2
  • 3
    \texorpdfstring is independently from the command \section. For more details please provide a MWE. Jan 30, 2012 at 13:13
  • 3
    Did you try? :)
    – egreg
    Jan 30, 2012 at 13:14

1 Answer 1

8

\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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.