1

I stumbled upon this archived email: https://lists.gnu.org/archive/html/emacs-orgmode/2011-02/msg01281.html and a suggestion is to create a custom title page that picks up the title, author, and date from the org file. There is a code block in the post that contains the syntax:

 address@hidden
   \newpage
   \null
   \begin{center}%
   \let \footnote \thanks
     {\usebox{\FIRM}}%
     \vskip 3em%
     {\LARGE address@hidden \par}%
     \vskip 1.5em%
     {\large
       \lineskip .5em%
       \begin{tabular}[t]{c}%
        address@hidden
       \end{tabular}\par}%
     \vskip 1em%
     {\large address@hidden
   \end{center}%
   \par
   \vskip 1.5em}

, but the post does not specify a way to add this to the org-latex-classes, on top of that, the post is really old and not up to date with the org-version I use (9.1.9). There are several posts in here that ask how to add custom classes to latex but I'm trying to do both add a custom title page that reads from the org metadata latex headers. Given that I have this written in my init.el:

;; Org Mode Custom Classes for Latex

(with-eval-after-load 'ox-latex
  (add-to-list 'org-latex-classes
               '("article"
                 "\\documentclass{article}"
                  " address@hidden
                     \newpage
                     \null
                     \begin{center}%
                     \let \footnote \thanks
                       {\usebox{\FIRM}}%
                        \vskip 3em%
                        {\LARGE address@hidden \par}%
                        \vskip 1.5em%
                        {\large
                         \lineskip .5em%
                           \begin{tabular}[t]{c}%
                             address@hidden
                              \end{tabular}\par}%
                            \vskip 1em%
                          {\large address@hidden
                           \end{center}%
                            \par
                             \vskip 1.5em}"
                 ("\\chapter{%s}" . "\\chapter*{%s}")
                 ("\\section{%s}" . "\\section*{%s}")
                 ("\\subsection{%s}" . "\\subsection*{%s}")
                 ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))

and that I am new to org-mode. How can I accomplish this by editing an existing org file that contains this:

#+TITLE: testing out org mode export latex
#+AUTHOR: me
#+EMAIL: me@meme.com
#+LANGUAGE: es
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [12pt,titlepage]
#+LATEX_HEADER: \usepackage{baskervald}
#+LATEX_HEADER: \usepackage[T1]{fontenc}
#+LATEX_HEADER: \usepackage{setspace}
#+LATEX_HEADER: \usepackage[AUTO]{babel}
#+LATEX_HEADER: \usepackage[hyperref,x11names]{xcolor}
#+LATEX_HEADER: \usepackage[colorlinks=true,linkcolor=SteelBlue4,urlcolor=Firebrick4]{hyperref}
#+EXPORT_FILE_NAME: export_with_custom_title
#+OPTIONS: f:t toc:nil |:t
#+STARTUP: showall

#+BEGIN_ABSTRACT
lorem ipsum lorem ipsum ....
#+END_ABSTRACT
#+BEGIN_LATEX latex
\thispagestyle{empty}
\newpage
\doublespacing
#+END_LATEX
#+TOC: headlines 2
#+BEGIN_LATEX latex
\singlespacing
\thispagestyle{empty}
\newpage
\setcounter{page}{1}
#+END_LATEX

* First heading
** second 
*** and so on
paragraphs

So, how do I add a custom page title that modifies my title but retains the structure I have in my current org file? So, I am thinking that what I am trying to do is modify the custom article class so that it modifies only the title section by using #+TITLE:..., #+EMAIL:.. and #+AUTHOR:.. but keeps the rest of the edits.

4
  • This is probably off-topic for this site: it is more a question of latex than org mode. OTOH, it's not off topic for the org mode mailing list and I know that Tom Dye (who provided the snippet) is active on that list. I would suggest you ask your question there. See orgmode.org/community.html for information about the ML.
    – NickD
    Jan 23, 2019 at 0:11
  • I agree. This is very specific to Org Mode. However, I have narrowed down to editing custom-variables org-latex-hyperref-template and org-latex-title-command. i'll open another question just about org-latex-title-command
    – user20304
    Jan 23, 2019 at 0:27
  • The answer involves writing a latex class (or at least modifying an existing latex class) file that contains the snippet for the cover page, then modifying org-latex-classes to add your new class to it. The latter is easy, the former not so much and it has nothing to do with emacs. That's why I said it's more a latex question. I still maintain that it's off-topic for this site and that you should ask the question on the org-mode mailing list, not because it is org-mode specific, but because it is somewhat related to org-mode. It would not be off-topic there but it is off-topic here.
    – NickD
    Jan 23, 2019 at 2:29
  • Yeah. I meant Latex, not Org Mode. No big deal.
    – user20304
    Jan 23, 2019 at 17:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.