I have a simple markdown like this:
---
dir: rtl
title: "درس روش پژوهش و ارائه"
author: "امیر شبانی"
date: "یکشنبه - ۱ دی ۱۳۹۸"
---
I save it in a file named Presentation.md
and compile using this command:
pandoc Presentation.md -t beamer -o Presentation.pdf --pdf-engine=xelatex -V mainfont="Sahel"
The command runs without any error, but the font is not showing properly:
If I change the font from Sahel
to BNazanin
, it works fine:
But I'm interested in Sahel
font. Is there any way I can fix it?
I don't think the font is corrupt, because it's showing fine in other programs, such as
VSCode:
Telegram:
Firefox:
As suggested by @tarleb, I asked my question on TeX.StackExchange and got an answer. The person that answered the question doesn't have an Stack Overflow account, so I'm just gonna copy their answer here, in case someone finds this question first.
All that was needed was to specify the -V lang=ar
in the original command, so that Pandoc
doesn't load the default English script of the font. The font is Persian, but apparently since Arabic and Persian have similar letters, setting the language to Arabic works. So I can achieve what I wanted in two ways:
Specify the language in the command, when compiling:
Using this command,
pandoc pres.md -t beamer -o pres.pdf --pdf-engine=xelatex -V mainfont="Sahel" -V lang=ar
we can see that it works:
Specifying the language in the markdown file's metadata (Which I personally prefer)
So my markdown file would look like this:
---
lang: ar
dir: rtl
title: "درس روش پژوهش و ارائه"
author: "امیر شبانی"
date: "یکشنبه - ۸ دی ۱۳۹۸"
---
And we can see that this method works as well:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With