如何避免 R markdown v2 中标题的空格 [英] How to avoid blank space for title in R markdown v2

查看:47
本文介绍了如何避免 R markdown v2 中标题的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不希望在我的 pdf 输出中有空格,这肯定代表在编织 pdf 时 R markdown 中没有标题方法.

I would not like to have blank space in my pdf output, that surely stands for no title method in R markdown while knitting pdf.

我不想从页面开始就没有标题和文本.谁能告诉我怎么做?

I would like not to have title and have text starting from the begging of the page. Can anyone can tell me how to do that?

到目前为止,我的代码如下所示:

My code, so far, looks like this:

---
output: 
   pdf_document:
      highlight: pygments
      toc: false
      number_sections: true
---
text

感谢您的建议!

推荐答案

对于这种级别的自定义,您需要更改 Pandoc 使用的 TeX 模板:

For this level of customization you'll want to change the TeX template Pandoc uses:

  1. 复制rmarkdown使用的默认TeX模板(可以通过运行system.file("rmd/latex/default.tex", package="rmarkdown")找到路径)
  2. 编辑文件以删除标题、调整边距等并另存为例如notitle.tex
  3. template: notitle.tex 添加到 pdf_document 的设置中.
  1. Copy the default TeX template used by rmarkdown (you can find the path by running system.file("rmd/latex/default.tex", package="rmarkdown"))
  2. Edit the file to remove the title, adjust margins, etc. and save as e.g. notitle.tex
  3. Add template: notitle.tex to the settings to pdf_document.

这篇关于如何避免 R markdown v2 中标题的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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