楼主: oliyiyi
1259 1

Rmarkdown output to Tufte Handouts [推广有奖]

版主

已卖:2994份资源

泰斗

1%

还不是VIP/贵宾

-

TA的文库  其他...

计量文库

威望
7
论坛币
84105 个
通用积分
31671.0967
学术水平
1454 点
热心指数
1573 点
信用等级
1364 点
经验
384134 点
帖子
9629
精华
66
在线时间
5508 小时
注册时间
2007-5-21
最后登录
2025-7-8

初级学术勋章 初级热心勋章 初级信用勋章 中级信用勋章 中级学术勋章 中级热心勋章 高级热心勋章 高级学术勋章 高级信用勋章 特级热心勋章 特级学术勋章 特级信用勋章

楼主
oliyiyi 发表于 2016-6-18 14:58:02 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Tufte Handouts are documents formatted in the style that Edward Tufte uses in his books and handouts. Tufte’s style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography:




Tufte Handouts can create either HTML or PDF output. You can see a full examples documents produced with the Tufte Handout template here:

These documents serve not only as examples but also documention of the various techniques used for formatting footnotes, sidenotes, figures, tables, etc.



Getting Started
Installation

Note that the tufte_handout format is not contained within the rmarkdown package but rather in a separate tuftepackage. You can use this format in R Markdown documents by installing this package as follows:

install.packages("tufte", type = "source")

Creating a Handout

You can create a new Tufte Handout from within the RStudio New R Markdown dialog:


If you are not using RStudio then you can use the rmarkdown::draft function as follows:

library(rmarkdown)draft("my_handout.Rmd", template = "tufte_html", package = "tufte")

The newly created document will include the various HTML and LaTeX based tufte handout formats as shown here:

---title: "Tufte Handout"subtitle: "An implementation in R Markdown"author: "JJ Allaire and Yihui Xie"date: "2016-05-28"output:  tufte::tufte_html: default  tufte::tufte_handout:    citation_package: natbib    latex_engine: xelatex  tufte::tufte_book:    citation_package: natbib    latex_engine: xelatexbibliography: skeleton.biblink-citations: yes---


Figure Options

There are a number of options that affect the output of figures within PD documents:

  • fig_width and fig_height can be used to control the default figure width and height (6 x 4.5 is used by default)

  • fig_crop controls whether the the pdfcrop utility (if available) is automatically applied to pdf figures (this is true by default).


For example:

---title: "Tufte Handout"output:  tufte::tufte_handout:    fig_width: 4    fig_height: 4---


Syntax Highlighting

The highlight option specifies the syntax highlighting style. Supported styles include “default”, “tango”, “pygments”, “kate”, “monochrome”, “espresso”, “zenburn”, and “haddock” (specify null to prevent syntax highlighting):

For example:

---title: "Tufte Handout"output:  tufte::tufte_handout:    highlight: tango---


Advanced Customization
Intermediate TeX

R Markdown documents are converted to PDF by first converting to a TeX file and then calling the LaTeX engine to convert to PDF. By default this TeX file is removed, however if you want to keep it (e.g. for an article submission) you can specify the keep_tex option. For example:

---title: "Tufte Handout"output:  tufte::tufte_handout:    keep_tex: true---

Includes

You can do more advanced customization of PDF output by including additional LaTeX directives and/or content or by replacing the core pandoc template entirely. To include content in the document header or before/after the document body you use the includes option as follows:

---title: "Tufte Handout"output:  tufte::tufte_handout:    includes:      in_header: header.tex      before_body: doc_prefix.tex      after_body: doc_suffix.tex---

Pandoc Arguments

If there are pandoc features you want to use that lack equivilants in the YAML options described above you can still use them by passing custom pandoc_args. For example:

---title: "Tufte Handout"output:  tufte::tufte_handout:    pandoc_args: [      "--no-tex-ligatures"    ]---

Documentation on all available pandoc arguments can be found in the pandoc user guide.




Shared Options

If you want to specify a set of default options to be shared by multiple documents within a directory you can include a file named _output.yaml within the directory. Note that no YAML delimeters or enclosing output object are used in this file. For example:

_output.yaml

tufte::tufte_handout:  toc: true

All documents located in the same directory as _output.yaml will inherit it’s options. Options defined explicitly within documents will override those specified in the shared options file.



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:handouts handout output outpu Mark techniques documents extensive examples produced

缺少币币的网友请访问有奖回帖集合
https://bbs.pinggu.org/thread-3990750-1-1.html

沙发
hjtoh 发表于 2016-6-18 15:42:31 来自手机
oliyiyi 发表于 2016-6-18 14:58
Tufte Handouts are documents formatted in the style that Edward Tufte uses in his books and handouts ...
谢谢分享

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 07:46