Skip to content
Discussion options

You must be logged in to vote

Just another approach that may be considered.

Pandoc's template are quite simple in their logic as you can't really do complex if condition. But you could do something like

$if(tpg-theme-abc)$
$_abc.tex()$
$elseif(tpg-theme-cde)$
$_cde.tex()$
$else$
$_theme-default.tex()$
$endif$

Then in your document YAML, you could use tpg-theme-abc: true or tpg-theme-cde: true to activated one of the template.
Probably with a Lua filter, you could offer support for

tpg-theme: abc

by transforming to the correct variable for the template.

Maybe this is not possible because you said

I can't change before-body.tex. It is set by my extension code.

But I am not sure what is inside your partials...

Anyway…

Replies: 2 comments 19 replies

Comment options

You must be logged in to vote
2 replies
@eeholmes
Comment options

@mcanouil
Comment options

Comment options

You must be logged in to vote
17 replies
@mcanouil
Comment options

@dragonstyle
Comment options

@eeholmes
Comment options

@mcanouil
Comment options

@eeholmes
Comment options

Answer selected by eeholmes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants