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}
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.
Just use ! r followed by the object name defined (test_title in the case below) to make the title dynamic.
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 ...
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With