I have a .tex
file with text in Devanagari script. I am able to convert to pdf using XeLaTeX outside of Emacs without any problem. However, when I try it within Emacs, the resulting pdf does not have any Devanagari text.
I am new to emacs, and am using spacemacs 25.1
.
Here are the solutions I have already tried, but I couldn't get them to work:
- https://www.r-bloggers.com/hindidevanagari-presentations-using-orgmode-r-latex-and-beamer/
- https://tex.stackexchange.com/questions/21200/auctex-and-xetex
- https://stackoverflow.com/questions/15926817/add-xelatex-to-the-command-list
- http://orgmode.org/worg/org-faq.html#using-xelatex-for-pdf-export
I have tried many combinations and variations of these to no success.
How do I generate a pdf from within Emacs that shows the Devanagari script?
EDIT:
Here is the minimal example which works in a .tex
file if compiled with xelatex
outside of emacs
environment:
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{sanskrit}
\setotherlanguage{english}
\setmainfont[Script=Devanagari]{Arial Unicode MS}
\newfontfamily\devanagarifontsf[Script=Devanagari]{Arial Unicode MS}
\begin{document}
मया emacs बहु रोचते।
\end{document}
However, when I try to write the same in org mode, desired output is not generated. Here is the content of my org mode file:
#+Title: Generating Devanagarai text in LaTeX?
#+LATEX_CMD: xelatex
#+LATEX_HEADER: \usepackage{polyglossia}
#+LATEX_HEADER: \setmainlanguage{sanskrit}
#+LATEX_HEADER: \setotherlanguage{english}
#+LATEX_HEADER: \setmainfont[Script=Devanagari]{Arial Unicode MS}
#+LATEX_HEADER: \newfontfamily\devanagarifontsf[Script=Devanagari]{Arial Unicode MS}
मया emacs बहु रोचते।
If the org file is exported as html
, the output has both Devanagari and English text as expected. However, no pdf output is generated when exporting as latex
.
.tex
and.org
formats now. I have also tried to follow the stackoverflow link which you had shared, but could not get it to work. An error message is generated saying no pdf was produced. I tried compiling with and without(setq TeX-engine 'xetex)
command in my config.