préambule org-latex-export-to-pdf apparaissant dans le corps principal

Aug 19 2020

Il semble y avoir un problème avec la façon dont le mode org (ou ma configuration, peut-être?) Gère les documents latex. Voici l'exemple de fichier que j'essaie d'exporter:

\documentclass[12pt, letterpaper, twoside]{article}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{abstract}
This is a simple paragraph at the beginning of the document. A brief introduction to the main subject.
\end{abstract}

In this document some extra packages and parameters
were added. There is an encoding package,
and pagesize and fontsize parameters.

This line will start a second paragraph. And I can
 break\\ the lines \\ and continue on a new line.

\end{document}

Comme vous pouvez le voir, tous les éléments du préambule se produisent avant \ begin {document}, et pourtant, lorsque j'exporte au format pdf, j'obtiens les erreurs suivantes:

l.31 \documentclass
                   [12pt, letterpaper, twoside]{article}

! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.32 \usepackage
                [utf8]{inputenc}

! LaTeX Error: Can be used only in preamble.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.34 \begin{document}
                     
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (.//test.tex.aux) )
(\end occurred inside a group at level 1)

### semi simple group (level 1) entered at line 34 (\begingroup)
### bottom level
(see the transcript file for additional information) </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1000.600pk> </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecbx1000.600pk> </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1095.600pk> </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecbx1440.600pk> </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1200.600pk> </home/josh/.texlive2017/t
exmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1728.600pk>
Output written on .//test.tex.pdf (1 page, 25588 bytes).
Transcript written on .//test.tex.log.

Le document est exporté au format PDF et le préambule apparaît dans la section "Contenu", mais n'affecte pas réellement le document. Quelqu'un d'autre a-t-il vécu quelque chose de similaire lors de l'utilisation de org-latex-export-to-pdf, ou est-ce que quelqu'un connaît une autre façon d'exporter ce document via emacs?

Merci d'avance!

Réponses

HafidBoukhoulda Aug 21 2020 at 05:02

Essaye ça:

#+LATEX_CLASS_OPTIONS: [12pt, letterpaper, twoside]

#+BEGIN_abstract
This is a simple paragraph at the beginning of the document. A brief introduction to the main subject.
#+END_abstract

In this document some extra packages and parameters
were added. There is an encoding package,
and pagesize and fontsize parameters.

This line will start a second paragraph. And I can
 break @@latex:\\@@ the lines @@latex:\\@@ and continue on a new line.