|
From: | Michael |
Subject: | Re: [PATCH] Run latex more than once for LaTeX src block evaluation |
Date: | Fri, 22 Mar 2024 10:23:35 -0700 |
User-agent: | mu4e 1.6.10; emacs 30.0.50 |
I have a small patch for `org-preview-latex-process-alist' making the default setting for LaTeX source block evaluation be runninglatex three times (instead of the current one). It is sometimes necessary to run latex more than once to produce the final document, a phenomenom described in the docstring for `org-latex-pdf-process' which itself runs latex three times by default. This patch just brings the former variable into parity with the latter.Thanks for the patch!May you please describe a use case when it is necessary to run latexmultiple times for previews?
Sure: it's required whenever you have LaTeX that refers to other document elements whose positions are only known after they've been typeset. This often comes up with bibliographies; to quote the docstring for `org-latex-pdf-process': "The reason why this is a list is that it usually takes several runs of ‘pdflatex’, maybe mixed with a call to ‘bibtex’." I personally encountered it when using the tikzmark library from the tikzpicture package to draw annotations on a table (LaTeX needed to be run once to typeset the table & only then did it "know" where the arrows needed to be drawn). Oh-- and it's not just previews (sorry if I gave that impression)-- it's also required for "evaluating" LaTeX source blocks.
CCing Timothy and Kathik - I see that https://code.tecosaur.net/tec/org-mode/src/branch/dev/lisp/org-latex-preview.el#L102 still uses a single compiler invocation.
-- Michael <mherstine@pobox.com>
[Prev in Thread] | Current Thread | [Next in Thread] |