R bookdown - 自定义标题页 [英] R bookdown - custom title page

查看:13
本文介绍了R bookdown - 自定义标题页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 bookdown 自定义标题页?

How to customize title page using bookdown?

我尝试在 YAML 标头中使用以下代码.

I tried using the following code in the YAML header.

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

body.tex 文件非常简单,仅用于测试:

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

egin{titlepage}
Hello world
end{titlepage}

推荐答案

我最终编辑了 _output.yml 文件以引用 default-1.17.0.2.tex 的副本 模板.

I ended up editing the _output.yml file to reference a copy of default-1.17.0.2.tex template in my R project directory using yaml template tag.

bookdown::gitbook:
  css: style.css
  config:
    toc:
      before: |
        <li><a href="./">A Minimal Book Example</a></li>
      after: |
        <li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
    edit: https://github.com/rstudio/bookdown-demo/edit/master/%s
    download: ["pdf", "epub"]
bookdown::pdf_book:
    fig_caption: true
    number_sections: yes
    includes:
        in_header: preamble.tex
    latex_engine: xelatex
    citation_package: natbib
    keep_tex: yes
    template: template.tex
bookdown::epub_book: default

由于某种原因,我在编译 pdf 时出错(!未定义的控制序列...)所以我在 template.texusepackage{graphicx}> 修复它.现在假设我可以自由地自定义标题页等等.

For some reason i had an error compiling the pdf (! Undefined control sequence...) so I included a latex command usepackage{graphicx} in template.tex to fix it. Now it is supposed that I am free to customize title page and whatsoever.

这篇关于R bookdown - 自定义标题页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆