emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* error org export to pdf when latex letter class has been added to org-latex-classes
@ 2022-09-13 15:54 M. Pger
  2022-09-13 17:55 ` Juan Manuel Macías
  2022-09-14  2:53 ` Ihor Radchenko
  0 siblings, 2 replies; 6+ messages in thread
From: M. Pger @ 2022-09-13 15:54 UTC (permalink / raw)
  To: emacs-orgmode

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

Dear All,

I've told Org about the letter class with the following in my init file:
```
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes '("letter" "\\documentclass{letter}")) )
```

After that I can create a org document containing e.g.:
```
#+latex_class: letter
#+latex_header: \signature{M. Pger}#+latex_header: \address{42 My Street \\ My Town}

#+latex: \begin{letter}{Org mailing-list \\ 42 GNU Street \\ GNU Town}
#+latex: \date{September 2022}#+latex: \opening{Dear Members of the Org mailing-list,}

Here is the text of the letter.

#+latex: \closing{Yours faithfully,}
#+latex: \end{letter}

```

When I export it using C-c C-e l o, an error appears:
```
(/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty

! LaTeX Error: Environment thebibliography undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.1063 \renewenvironment{thebibliography}
[1]{%
?
! Emergency stop.
...

l.1063 \renewenvironment{thebibliography}
[1]{%! ==> Fatal error occurred, no output PDF file produced!
```

In order to have a pdf output, I can use -interaction=nonstopmode​ in the org-latex-pdf-process​, but of course the error is still there (but now I have a pdf, which is good). Exporting from org, the error is there whenever I use latexmk​ (with pdflatex​) or directly pdflatex​.

However, there is no error when creating such a letter from a .tex file in Auctex (which appears to also use pdflatex​ as the compiler).

Any thoughts?

Best,

M

[-- Attachment #2: Type: text/html, Size: 5658 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: error org export to pdf when latex letter class has been added to org-latex-classes
@ 2022-09-15  7:07 Pedro Andres Aranda Gutierrez
  0 siblings, 0 replies; 6+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-09-15  7:07 UTC (permalink / raw)
  To: Org Mode List

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

Hi,

for what it may help...

my emacs version:

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0)
 of 2022-09-12

Adding
#+OPTIONS: toc:nil
to your MWE

I have this small file to export to latex:
```
(require 'org)
(require 'ox-latex)

(eval-after-load "org"
  (progn
    ;; Add KOMA script based books
    (add-to-list 'org-latex-classes
                 '("letter"
                   "\\documentclass{letter}"))

    (setq org-latex-pdf-process '("latexmk -bibtex -f %f")
          org-babel-python-command "python3")))

```
And I use it as:

```
emacs -Q --batch test.org -l org-export.el -f org-latex-export-to-pdf
```

And I see no errors...

Maybe you could try from here and start stripping things further from it to
narrow the problem

Hope it helps...
/PedroAAranda
-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet

[-- Attachment #2: Type: text/html, Size: 1993 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-15  7:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 15:54 error org export to pdf when latex letter class has been added to org-latex-classes M. Pger
2022-09-13 17:55 ` Juan Manuel Macías
2022-09-13 19:59   ` M. Pger
2022-09-13 20:15     ` Juan Manuel Macías
2022-09-14  2:53 ` Ihor Radchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-09-15  7:07 Pedro Andres Aranda Gutierrez

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).