How to Create Devanagari Documents in Lyx Using Xelatex

With the incorporation of XeLaTeX in all major distributions of LaTeX including MikTeX, it has become easy to incorporate Devanagari and other Unicode characters in LaTeX/LyX documents. Here we describe a point-wise summary to help you do just that.

Steps

  1. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 1
    1
    Download the latest version of LyX from www.lyx.org.
  2. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 2
    2
    (The LyX for Windows installer will automatically also install the LaTeX engine "MiKTeX".)
  3. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 3
    3
    Follow the steps in this LyX Wiki page.
  4. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 4
    4
    Download and Install Sanskrit 2003 (or get other Unicode font) South Asian Language Resource Center.
  5. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 5
    5
    Add the following to the preamble of your LyX document:
    • \setmainfont[Script=Devanagari]{Sanskrit 2003}
  6. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 6
    6
    Add the following in an ERT code box near the beginning of your document:
    • \font\dev="Sanskrit 2003:script=deva" at 12pt
    • \dev
  7. 7
    Install input method for Devanagari Unicode and start typing.
  8. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 8
    8
    Export document to the format PDF (XeTeX).
  9. Image titled Create Devanagari Documents in Lyx Using Xelatex Step 9
    9
    (For further information read the LyX's XeTeX Wiki page for a brief introduction on how to use XeTeX in LyX.)

Tips

  • Make sure you use File->Export->LaTeX (pdflatex) and not File->Export->PDF (pdflatex)
  • To use Helvetica, include \usepackage{helvet} in the preamble and use something like: {\fontfamily{phv}\fontsize{12pt}{12pt}\selectfont This is Helvetica }

Article Info

Categories: Software