r - 书本图标题宽度?
问题描述
我刚刚开始在 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.
解决方案
您可以使用 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.
输出:
推荐阅读
- django - Django查询删除按id分组的旧值?
- mongodb - Mongoose:更新动态生成的集合
- machine-learning - 如何使用 BertForQuestionAnswering 从上下文中获取多个答案
- c - 如何在 C 程序中用两个反斜杠替换一个反斜杠?
- macos - FFMpeg 监控 rtmp 提要
- python - For-loop-nested-in-for-loop 通过 csv.reader() 但外循环只经过一次?
- haskell - 使用列表解决方案进行优化:编译器错误
- rest - Loopback 4 扩展 REST 模型端点
- javascript - Cookies.set 没有在 cookie (js-cookie) 中设置值
- python-3.x - 有没有办法获得numpy数组中非零元素的总和?我不断收到 TypeError