How to remove compact title from R markdown to latex conversion?

Viewed 3290

I wrote my own titlepage and it is loaded via an include in the R-markdown file. However, this conflicts with the pandoc title. I am trying to find settings in the R markdown yaml header such that pandoc does not insert the following code snipped into the tex-file.

% Create subtitle command for use in maketitle
\newcommand{\subtitle}[1]{
  \posttitle{
    \begin{center}\large#1\end{center}
    }
}

\setlength{\droptitle}{-2em}
  \title{}
  \pretitle{\vspace{\droptitle}}
  \posttitle{}
  \author{}
  \preauthor{}\postauthor{}
  \date{}
  \predate{}\postdate{}

There is no clear indication in the pandoc documents or the r markdown guidelines how to disable the title generation. Any help would be appreciated.

Update: In particular, I am looking for solutions that allow me to keep creating my title page with the \maketitle command. That is why I focussed on this particular code snipped that I want to get rid of.

3 Answers

Using compact-title: false in the YAML works.

---
title: "This title is not compact"
author: "Test"
date: "2019 May 10"
output: pdf_document
compact-title: false
---

enter image description here

I had the same problem today. Here's what I did. (Maybe I'll update the solution when I come up with something better.)

The solution is dumb but useful. I can't set an arbitrary space between the lines now, because I used \newline.

---
title: "\\huge My Smart Title"
author: "\\newline \\Large My Smart Author"
date: "\\newline \\Large 2018-12-25"
output:
  pdf_document:
    includes:
      in_header: preamble.tex
    latex_engine: xelatex
---

Below are the outputs before and after the solution.

BEFORE:

AFTER:

Note: You may be confused about the different sizes of the "author" and the "date" in the two pictures above, if you don't know that the fontsize of the "author" and the "date" is \large instead of \Large by default.

END

Related