Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
\texorpdfstring is independently from the command \section. For more details please provide a MWE. –  Marco Daniel Jan 30 '12 at 13:13
2  
Did you try? :) –  egreg Jan 30 '12 at 13:14

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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