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

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

问题描述

我正在尝试用 RMarkdown pdf 写一篇论文.但我不知道如何使用特殊字符,如İ, ı, ğ, ü, ö".这些字符出现在土耳其语中.我可以很容易地在 Latex 中使用它们,例如u{g} – ğ、c{c} – ç、"{u} – ü、{i} – ı 等.

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

我在哪里可以找到一些 Rmarkdown 论文或书籍模板?

解决方案

土耳其字符的 HTML 代码可以工作(示例来自 打包,或自己制作

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

<小时>

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

xelatex 引擎推荐这种东西.然后您可以使用 mainfont 参数:

---标题:我的医生"输出:pdf_文档:latex_engine:xelatexmainfont:包含所有这些字符的系统字体的名称"---PDF 输出将采用您指定的字体.只需正常输入,无需特殊代码.

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.

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

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

解决方案

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

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

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

Which renders the PDF like this:

For article templates, see the rticles package, or make your own

For book templates, have a look at pandoc ebook, gitbook and bookdown


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

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天全站免登陆