-
I am including a subfile within a latex template partial. I would like to choose the subfile based on a variable in the qmd document YAML. Like so: Pertinent part of the qmd YAML where I have added the variable
Then in the latex template partial
This unfortunately does not work. Does anyone know of a way to dynamically (using a variable in the doc YAML) specify the subfile that is included in a template partial? BTW here is what does work:
Then in
Why don't I just do this? Because I can't change Any solution that achieve this effect would work. I am not wedded to
I have no idea how to do that though. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 19 replies
-
I played a bit with your repository especially 'vline' and 'great-wave' (some issues with that one) to see how to answer your question. In my understanding of Pandoc template, it is not possible to have partial LaTeX file paths dynamically set from yaml header. Regarding a Lua filter, it might be the solution, but I do not know when it is applied exactly in Quarto's workflow. In your case, I would go for several subdirectories for each format and wait for #1836 |
Beta Was this translation helpful? Give feedback.
-
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
Then in your document YAML, you could use
by transforming to the correct variable for the template. Maybe this is not possible because you said
But I am not sure what is inside your partials... Anyway, just sharing in case it helps |
Beta Was this translation helpful? Give feedback.
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
Then in your document YAML, you could use
tpg-theme-abc: true
ortpg-theme-cde: true
to activated one of the template.Probably with a Lua filter, you could offer support for
by transforming to the correct variable for the template.
Maybe this is not possible because you said
But I am not sure what is inside your partials...
Anyway…