首页 > 解决方案 > 书本图标题宽度?

问题描述

我刚刚开始在 Bookdown 上写我的博士论文,到目前为止一切都很好。我确实遇到的一个问题是,当输出为 PDF 格式时,图形标题似乎只占页面宽度的 60% 左右,并且居中。这对于简短的标题来说非常有用,但对于复杂的面板,我的大多数图形标题都在 50 个字左右。是否有一些 LaTeX 魔法使它们成为页面的宽度?

谢谢汤姆

这是我在 .md 文件中使用的内容:

| Reagent                  | Amount   |
| ------------------------ | -------- |
| Appropriate Buffer (10x) | 1x       |
| DNA                      | 50-500ng |
| Restriction Enzyme       | 1*U*     |
| Water                    | -        |

Table: (\#tab:restriction-generic) Schematic for restriction digestion with a single restriction enzyme.

标签: rbookdown

解决方案


您可以使用 LaTeX 包caption

---
output: 
  bookdown::pdf_document2
header-includes:
- \usepackage[width=\textwidth]{caption}
---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

| Reagent                  | Amount   |
| ------------------------ | -------- |
| Appropriate Buffer (10x) | 1x       |
| DNA                      | 50-500ng |
| Restriction Enzyme       | 1*U*     |
| Water                    | -        |

Table: (\#tab:restriction-generic) Schematic for restriction digestion with a single restriction enzyme. Some really long text that shows how the caption is formatted when it takes multiple lines.

输出:

在此处输入图像描述


推荐阅读