Pandoc: latex variable: only last geometry argument is used

Created on 5 Dec 2019  路  2Comments  路  Source: jgm/pandoc

I understand from the documentation on latex variables, various S-O answers and the behavior within my own downstream package that so far, this was a valid pandoc call:

echo "hello" > test.md
pandoc --standalone --output=test.tex --variable=geometry:paperwidth=2 --variable=geometry:paperheight=3 test.md

My expectation was that the two geometry options would be concatenated in the resulting LaTeX.

This is also what the docs say, I think:

option for geometry package, e.g. margin=1in; repeat for multiple options

Instead, pandoc only seems to consider whatever geometry variable came last:

\usepackage[paperheight=3]{geometry}

paperwidth=2 is missing from the output.

I can hack-fix this by concatenating the options myself:

pandoc --standalone --output=test.tex --variable=geometry:paperwidth=2,paperheight=3 test.md

yields:

\usepackage[paperwidth=2,paperheight=3]{geometry}

Has this behavior changed, or am I delusional? (might break other downstream usage).

If this is an intended change, perhaps the documentation could be improved.


pandoc -v:

pandoc 2.8.0.1
Compiled with pandoc-types 1.20, texmath 0.12, skylighting 0.8.3
Default user data directory: /Users/max/.local/share/pandoc or /Users/max/.pandoc
Copyright (C) 2006-2019 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
bug

All 2 comments

Yes, behavior has changed (confirmed that pandoc 2.7.2 amalgamates the options.)
The change wasn't intentional (unless I'm forgetting something) and wasn't documented.
Probably this should be considered a regression and fixed, though I may be forgetting something...there were a lot of changes in that part of the code.

Fixing this may require changing the Semigroup instance for Context in doctemplates.

Was this page helpful?
0 / 5 - 0 ratings