段落中的口音完美無缺。圖中的文字在圖表查看器中是正確的,但是一旦我編譯PDF,重音就會從數字中消失。使用knitr和Rmarkdown生成pdf:文本中的重音出現,但不出現在數字中。
下面是一個重現問題的例子。
---
title: 'Some title'
author: 'This be me'
date: '`r format(Sys.Date(), "%B %Y")`'
lang: es
header-includes:
- \usepackage{tikz}
output:
pdf_document:
fig_caption: yes
---
```{r global options, echo = F, message=F}
library(knitr)
opts_chunk$set(fig.width=6, fig.height=3.5, dev = 'tikz')
```
I have some paragraphs that include cool accents like áspid.
If I run the next chunk in the R console I see the accent on the figure it generated. But the accent is missing in the pdf.
```{r}
plot(pressure, main= "áspid")
```
我認爲這是一個簡單的編碼事情,你需要考慮..使用堆棧中的這個較舊的建議:https://stackoverflow.com/questions/18146409/accent-in-knitr – sconfluentus
感謝您的建議。編碼是否會影響整個文檔?不會錯誤的編碼弄亂段落中的口音嗎? – Zentaur
它可能......它取決於您在整個文檔中使用的語言,您可能有可用的選項,有或沒有可用的重音符號。 – sconfluentus