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-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-14  2:53 ` Ihor Radchenko
  1 sibling, 1 reply; 6+ messages in thread
From: Juan Manuel Macías @ 2022-09-13 17:55 UTC (permalink / raw)
  To: M. Pger; +Cc: orgmode

Hi,

M. Pger writes:

> (/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!

Are you including citations in your letter? Maybe this is related:
https://latex.org/forum/viewtopic.php?f=4&t=3359

Best regards,

Juan Manuel 

-- 
--
------------------------------------------------------
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com




^ 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-13 17:55 ` Juan Manuel Macías
@ 2022-09-13 19:59   ` M. Pger
  2022-09-13 20:15     ` Juan Manuel Macías
  0 siblings, 1 reply; 6+ messages in thread
From: M. Pger @ 2022-09-13 19:59 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: orgmode

Hi,

Thank you for your answer.

> Are you including citations in your letter? 

No, that's also why it is puzzling. You should be able to reproduce the issue by creating a really minimalist init file including the following:
```
(with-eval-after-load 'ox-latex
  (add-to-list 'org-latex-classes '("letter" "\\documentclass{letter}"))
  )

(setq org-latex-pdf-process (list "latexmk -shell-escape -f -pdf %f"))
```

As mentioned in my previous mail, the error also appears when using `pdflatex` instead of `latexmk`.

Best,

M

------- Original Message -------
On Tuesday, September 13th, 2022 at 7:55 PM, Juan Manuel Macías <maciaschain@posteo.net> wrote:


> Hi,
> 
> M. Pger writes:
> 
> > (/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!
> 
> 
> Are you including citations in your letter? Maybe this is related:
> https://latex.org/forum/viewtopic.php?f=4&t=3359
> 
> Best regards,
> 
> Juan Manuel
> 
> --
> --
> ------------------------------------------------------
> Juan Manuel Macías
> 
> https://juanmanuelmacias.com
> 
> https://lunotipia.juanmanuelmacias.com
> 
> https://gnutas.juanmanuelmacias.com


^ 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-13 19:59   ` M. Pger
@ 2022-09-13 20:15     ` Juan Manuel Macías
  0 siblings, 0 replies; 6+ messages in thread
From: Juan Manuel Macías @ 2022-09-13 20:15 UTC (permalink / raw)
  To: M. Pger; +Cc: orgmode

M. Pger writes:

> Thank you for your answer.
>
>> Are you including citations in your letter? 
>
> No, that's also why it is puzzling. You should be able to reproduce
> the issue by creating a really minimalist init file including the
> following:
>
> ```
> (with-eval-after-load 'ox-latex
>   (add-to-list 'org-latex-classes '("letter" "\\documentclass{letter}"))
>   )
>
> (setq org-latex-pdf-process (list "latexmk -shell-escape -f -pdf %f"))
> ```
>
> As mentioned in my previous mail, the error also appears when using `pdflatex` instead of `latexmk`.

Hmm, it's weird. With your configuration I cannot reproduce the problem.
Anyway, I have Org configured so that it doesn't load any package in the
preamble.

And if you directly compile the .tex file generated by org during
export, does it also give you an error? Could you please paste the
preamble of that tex file here, up to the \begin{document}?

Best regards,

Juan Manuel 


^ 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-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-14  2:53 ` Ihor Radchenko
  1 sibling, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2022-09-14  2:53 UTC (permalink / raw)
  To: M. Pger; +Cc: emacs-orgmode

"M. Pger" <mpger@protonmail.com> writes:

> 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.
>
> Any thoughts?

I cannot reproduce on my side.
I suggest you to follow https://orgmode.org/manual/Feedback.html
The issue is likely related to your personal configuration tweaks.

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


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