I really need to write a Rmarkdown pdf document, I tried this in english version
---
title: "Report"
subtitle: "Company S.A."
output:
bookdown::pdf_document2:
toc: true
number_sections: true
header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}
\includegraphics[width=2in,height=2in]{logo.png}\LARGE\\}
- \posttitle{\end{center}}
---
and works just fine I have the pdf document that I want. When I try to write the same exact document in greek, It does't work anything it cannot recognize the greek language. so I tried this, but also did not work.
header_includes:
- \usepackage[utf8x]{inputenc}
- \usepackage[english,greek]{babel}
- \newcommand{\en}{\selectlanguage{english}}
- \newcommand{\gr}{\selectlanguage{greek}}
title: "Φύλλο αναφοράς"
subtitle: "Εταρεία Α.Ε."
output:
bookdown::pdf_document2:
toc: true
number_sections: true
---
\gr Καλημερα
Does anyone know how tosolve this problem? I need two documents to write in greek one in html and one in pdf.
using this code
---
title: "\\gr Φύλλο αναφοράς"
subtitle: "\\gr Εταρεία Α.Ε."
output:
bookdown::pdf_document2:
toc: true
number_sections: true
keep_tex: true
header-includes:
- \usepackage[english,greek]{babel}
- \newcommand{\en}{\selectlanguage{english}}
- \newcommand{\gr}{\selectlanguage{greek}}
---
\gr Καλημερα
it gives me this error
while using this code
---
title: "Φύλλο αναφοράς"
subtitle: "Εταρεία Α.Ε."
output:
bookdown::pdf_document2:
toc: true
number_sections: true
keep_tex: true
latex_engine: xelatex
header-includes:
- \usepackage{fontspec}
- \setmainfont{TeX Gyre Heros}
---
Καλημερα
it gives me this error



