I am trying to use org-mode for generating my documents in pdf format using MiKTeX in Windows environment. When use the class \documentclass{scrartcl} in TexMaker, it is working properly. But in org-mode it is not working. I want have a \subtitle{} and author affiliation in my document. But I am getting only Title, Author and Date in my document. My LaTeX header in org-mode looks like this:

#+TITLE: A demo paper in LaTeX
#+SUBTITLE: cse131:: Course Title
#+AUTHOR: R. Sreekumar

And in my .emacs configuration file, I have added koma-article class. It looks like this.

(require 'ox-latex)

(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}")))

I don't know where I am doing the mistake. If any expert in org-mode and LaTeX can help, I will be grateful.

Also, I am not sure, where MiKTeX is storing external style files which are automatically downloaded in TexMaker.


Welcome to tex.stackexchange!

I added #+LATEX_CLASS: koma-article below the line #+AUTHOR, see this example:

#+TITLE: Titel
#+SUBTITLE: untertitel
#+AUTHOR: wer auch immer
#+LATEX_CLASS: koma-article

That helped, in a way, because the subtitle gets exported as:

\large untertitel}

But I failed to find out how to get something like \subtitle:{untertitel}


Ha, I got it! We need two variables.

The orgmode file

# -*- org-latex-subtitle-separate: t; org-latex-subtitle-format: "\\subtitle{ %s }"; -*-

#+TITLE: Titel
#+SUBTITLE: cse131:: untertitel
#+AUTHOR: wer auch immer
#+LATEX_CLASS: koma-article

* Erster Abschnitt

* Zweiter Abschnitt

noch mehr text
** Unterabschnitt

was auch immer

will be exported as

% Created 2019-07-20 Sa 09:02
% Intended LaTeX compiler: pdflatex
\usepackage{babel, booktabs, libertine, setspace, array}

\author{wer auch immer}
\subtitle{ cse131:: untertitel }
 pdfauthor={wer auch immer},
 pdfcreator={Emacs 26.2 (Org mode 9.2.4)}, 


\section{Erster Abschnitt}

\section{Zweiter Abschnitt}

noch mehr text

was auch immer

Ok, my definitions from .emacs are:

(add-to-list 'org-latex-classes 
            \\usepackage{babel, booktabs, libertine, setspace, array}\n
             ("\\section{%s}" . "\\section*{%s}")
             ("\\subsection{%s}" . "\\subsection*{%s}")
             ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
             ("\\paragraph{%s}" . "\\paragraph*{%s}")
             ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))

-- just for completness.

  • Sorry, this is not working for me. \documentclass{scrartcl} is working in texmaker but emacs tells it couldn't locate the class. I added the following in my .emacs file, (setq org-latex-subtitle-separate t) (setq org-latex-subtitile-format "\\subtitle{%s}"), still it is not showing the subtitle. – Sreekumar R Jul 26 '19 at 5:22
  • Can you provide emacs message? Check spelling, please: the variable is org-latex-subtitle-format, not »...subtitile«. – Keks Dose Jul 26 '19 at 10:44
  • I did correct the spelling mistake. And the emacs message isperfect without any errors. It created pdf file but without subtitle. – Sreekumar R Jul 29 '19 at 9:47

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.