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?
If you need special characters for other languages in addition to Turkish, looks like you can type in the code listed at this webpage:
http://www.starr.net/is/type/htmlcodes.html
Be sure to include the
;
rmarkdown uses LaTeX to create the PDF, so you should be able to just use LaTeX markup. As an example:
Also, depending on the particular characters, you may be able to just type them in as-is (see, for example, here).
HTML codes for Turkish characters will work (example from wikipedia):
Which renders the PDF like this:
For article templates, see the
rticles
package, or make your ownFor 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 themainfont
argument:I guess this question per se is obsolete. As of now (
rmarkdown
V1.4 /knitr
V1.15.1),knitr
automatically follows the advice of this question and includesin the preamble to LaTeX output (caveat: of course this means that your document editor will have to be using UTF-8, but e.g., RStudio does that by default).
Then this works as expected:
This is not a panacea, as many scripts still require more tinkering (I tried Korean, Chinese, and Japanese). See here for where to start on bolstering the preamble in case you need more multifarious fonts.