Greetings Pedro.
Pedro Andres Aranda Gutierrez <[email protected]> writes: >> >> 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. >> Org mode version 9.7.11 (release_9.7.11 @ /usr/share/emacs/30.2/lisp/org/) > I was afraid my work on the LaTeX exporter was interfering with your > workflow. It apparently isn't, because only a fraction is in 9.8 and > the rest is in the feature/all-tex-fonts branch. > > Anyhow, my interest in the parts of your configuration that drive > ob-latex is to make sure that anything I do in the LaTeX doesn't break > things I personally have not needed and thus, maybe, taken for > granted. This issue is then certainly not a consequence your work. 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")) ... According to the documentation of that variable ---------------------------------------------------------------------------- A cell is of the format (\"options\" \"package\" SNIPPET-FLAG COMPILERS) If SNIPPET-FLAG is non-nil, the package also needs to be included when compiling LaTeX snippets into images for inclusion into non-LaTeX output. ---------------------------------------------------------------------------- Now, in that list SNIPPET-FLAG is true for fontspec: ("" "fontspec" t ("lualatex" "xetex")) I think that is why fontspec ends up being included in the generated tex file even though engine is pdflatex, there is no need for fontspec and, most importantly, it would then require xelatex or lualatex to be compiled. If I remove \usepackage{fontspec} from the generated tex, it compiles just fine. Note that the documentation talks about "inclusion into non-LaTeX output," but I am seeing inclusion into Beamer output at least. Not sure this is relevant in the latest versions, but I need to create some sort of a temporary fix for this in my system. All the best, Jarmo
