嗨,我正在尝试在 R bookdown 中渲染一本书,并且已经安装了所有先决条件。标准的pdf渲染是a4。我正在尝试将其渲染为a6,它更接近出版书籍的格式,而不是a4大小的手册。
下面是我的index.rmd
---
title: "A Minimal Book Example"
author: "Lyndon Sundmark"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
papersize: a6paper
bibliography: [book.bib, packages.bib]
# url: your book url like https://bookdown.org/yihui/bookdown
# cover-image: path to the social sharing image like images/cover.jpg
description: |
This is a minimal example of using the bookdown package to write a book.
The HTML output format for this example is bookdown::gitbook,
set in the _output.yml file.
link-citations: yes
github-repo: rstudio/bookdown-demo
---
并且
下面是我的输出.yml
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/USERNAME/REPO/edit/BRANCH/%s
download: ["pdf", "epub"]
bookdown::pdf_book:
includes:
in_header: header.tex
number_sections: yes
toc: yes
toc_depth: 3
papersize: a6
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
bookdown::epub_book: default
当我渲染 pdf 时,它仍然创建 8.5 x 11 英寸。
如何强制它将内容重新布局为 a6 尺寸?
感谢您提前提供的任何帮助...
到目前为止,大多数谷歌搜索仍然指向纸张尺寸作为关键 - 但它们似乎不起作用
最佳答案
在 index.Rmd
的 YAML 中设置 papersize
应该没问题。我认为 a6paper
不是一个有效的选项,因为 bookdown 粘合了传递给 papersize
和 paper
的值,然后将结果设置为文档类编译为 PDF 的 tex
文档的标题。
因此 papersize: a6paper
产量
\documentclass[
a6paperpaper,
]{book}
使用 papersize: a6
应该可以。
关于r - 如何在 R Bookdown 中渲染实际的 a6 纸张尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73547198/