2
votes

In the latex-mode, we can make a tex file to fill it with all settings we want, e.g.call it as usual.tex, and put its location at the head of all tex files we would like to debug, as follow:

\input{path_of_usual.tex/usual}

we can type codes simply between

\begin{document}

and

\end{document}

with the all settings filled in usual.tex.

And here my purpose is to do the similar thing in org-mode -xelatex, what commands I need to add into .emacs ?

It seem to add such commands in .emacs

(add-to-list 'org-export-latex-classes
         '("my-article"
           "\\documentclass......
             \\usepackage{.....

can define the latex format via the code in org-file : #+LATEX_CLASSES my-article.

but I replaced all \\.... of \\input{location_of_usual.tex/usual}, the org-file can't produce PDF-file, giving the message:

No definition of class 'usual' in 'org-export-classes'

What is the correct set-up?

I made a lot tries to deal with, but failed, such as:

#+LaTeX:\input{location}

emacs still shows the error message, saying:

no definition of class 'usual' in 'org-export-classes'

1

1 Answers

3
votes

can define the latex format via the code in org-file : #+LATEX_CLASSES my-article.

This is a typo, the file header directive is #+LATEX_CLASS:. Changing that should let you export to pdf.

but I replaced all \\.... of \\input{location_of_usual.tex/usual}, the org-file can't produce PDF-file, giving the message: No definition of class 'usual' in 'org-export-classes'

I think you are mixing up things, earlier you said you added your own export class called my-article, but the above error message suggests you used "usual".

What is the correct set-up? I made a lot tries to deal with, but failed, such as: #+LaTeX:\input{location}

Here if you wish the \input{..} line to appear outside the \begin{document}...\end{document} you should use the #+LATEX_HEADER: directive instead.

PS: I think these are more appropriate for the org-mode mailing list.