Saturday, October 6, 2018

Nepali (Devanagari) in Tex


1. What is Tex?

TeX is a powerful automated typesetting system designed to allow anybody to produce high standard documents using minimal effort, and to provide a system that would give exactly the same results on all computers, at any point in time. It produces formatted output in a PDF file as well as in other formats. 

TeX is a free software, and is available for all the operating systems. It is well documented as well as supported (visit http://tug.org and https://ctan.org). 

TeX is a popular means of typesetting complex formulae, symbols, etc. It is popular in academia, especially in mathematics, computer science, linguistics, engineering, physics, chemistry, etc. 

TeX is considered fairly difficult to learn on its own, and deals more with appearance than structure. In order to make it user friendly, there are several distributions (often known as macro packages or programs or engines) like LaTex, XeTeX, XeLaTeX, etc.

(Compiled from various sources)

Those interested to type Nepali (in Devanagari), English and IPA in TeX may follow:

1. Template


\documentclass[a4paper,12pt]{article}
\usepackage{fontspec}
\usepackage{geometry} 
\setmainfont{Kalimati}
\newfontface{\english}{Times New Roman}
\newfontface{\ipa}{Charis SIL}
\title{बाबाको कथा}
\author{समर सिन्हा}
\date{}

\begin{document}
\maketitle

\section{परिचय}

{\english This is in English. See below for Nepali and IPA.} \\

\noindent मेरो नाम समर हो| \\ मेरो घर रङ्गबुल हो। \\\\

{\ipa θɪsɪzsəmaɪpeɪ}

\end{document}

2. Always save the file as UTF-8.

3. XeLaTeX is one of the TeX programs that natively supports Unicode and the input file is assumed to be in UTF-8. Program/engine to use is XeLateX (not others).