9

In pandoc, you can see if you have a variable or not ($if(something)$ put $something$ $endif$), but I want to act depending on its value. Something like:

$if(lang)=='en'$ Hello $else$ Aloha $endif$

Is it possible? In Pandoc Manual I don't see nothing

1 Answer 1

14
+50

That would have been inside Pandoc Manual if there was such a feature and according to this pandoc-discuss it is not possible with .

What it is possible, is to define some more general variables that will contain things you want to change.

For example if you want to use the English language, set a variable lang.en and check it with $if(lang.en)$. If you want another language then unset lang.en and set lang.fr and use it like this:

$if(lang.en)$
Hello
$else$
Aloha
$endif$

$if(lang.fr)$
Bonjour
$else$
Aloha
$endif$
1
  • 2
    Perhaps we could add a request issue Commented Aug 18, 2018 at 22:08

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.