如何在RMarkdown乳胶文档中写特殊字符? [英] How can I write special characters in RMarkdown latex documents?

查看:107
本文介绍了如何在RMarkdown乳胶文档中写特殊字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用RMarkdown pdf撰写论文.但是我不知道如何使用特殊字符,例如İ,ı,ğ,ü,ö".这些字符以土耳其语显示.我可以使用例如在Latex中轻松使用它们\ u {g} –ğ,\ c {c} –ç,\" {u} –ü,{\ i} –ı等

I am trying ot write a paper in RMarkdown pdf. But I dont know how to use special characters like "İ, ı, ğ, ü, ö". Those characters are present in Turkish. I can easily use them in Latex using e.g. \u{g} – ğ, \c{c} – ç, \"{u} – ü, {\i} – ı, etc.

您能告诉我如何在RMarkdown中做同样的事情吗?

Could you please tell how can I do the same in RMarkdown?

在哪里可以找到Rmarkdown纸或书籍模板?

And where can I find some Rmarkdown paper or book templates?

推荐答案

适用于土耳其语字符的HTML代码(例如维基百科):

HTML codes for Turkish characters will work (example from wikipedia):

---
title: "My doc"
output: pdf_document
---

HTML      char  detail                            anglicized
-------   --    ------------------------------    ---
Ğ   Ğ       Uppercase "G" with breve accent   gh1
İ     İ     Uppercase dotted "I"²               i (as in "tree")
Ş     Ş     Uppercase "S" with cedilla          sh
ğ     ğ     Lowercase "g" with breve accent   gh1
ı     ı     Lowercase dotless "i"³              ou (as in "in")
ş     ş     Lowercase "s" with cedilla          sh
-------   --    -------------------------------   --

以如下方式呈现PDF:

Which renders the PDF like this:

有关文章模板,请参见 rticles 程序包,或制作自己的

对于书模板,请查看 pandoc电子书 gitbook 预订

我最初建议的xelatex选项将适用于土耳其语字符:

This xelatex option I initially suggested will not work for Turkish characters:

xelatex引擎 mainfont参数:

The xelatex engine is recommended for this kind of thing. Then you can access your system fonts with the mainfont argument:

---
title: "My doc"
output:
  pdf_document:
    latex_engine: xelatex
mainfont: "name of your system font that has all those characters"
---

PDF output will be in the font you specify. 

Just type as normal with no special codes.

这篇关于如何在RMarkdown乳胶文档中写特殊字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆