3

Putting a math element into an org mode headline causes latex to complain. ie

* This contains $\prod_{k=1}^N$ math
Lorem ipsum

gives

Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `math shift' on input line 29.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `\prod@' on input line 29.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `\slimits@' on input line 29.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `subscript' on input line 29.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)                removing `superscript' on input line 29.

4
  • Ok I seem to have found the answer hidden in the org mode mailing list: list.orgmode.org/[email protected]/T/… Will see if I can clean it up with a macro and post answer
    – Rusi
    Commented Apr 11, 2022 at 10:33
  • @NickD Its rendered but it has hyperref/inputenc related errors
    – Rusi
    Commented Apr 11, 2022 at 11:51
  • Ok just now Im only getting the warnings not the full errors. Will need to see what (other environments?) were upgrading to errors
    – Rusi
    Commented Apr 11, 2022 at 11:59
  • See also tex.stackexchange.com/questions/10555/…
    – NickD
    Commented Apr 12, 2022 at 6:14

1 Answer 1

2

After posting I found a reference in the Org mode mailing list showing how to get round this issue.

Following: the first headline shows org developer Nicolas Goaziou's solution. The second shows how to tighten it a bit with an org mode macro mt which takes math ($$ implied) in arg-1 and equivalent ASCII in arg-2 to keep hyperref happy.

#+MACRO: mt @@latex:\texorpdfstring{$ $1 $}{$2}@@
# mt = math-text
* This contains @@latex:\texorpdfstring{$\prod_{k=1}^N$}{product 1toN}@@ math
Lorem ipsum
* This is better {{{mt(\prod_{k=3}^N,product 1toN)}}} math
Dolor sit amet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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