是否有可能在我的 Rmd 文件中包含图表列表?现在我的 yaml 标头看起来像这样,但我不知道如何包含数字列表。似乎\figureslift不起作用。
---
title: ""
author: ""
output:
bookdown::html_document2:
#css: styles.css
fig_caption: yes
theme: flatly
toc: yes
toc_depth: 1
bibliography: lib.bib
link-citations: yes
figurelist: yes
---
Run Code Online (Sandbox Code Playgroud)
在正文文件中,我想到了类似的方法来生成一个数字列表。
{r figure1, fig.cap="Sine Plot", fig.align='center'}
x = seq(1,10, by = 0.1)
y = sin(x)
plot(x, y, main = "title")
Run Code Online (Sandbox Code Playgroud)
参见图@ref(fig:figure1)
\数字列表
我正在使用bookdown为客户撰写报告.他们喜欢它,我喜欢它,但我不想在编译的html的右上角有社交媒体链接.除了在构建之后编辑html之外,在构建报告期间是否有任何方法可以阻止它们出现?
谢谢!
使用时
render_book("index.Rmd", "bookdown::pdf_book")
Run Code Online (Sandbox Code Playgroud)
它看起来像一条线,设置边距插入到tex文件中
\usepackage[margin=1in]{geometry}
Run Code Online (Sandbox Code Playgroud)
该bookdown-demo摄制可以用来重现此。
在中index.Rmd,我正在使用
---
date: "`r Sys.Date()`"
knit: "bookdown::render_book"
documentclass: krantz
classoption: numberinsequence,krantz1
bibliography: [book.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
---
Run Code Online (Sandbox Code Playgroud)
这正在破坏该样式文件设置的边距。我知道可以修改几何图形选项,但是可以避免生成这条线吗?
谢谢
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.4
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bookdown_0.4
loaded via a namespace (and not attached):
[1] backports_1.0.5 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6
[5] …Run Code Online (Sandbox Code Playgroud) 我正在使用默认的Bookdown示例“最小书籍示例”,该示例可在GitHub上找到:https : //github.com/rstudio/bookdown-demo
如何编辑模板,以使PDF输出的所有章节之前都没有空白页?
我不会说TeX,因此非常感谢无知的基本线索。
冒着几张反对票的风险,今天下午花了几个小时试图解开我正在研究的bookdown html文档的CSS之后,我不得不问这个问题。为了我的一生,我只是无法弄清楚用来增加书本文档主要文本区域最大宽度的选择器。我正在处理一些内容,这些内容确实可以从使用更多的大型显示器中受益。
我最近一次尝试来获得我需要的特性是一个自定义的CSS文件,该文件包含:
.book .book-body.fixed .body-inner .page-wrapper .page-inner .normal .section .level1 .unnumbered {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
Run Code Online (Sandbox Code Playgroud)
我尝试了多种选择器组合,但我无法从800px的默认值中获得最大宽度。
出于测试目的,这是示例书本文档。
我正在使用 R markdown 和 bookdown 创建 pdf 输出。据我从这个问题和这个github 问题中可以看出,我使用了正确的语法,但它对我不起作用,我只是在标题中将“[@citation]”作为文本返回。是否有特定的 yaml、块选项或包我需要让它工作?
---
title: "caption citation test"
output:
bookdown::pdf_document2
bibliography: Bibliography_mini.bib
---
```{r echo=FALSE,warning=FALSE}
library(knitr)
library(kableExtra)
opts_chunk$set(fig.path='figure/graphics-',
cache.path='cache/graphics-',
fig.align='center',
external=TRUE,
echo=TRUE,
warning=FALSE,
fig.pos='H'
)
a4width<- 8.3
a4height<- 11.7
```
Some text here look the citation works [@moravec1980obstacle]
```{r moravec, echo=FALSE, fig.cap="look the citation doesn't work
[@moravec1980obstacle]"}
knitr::include_graphics("Moravec.png")
```
Run Code Online (Sandbox Code Playgroud)

I'd like for a chapter to appear before the table of contents (but after the title page) in the pdf_book output of Bookdown.
一种方法是将章节添加到.tex文件中并使用before_body:. 但是,这意味着该章节将不会出现gitbook(我也需要)。我不想同时保留同一章的a.tex和.Rmdversion。
理想的解决方案是将章节保存在.Rmd文件中,并将其内容提取到before_bodyfor 中pdf_book。这样它仍然可以用于gitbook. 虽然我不确定我该怎么做,或者确实可能吗?
有解决办法吗?还是超出了Bookdown的灵活性极限?
任何帮助将不胜感激,谢谢!
在 Bookdown 中,如果您index.Rmd像这样提供书名和作者:
---
title: "My New Book"
author: "John Doe"
(...)
---
Run Code Online (Sandbox Code Playgroud)
它使用此信息在 PDF 输出中生成一个漂亮(且常见)的第一页,标题居中,作者姓名在其下方。
但是在 HTML 输出中,标题和作者姓名只是放在索引页的顶部。
正如我在www.bookdown.org上看到的那样,大多数书籍的 HTML 版本都以该文本开头,然后在此之后立即显示书籍的封面图像。(就像上面的书或这本书。)我想如果封面图片在这里的顶部,它看起来会好得多。
可以为 HTML 输出禁用标题/作者部分吗?
我还没有找到删除它的例子,所以我不确定这是否可能。我试过从 中删除它index.Rmd,但后来它也从 PDF 中删除了,这是我不想要的。
(我使用 Bootstrap 风格。)
我在 RStudio 中使用 knitr 来编写一个 rmarkdown bookdown:pdf:document2 文档。我有两个图,与 gridExtra 并排绘制,并标记为 A 和 B。我想在图标题的输出中放置一个换行符,如 fig.cap 所定义,在 A 的标题和 B 的标题之间,但我很难过。我试过了:
\n - 被忽略,就好像它不存在一样
\\n - 未定义的控制序列
\\\n - @tempf 的参数有一个额外的}。
\\\\n - 打印“\n”(这里有点傻)
双倍空间 - 什么都不做
出于绝望,我什至尝试了 HTML 样式的换行符,我不知道如何在此处显示,但我没想到它们会起作用,但它们没有。
在 LaTeX 中是可能的,所以肯定有办法......
注意:这不是knitr 中跨行拆分 r 块头的副本,因为它询问如何在代码中跨行拆分块头中的长标题,我问的是如何在输出中执行此操作。
苏珊娜
---
title: "MRR captions"
author: "Susannah Cowtan"
date: "14 December 2018"
output:
bookdown::pdf_document2:
citation_package: natbib
number_sections: no
toc: no
keep_tex: true
bookdown::html_document2: null
header-includes:
- \usepackage{float}
- …Run Code Online (Sandbox Code Playgroud) 从 bookdown 创建 PDF 时,我希望它是“Módulo X”(西班牙语),而不是第 X 章。
所以我想知道如何使用 bookdown 更改章节名称。
我的 YAML 是:
---
title: "TITLE"
author: "Mario Modesto-Mata"
date: "`r Sys.Date()`"
output: pdf_document
description: This is a minimal example of using the bookdown package to write a book.
The output format for this example is bookdown::gitbook.
documentclass: book
link-citations: yes
bibliography: book.bib
site: bookdown::bookdown_site
language:
label:
chapter_name: "Módulo"
---
Run Code Online (Sandbox Code Playgroud)
我尝试了最后三行代码,但没有成功。任何的想法?