I try to export a org file into pdf file with moderncv as document class.

I am on OSX, installed last version of MacTeX (2017 distribution, the full one) and I have currently no problem to export a very-basic org file (no headers or options).

I did zero configuration on org-mode and when I try to export this file :

  #+LaTeX_CLASS: moderncv

  * My life
    Lorem ipsum dolor sit...

My Emacs mini-buffer says : Unkown LaTeX class 'moderncv'

The package moderncv is installed on my computer as the Tex Live Utility reports and I succeeded to compile the template.tex example from moderncv doc with pdflatex.

What can I miss ? Do I have to set env variables or org-mode variables ?

  • Welcome to TeX.SX!
    – Bobyandbob
    Commented Aug 16, 2017 at 7:24
  • Thanks ! I am really newbie to Latex (but I know better org-mode, that's why I like to remains in the org context). Hope someone can help me ! Best regards
    – yoLotus
    Commented Aug 16, 2017 at 7:27

1 Answer 1


The classes accepted by org-mode LaTeX export are defined in the customize variable org-latex-classes. You can either use customize-variable or add an entry in your .emacs file like the following (see also this answer)

(with-eval-after-load 'ox-latex
   (add-to-list 'org-latex-classes
              ("\\section{%s}" . "\\section*{%s}")
              ("\\subsection{%s}" . "\\subsection*{%s}"))))

EDIT: For the template to work, you should also add some options to your org-file, i.e. switching off the generation of a table of contents (which moderncv does not know) and inserting your first and last name:

#+LaTeX_CLASS: moderncv
#+OPTIONS: toc:nil
#+LaTeX_HEADER: \firstname{Max}\lastname{Mustermann}

Also, you may need to switch of the hyperref package by setting it to nil in org-latex-default-packages-alist.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .