olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

Idea: Add \texorpdfstring #49

Closed robertbachmann closed 1 year ago

robertbachmann commented 3 years ago

texdoc hyperref has \texorpdfstring{TEXstring}{PDFstring}. I'll need something similar for Pandoc-OpTeX.

Example usage would be:

\sec \texorpdfstring{H$_2$O is Water}{H2O is water}

My current implementation is

\let\texorpdfstring=\usefirst
\regmacro{}{}{\let\texorpdfstring=\usesecond}

Can we implement that to in the base format? If yes, I can prepare a pull-request with code and documentation.

olsak commented 3 years ago

If it doesn't enlarge the user documentation then it is good idea. I always balance between "short documentation without many commands and parameters" and "macros are ready for users". The first case has (of course) a disadvantage: users are forced "do it yourself".

robertbachmann commented 1 year ago

Not needed anymore. I've found a nicer solution for pandoc-optex.