emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] latex run fails for ob-latex with imagemagick options
@ 2025-01-07 13:09 Robert Klein
  0 siblings, 0 replies; only message in thread
From: Robert Klein @ 2025-01-07 13:09 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

Hi,

when trying to create an image by the attached code (test.org), the LaTeX run
fails because the interim code contains both pdflatex and luatex
specific usepackage commands fontspec, inputenc, and fontenc).


The code is supposed to export a LaTeX-tikz to png using the imagemagick header options (as described in the ob-latex documentation of worg).  I get no error when I remove the imagemagick header line (but also unusable output).

According to my bisect the first commit this happens is:


a4a880d1f99b353311309d6348d02b99b142b911 is the first bad commit
commit a4a880d1f99b353311309d6348d02b99b142b911
Author: Pedro A. Aranda Gutierrez <paaguti@gmail.com>
Date:   Sun Jan 28 17:51:23 2024 +0100

    org-latex-default-packages-alist: Refine packages for font management

    * lisp/org.el (org-latex-default-packages-alist): Change to refine
    font management depending on the latex compiler.

    Differentiate between pdflatex and lualatex/xetex
    packages for font management.  lualatex/xetex should use
    fontspec instead of fontenc/inputenc.  When using
    fontspec, you need to load amsmath before fontspec
    and you don't need amssymb.

 lisp/org.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


I also attached the interim LaTeX file, the log file of the LaTeX run and the contents of the *Org PDF LaTeX Output* buffer.


Thanks for any help.

Best regards
Robert

[-- Attachment #2: test.org --]
[-- Type: text/org, Size: 1102 bytes --]


#+Name: my-dit
#+header: :exports results :file my-dit.png
#+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 1200
#+header: :fit yes :noweb yes :headers '("\\usepackage{tikz}")
#+begin_src latex :exports results :results raw :file my-dit.png
  \usetikzlibrary{matrix,arrows,decorations.pathmorphing}
  \begin{tikzpicture}[scale=2.5,font=\footnotesize\sffamily]
  \node (A) at (2,2) {dc=test.dc=example.dc=org};
  \node (B) at (0,1) {ou=aliases};
  \node (C) at (1,1) {ou=people};
  \node (D) at (2,1) {ou=group};
  \node (E) at (3,1) {ou=smbhosts};
  \node (F) at (4,1) {ou=automount};
  \node (G) at (5,1) {ou=bozos};
  \node (L) at (0,0) {ou=green-dept};
  \node (M) at (1,0) {...};
  \node (N) at (2,0) {ou=yellow-dept};
  \path[-]
  (A) edge node{} (B)
  (A) edge node{} (C)
  (A) edge node{} (D)
  (A) edge node{} (E)
  (A) edge node{} (F)
  (A) edge node{} (G)
  (C) edge node{} (L)
  (C) edge node{} (M)
  (C) edge node{} (N);
  \end{tikzpicture}
#+end_src

#+Caption: My Directory Information Tree
#+Attr_HTML: :width 840
#+Attr_LaTeX: :width 14cm
#+Results: my-dit

[-- Attachment #3: Org-PDF-LaTeX-Output --]
[-- Type: application/octet-stream, Size: 3073 bytes --]

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 7 Apr. 2024. Version 4.85.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex':  Reasons for rerun
Category 'other':
  Rerun of 'pdflatex' forced or previously required:
    Reason or flag: 'Initial setup'

------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -interaction=nonstopmode -recorder -output-directory="/tmp/babel-BWLnVc"  "../../../tmp/babel-BWLnVc/latex-d59qmR.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/tmp/babel-BWLnVc/../../../tmp/babel-BWLnVc/latex-d59qmR.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-def/pdftex.def)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)))

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.
(fontspec)                      
(fontspec)                      You must change your typesetting engine to,
(fontspec)                      e.g., "xelatex" or "lualatex" instead of
(fontspec)                      "latex" or "pdflatex".

Type <return> to continue.
 ...                                              
                                                  
l.101 \msg_fatal:nn {fontspec} {cannot-use-pdftex}
                                                  

Failure to make '/tmp/babel-BWLnVc/latex-d59qmR.pdf'
Latexmk: Getting log file '/tmp/babel-BWLnVc/latex-d59qmR.log'
Latexmk: Examining '/tmp/babel-BWLnVc/latex-d59qmR.fls'
Latexmk: Examining '/tmp/babel-BWLnVc/latex-d59qmR.log'
Latexmk: Errors, in force_mode: so I tried finishing targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to '/tmp/babel-BWLnVc/latex-d59qmR.log' and/or above output for details


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: latex-d59qmR.log --]
[-- Type: text/x-log, Size: 5667 bytes --]

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex 2024.10.10)  7 JAN 2025 13:39
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**../../../tmp/babel-BWLnVc/latex-d59qmR.tex
(/tmp/babel-BWLnVc/../../../tmp/babel-BWLnVc/latex-d59qmR.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2024/02/08 v1.4n Standard LaTeX file (size option)
)
\c@part=\count194
\c@section=\count195
\c@subsection=\count196
\c@subsubsection=\count197
\c@paragraph=\count198
\c@subparagraph=\count199
\c@figure=\count266
\c@table=\count267
\abovecaptionskip=\skip49
\belowcaptionskip=\skip50
\bibindent=\dimen141
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/color.sty
Package: color 2024/01/14 v1.3d Standard LaTeX Color (DPC)

(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 149.

(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2024/04/13 v1.2c Graphics/color driver for pdftex
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2024/05/23 v2.17q AMS math features
\@mathmargin=\skip51

For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text

(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks17
\ex@=\dimen142
))
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen143
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2022/04/08 v2.04 operator names
)
\inf@bad=\count268
LaTeX Info: Redefining \frac on input line 233.
\uproot@=\count269
\leftroot@=\count270
LaTeX Info: Redefining \overline on input line 398.
LaTeX Info: Redefining \colon on input line 409.
\classnum@=\count271
\DOTSCASE@=\count272
LaTeX Info: Redefining \ldots on input line 495.
LaTeX Info: Redefining \dots on input line 498.
LaTeX Info: Redefining \cdots on input line 619.
\Mathstrutbox@=\box52
\strutbox@=\box53
LaTeX Info: Redefining \big on input line 721.
LaTeX Info: Redefining \Big on input line 722.
LaTeX Info: Redefining \bigg on input line 723.
LaTeX Info: Redefining \Bigg on input line 724.
\big@size=\dimen144
LaTeX Font Info:    Redeclaring font encoding OML on input line 742.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 743.
\macc@depth=\count273
LaTeX Info: Redefining \bmod on input line 904.
LaTeX Info: Redefining \pmod on input line 909.
LaTeX Info: Redefining \smash on input line 939.
LaTeX Info: Redefining \relbar on input line 969.
LaTeX Info: Redefining \Relbar on input line 970.
\c@MaxMatrixCols=\count274
\dotsspace@=\muskip17
\c@parentequation=\count275
\dspbrk@lvl=\count276
\tag@help=\toks18
\row@=\count277
\column@=\count278
\maxfields@=\count279
\andhelp@=\toks19
\eqnshift@=\dimen145
\alignsep@=\dimen146
\tagshift@=\dimen147
\tagwidth@=\dimen148
\totwidth@=\dimen149
\lineht@=\dimen150
\@envbody=\toks20
\multlinegap=\skip52
\multlinetaggap=\skip53
\mathdisplay@stack=\toks21
LaTeX Info: Redefining \[ on input line 2953.
LaTeX Info: Redefining \] on input line 2954.
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2024-09-10 L3 programming layer (loader)

(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2024-05-08 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count280
\l__pdf_internal_box=\box54
))
Package: xparse 2024-08-16 L3 Experimental document command parser
)
Package: fontspec 2024/05/11 v2.9e Font selection for XeLaTeX and LuaLaTeX

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.
(fontspec)
(fontspec)                      You must change your typesetting engine to,
(fontspec)                      e.g., "xelatex" or "lualatex" instead of
(fontspec)                      "latex" or "pdflatex".

Type <return> to continue.
 ...

l.101 \msg_fatal:nn {fontspec} {cannot-use-pdftex}


LaTeX does not know anything more about this error, sorry.

Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.

This is a fatal error: LaTeX will abort.



! Emergency stop.
<read *>

l.101 \msg_fatal:nn {fontspec} {cannot-use-pdftex}

*** (cannot \read from terminal in nonstop modes)


Here is how much of TeX's memory you used:
 1498 strings out of 473579
 24614 string characters out of 5728233
 409354 words of memory out of 5000000
 24439 multiletter control sequences out of 15000+600000
 558069 words of font info for 36 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 79i,0n,93p,267b,42s stack positions out of 10000i,1000n,20000p,200000b,200000s
!  ==> Fatal error occurred, no output PDF file produced!

[-- Attachment #5: latex-d59qmR.tex --]
[-- Type: text/x-tex, Size: 1644 bytes --]

\documentclass{article}
\usepackage[usenames]{color}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\pagestyle{empty}             % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}
\usepackage[active, tightpage]{preview}

\usepackage{tikz}

\begin{document}
\begin{preview}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\begin{tikzpicture}[scale=2.5,font=\footnotesize\sffamily]
\node (A) at (2,2) {dc=test.dc=example.dc=org};
\node (B) at (0,1) {ou=aliases};
\node (C) at (1,1) {ou=people};
\node (D) at (2,1) {ou=group};
\node (E) at (3,1) {ou=smbhosts};
\node (F) at (4,1) {ou=automount};
\node (G) at (5,1) {ou=bozos};
\node (L) at (0,0) {ou=green-dept};
\node (M) at (1,0) {...};
\node (N) at (2,0) {ou=yellow-dept};
\path[-]
(A) edge node{} (B)
(A) edge node{} (C)
(A) edge node{} (D)
(A) edge node{} (E)
(A) edge node{} (F)
(A) edge node{} (G)
(C) edge node{} (L)
(C) edge node{} (M)
(C) edge node{} (N);
\end{tikzpicture}
\end{preview}
\end{document}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-07 13:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07 13:09 [BUG] latex run fails for ob-latex with imagemagick options Robert Klein

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).