如何解决如何在标题中添加引号书本
我在使用bookdown
的字幕中加引号时遇到问题。以下rmarkdown
文档说明了此问题。
---
title: "testdoc"
author: "Dayne Filer"
date: "10/21/2020"
output:
pdf_document: default
html_document: default
---
In the main document,"quotation marks" are appropriately typeset.
```{r}
knitr::kable(matrix(1:2),caption = "In a caption,\"they are not\".")
```
```{r}
knitr::kable(matrix(1:2),caption = '"I did try some alternatives...".')
```
```{r}
knitr::kable(matrix(1:2),caption = '\`\`this works for latex,but not html.\'\'')
```
上面的代码对于html和Latex都可以正确编译(最后一个表除外,后者对于latex可以正确编译,但是对html而言不是)。但是,将文档的正文复制到bookdown
附带的“最小书籍示例”中不会排版正确的引号。我尝试使用xelatex和pdflatex来编译文档。对于xelatex,它提供以下内容:
pdflatex给出:
解决方法
bookdown
作者Yihui Xie指出,写长标题或带有特殊字符(例如引号)的标题时,作者应使用text references。
在上面的示例中,它看起来像这样:
In the main document,"quotation marks" are appropriately typeset.
And when using text references,(ref:tabCap) "quotation" marks are properly formatted.
```{r}
knitr::kable(matrix(1:2),caption = '(ref:tabCap)')
```
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。