Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
960 views
in Technique[技术] by (71.8m points)

latex - 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:

egin{titlepage}
Hello world
end{titlepage}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

egin{document}
$if(title)$
maketitle
$endif$
$if(abstract)$
egin{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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...