quarto-journals / acm

Quarto template for the Association of Computing Machinery
https://quarto-journals.github.io/acm/
MIT License
16 stars 9 forks source link

Fix #22: Add tex-program metadata #23

Open jooyoungseo opened 1 year ago

jooyoungseo commented 1 year ago

Add tex-program metadata in templates to support most of the tex editors. Default is xelatex. See https://tex.stackexchange.com/questions/78101/when-and-why-should-i-use-tex-ts-program-and-tex-encoding

cscheid commented 1 year ago

Thanks for the PR. Have you tried using the pdf-engine option for this? https://quarto.org/docs/output-formats/pdf-engine.html

jooyoungseo commented 1 year ago

I was trying to use $pdf-engine$ variable like below:

% !TEX program = $if(pdf-engine)$$pdf-engine$$else$xelatex$endif$

For some reason, it does not pick up the pdf-engine value from the YAML metadata when specified. Maybe, I have missed something?

jooyoungseo commented 1 year ago

FYI, I proposed to auto-insert this tex directive by using pdf-engine. Unfortunately, it had to be closed in the upstream issue:

https://github.com/jgm/pandoc/issues/8524

cscheid commented 1 year ago

Ah, I understand what's happening. Pandoc behaves slightly differently from quarto when it comes to latex-vs-pdf rendering. I wonder if we can change something in quarto to make sure that the pdf-engine option is available in the latex writer, etc.

jooyoungseo commented 1 year ago

Yes, that would be great! Maybe, we can also pass other metadata to tex tex directives, such as text encoding, root, etc. We may want to apply this to other templates later.

cscheid commented 1 year ago

Let me try to figure out how this stuff works and get back to you in a couple of days.