2

I'm having problems with bold and italic options in my pdf file that I get from my Rmarkdown file. I write in Russian so I unclude babel package and after that ** and __ stop working.

Here's my Rmarkdown file. The result is in plain font, the word is not bold.

---
output: pdf_document
header-includes:
- \usepackage[russian]{babel}
---
**Theorem**.

Here is result of convertion of this Rmd-file to tex.

While this version keeps the word bold:

---
output: pdf_document
---
**Theorem**

I also tried to change latex engine from pdflatex to xelatex but for xelatex I also should specify some special font that supports cyrillic. If I don't specify mainfont there's no cyrillic letters in the result. And I would really like to stay with the default font.

This works but I don't like the font:

---
output:
  pdf_document:
    latex_engine: xelatex
mainfont: Arial
---

**Теорема**.

This doesn't work:

---
output:
  pdf_document:
    latex_engine: xelatex
---

**Теорема**.
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Martin Schröder May 25 '15 at 11:44
  • You should show the tex code created by your markdown. – Ulrike Fischer May 25 '15 at 12:50
  • It's 2kb file, I added the link to it to the post. – Egor Ignatenkov May 25 '15 at 13:08
  • 1
    Well the best would be to remove \usepackage{lmodern} from your template -- lmodern doesn't support cyrillic. If you can't do it, reset the families with \renewcommand\rmdefault{cmr} and \renewcommand\sfdefault{cmss} – Ulrike Fischer May 25 '15 at 13:28
  • Thanks! I found default.tex used by Rstudio as a template and removed \usepackage{lmodern} from there. Now everything is fine! – Egor Ignatenkov May 25 '15 at 14:55
4

Recommendation from @Ulrike Fischer worked: I found default.tex used by Rstudio as a template when converting from Rmd to pdf (~/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmd/latex/default.tex) and removed \usepackage{lmodern} from there. After that this piece of code compiled correctly:

---
output: pdf_document
header-includes:
- \usepackage[russian]{babel}
---
**Theorem**.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.