2017-06-15 46 views
1

设定余量当使用避免经由几何

render_book("index.Rmd", "bookdown::pdf_book") 

它看起来像一条线设置的边缘被插入在特文件

\usepackage[margin=1in]{geometry} 

bookdown-demo REPRO可以用来重现此。

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 
--- 

,这是偷懒了由样式文件设置页边距。我知道我可以modify the geometry options,但我可以避免生成这条线吗?

感谢

> 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] tools_3.3.3  rstudioapi_0.6 yaml_2.1.14  Rcpp_0.12.11 
[9] stringi_1.1.5 rmarkdown_1.5 knitr_1.16  stringr_1.2.0 
[13] digest_0.6.12 evaluate_0.10 
+0

什么是您的YAML看起来像你的索引文件的顶部? – Phil

+1

我已经加上 – topepo

回答

2

documentclass: krantz表明,你正在写一本书查普曼&大厅,我已经对谁使用这些作者提供a starter repo bookdown-crcbookdown(该bookdown-demo回购是不是你最好的选择) 。您的问题不存在于此回购中,因为I set template: null for pdf_book in _output.yml。原因是我想使用Pandoc的默认模板,它不会将默认的margin=1in添加到YAML中的geometry选项(并且rmarkdown确实 - 这是罪魁祸首)。

如果你想使用rmarkdown的LaTeX的模板(这是基于Pandoc的修改),你可以在你index.Rmd的YAML元数据集

geometry: false 

供您参考,我在bookdown本书为查普曼&霍尔作者专门章节:https://bookdown.org/yihui/bookdown/publishers.html

+0

谢谢;我将模拟我在这个新的回购 - 最大的设置 – topepo