R bookdown - custom title page

前端 未结 2 752
小鲜肉
小鲜肉 2020-12-19 08:37

How to customize title page using bookdown?

I tried using the following code in the YAML header.

includes:
  in_header: preamble.tex
  before_body: b         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 08:49

    In the LaTeX template /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.

提交回复
热议问题