3

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
          '("koma-article"
             "\\documentclass{scrartcl}"
             ("\\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.

3

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:

\title{Titel\\\medskip
\large untertitel}

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


EDIT

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

Text
* Zweiter Abschnitt

noch mehr text
** Unterabschnitt

was auch immer

will be exported as

% Created 2019-07-20 Sa 09:02
% Intended LaTeX compiler: pdflatex
\documentclass[ngerman]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{babel, booktabs, libertine, setspace, array}

\usepackage{hyperref}
\author{wer auch immer}
\date{\today}
\title{Titel}
\subtitle{ cse131:: untertitel }
\hypersetup{
 pdfauthor={wer auch immer},
 pdftitle={Titel},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.2 (Org mode 9.2.4)}, 
 pdflang={Germanb}}
\begin{document}

\maketitle
\tableofcontents


\section{Erster Abschnitt}
\label{sec:orgb9ac65c}

Text
\section{Zweiter Abschnitt}
\label{sec:org880cd2d}

noch mehr text
\subsection{Unterabschnitt}
\label{sec:org29209c7}

was auch immer
\end{document}

Ok, my definitions from .emacs are:

(add-to-list 'org-latex-classes 
        '("koma-article"
        "\\documentclass[ngerman]{scrartcl}
        [NO-DEFAULT-PACKAGES]
        [PACKAGES]
            \\usepackage[T1]{fontenc}\n
            \\usepackage{babel, booktabs, libertine, setspace, array}\n
            \\usepackage{hyperref}\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.