I am writing Japanese Org mode note and need to convert it into Latex.

I defined the japanese latex class in my config file as follow:

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

Then, I press C-c C-e l o (export to Latex as PDF file and open). However, I got error as below.

Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
Rule 'pdflatex': Rules & subrules not known to be previously run:
Rule 'pdflatex': The following rules & subrules became out-of-date:
Run number 1 of rule 'pdflatex'
Running 'pdflatex -interaction nonstopmode  -recorder  "week3.tex"'
Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-04-01> patch level 3
Babel <3.20> and hyphenation patterns for 84 language(s) loaded.

! LaTeX Error: This file needs format `pLaTeX2e'
              but this is `LaTeX2e'.

So, the Org-mode is using the latexmk, but the latexmk is using the pdflatex. As far as I know, the latexmk should automatically use the platex. After the failed org-to-latex process, I ran latekmk name-of-file.tex normally from the terminal with success. What is the problem here? How should I fix it?

I am using emacs 26.1 (spacemacs) and org mode 9.1.14.

Your Answer

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

Browse other questions tagged or ask your own question.