Hi list,
sorry for missing the CC: So short recap. Jarmo found this:
> I think I found the issue: fontspec gets included in exported latex even
> though pdflatex is the engine. At least in 9.7.11, in org.el
>
> (defcustom org-latex-default-packages-alist
> '(;; amsmath before fontspec for lualatex and xetex
> ("" "amsmath" t ("lualatex" "xetex"))
> ;; fontspec ASAP for lualatex and xetex
> ("" "fontspec" t ("lualatex" "xetex"))
So that may be a part to investigate.
1) "xetex" is obviously wrong, it should be "xelatex"
2) if we don't want these packages to be included when generating snippets,
the snippets flag should be nil.
Question is why on earth if Jarmo is using pdflatex, we see it fontspec is
being used.
Best, /PA
On Fri, 17 Apr 2026 at 11:37, Jarmo Hurri <[email protected]> wrote:
>
> Greetings.
>
> How do I specify an engine to use in an individual latex Babel block?
>
> Here is an example of the type of block I am having trouble with:
>
> #+begin_src latex :file not-gate.pdf :fit yes :headers
> '("\\usepackage{tikz,circuitikz}") :results output graphics file :cache yes
> \begin{circuitikz}[color=white]
> \ctikzset{logic ports origin=center}
> \draw (0, 0) node [not port,scale=1.7] (notport) {}
> (notport.in) node [anchor=east] {A}
> (notport.center) node {\scriptsize NOT};
> \end{circuitikz}
> #+end_src
>
> This block used to compile just fine with pdflatex but now complains
>
> \msg_fatal:nn {fontspec} {cannot-use-pdftex}
>
> and says I have to use either xelatex or lualatex.
>
> All the best,
>
> Jarmo
>
>
>
--
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
"Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
Year 2 of the New Koprocracy