2

I an trying to define a custom latex class, I will use it to export my org files to PDF. I found information about this on internet and I tried to implement the proposed solution, I wrote this in my .emacs:

(with-eval-after-load 'org-latex 
(add-to-list 'org-export-latex-classes
   '("org-article"
      "\\documentclass{org-article}
      [NO-DEFAULT-PACKAGES]
      [PACKAGES]
      [EXTRA]"
      ("\\section{%s}" . "\\section*{%s}")
      ("\\subsection{%s}" . "\\subsection*{%s}")
      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
      ("\\paragraph{%s}" . "\\paragraph*{%s}")
      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))

So the custom class name is org-article, but when try to export a simple org file using this custom class :

#+LaTeX-CLASS: org-article

Emacs says Unknown LaTex class : 'org-article'.

It seems to me that I did everything right according to the org manual and other users in several forums. So I ask you to help me find what is wrong.

  • 1
    Which version of Org are you using? – Arash Esbati Dec 26 '17 at 11:29
1

The first item of the list, "org-article", defines the name of the new class. The second item defines the document class that you are using as the basis of the your new one. So instead of writing \\documentclass{org-article}, do \\documentclass{article} or \\documentclass[11pt,a4paper]{article}, if you want to change paper and font size settings from article default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.