Use Persian language with a custom font in pylatex

79 Views Asked by At

I want to create documentation using the pylatex library in Python. How can I do that? I have written the following minimal codes, but I can not get the output in Persian.

from pylatex import Document, Package,Command,Math
from pylatex.utils import NoEscape  
doc = Document()
doc.append(Command('fontsize', arguments = ['16', '12']))
doc.packages.add(Package('babel',options=['farsi']))
doc.append(NoEscape('این فقط یک تست هست برای زبان فارسی '))

doc.append(Math(data=['y=4+2x']))

doc.append(NoEscape('\hrule'))

doc.generate_pdf('basic',clean_tex=True)

doc.generate_tex()
0

There are 0 best solutions below