pandoc
pandoc copied to clipboard
Latex classoption with underbar ('_') is escaped
Underbars are escaped in tex files when class options contain them.
Example:
classoption: - head_space=10cm
In the tex file:
\documentclass[head\_space=10cm]{jlreq}
the underbar ('') is escaped to '\'
Some of the margin options like "head_space" or "column_gap" in the lualatex class file "jlreq" for Japanese include underscores.
https://www.tug.org/texlive//Contents/live/texmf-dist/doc/latex/jlreq/jlreq-ja.html
If you pass this in as a variable, not as metadata, then it won't be escaped. Metadata values are always parsed as markdown and then escaped when rendered as LaTeX (e.g. when interpolated in a template).
Try -Vclassoption='head_space=10cm'
on the command line, or in a defaults file:
variables:
classoption:
- 'head_space=10cm'
Or, if you really want to use metadata, specify that the string is raw latex:
classoption:
- `head_space=10cm`{=latex}
I think this can be closed.