Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R bookdown - custom title page

How to customize title page using bookdown?

I tried using the following code in the YAML header.

includes:
  in_header: preamble.tex
  before_body: body.tex

The body.tex file was something pretty simple, just for test:

\begin{titlepage}
Hello world
\end{titlepage}
like image 869
user1591727 Avatar asked Jan 24 '18 23:01

user1591727


People also ask

How do you make a RMD header?

We can insert headings and subheadings in R Markdown using the pound sign # . There are six heading/subheading sizes in R Markdown. The number of pound signs before your line of text determines the heading size, 1 being the largest heading and 6 being the smallest.

How do you set a title in R markdown?

Just use ! r followed by the object name defined (test_title in the case below) to make the title dynamic.

How can I add a logo to a title page in latex?

Usually you choose between using only \maketitle at the beginning of the document, that print \author , \title and \date at the top of the article (defined before, preferably in the preamble) with a default format, or a titlepage environment to have a title page, where you simply insert what you want with the format ...

How do I write HTML in R markdown?

To transform your markdown file into an HTML, PDF, or Word document, click the “Knit” icon that appears above your file in the scripts editor. A drop down menu will let you select the type of output that you want. When you click the button, rmarkdown will duplicate your text in the new file format.


1 Answers

In the LaTeX template <R-Library>/rmarkdown/rmd/latex/default-1.17.0.2.tex we see

\begin{document}
$if(title)$
\maketitle
$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$

$for(include-before)$
$include-before$

This means that a titlepage is created using \maketitle if a title is defined in the YAML headers. Similar for the abstract. If you remove both these tags from your YAML headers, then the content from the file body.tex will be the first to be processed and you are free to customize your titlepage there.

See the answers to this question for an alternative approach.

like image 97
Ralf Stubner Avatar answered Oct 07 '22 18:10

Ralf Stubner