don't show exit pdf in rmarkdown

I have a RTL text (Persian language) and when to run code, my pdf doesn't show me a text by Persian characters and only shows English character. what's the problem?

---
title: "john_hopkings"
author: "M.Gavahi"
date: "1/12/2020"
output:
  pdf_document: 
    latex_engine: xelatex
dir: rtl
lang: ira
---

 امروزه زبان برنامه نویسی **R** بعنوان زبانی برای استفاده در محیط های دانشگاهی و صنعت به کار می رود. تعداد فزاینده ای از محققان ،**R** را به عنوان یکی از ابزارهای تولیدی آنالیز داده ها و تجسم داده ها انتخاب می کنند. این نرم افزار کاملاً رایگان و منبع باز می باشد و یکی از مزیت های آن داشتن پکیج های زیاد و همچنین جامعه آماری از برنامه نویسان آن می باشد.
 

First, see if you can do this in plain LaTeX with xelatex or lualatex

\documentclass{article}
\usepackage{fontspec}
\usepackage{xepersian}
\settextfont{XB Niloofar}
\begin{document}
امروزه زبان برنامه نویسی R بعنوان زبانی برای استفاده در محیط های دانشگاهی و صنعت به کار می رود. تعداد فزاینده ای از محققان ،R را به عنوان یکی از ابزارهای تولیدی آنالیز داده ها و تجسم داده ها انتخاب می کنند. این نرم افزار کاملاً رایگان و منبع باز می باشد و یکی از مزیت های آن داشتن پکیج های زیاد و همچنین جامعه آماری از برنامه نویسان آن می باشد.
\end{document}

Being able to do that probably won't solve the rmarkdown problem, but being unable will definitely prevent solving it.

It might be necessary to use a custom pandoc call. Let's see how it goes.

thanks.
i add a html tag to code but for html output correct in two language english(ltl) and persian(rtl) but for pdf output don't worked.

---
title: ""
author: ""
date: "1/12/2020"
output:
  pdf_document:
    latex_engine: xelatex
  html_document:
    df_print: paged
---
<style>
h1 {
  direction: rtl;
}
p {
  direction: rtl;
}
</style>

hello

سلام

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.