Indian Languages in Latex

Myself and Prof.Partha were looking for generating PDF files with Tamil and English content using Latex.

Found that.
We can generate multi lingual pdf files using latex easily.
We need to supporting fonts installed anyhow.

Here is the sample code for this.

 

\documentclass{article}
%Always start xelatex files with these in preamble. This helps in defining the script and fonts
\usepackage{fontspec}
%Set the main languge next as main font.
\setmainfont[Script=Devanagari]{Lohit Hindi}

%Set rest of the languages l;ike this. Experiment a bit. script=punjabi did not work. Replaced with gurmukhi and it works.

\newfontfamily{\tam}[Script=Tamil]{Akshar Unicode}
\newfontfamily{\tel}[Script=Telugu]{Akshar Unicode}
\newfontfamily{\kan}[Script=Kannada]{Mallige}
\newfontfamily{\Guja}[Script=Gujarati]{Lohit Gujarati}
\newfontfamily{\ben}[Script=Bengali]{Lohit Bengali}
\newfontfamily{\Punj}[Script=Gurmukhi]{Lohit Punjabi}

%English does not need any script specifiction! Just define the font.
\newfontfamily{\eng}{Arial}
\begin{document}
%No need to define script as this is the manin font set. Like defalut.
नमो पकवते नारायणाय! \\
%Switch language like this. { begins the changed line. \xxx denotes the switched  language. Use the same definition as denoted in preamble. } will end the switch and default to main unless again specified.
{\tel నమో పకవతే నారాయణాయ!}\\
{\kan ನಮೋ ಪಕವತೇ ನಾರಾಯಣಾಯ
}\\
{\Guja નમો પકવતે નારાયણાય!}\\
{\Punj ਨਮੋ ਪਕਵਤੇ ਨਾਰਾਯਣਾਯ!}\\
{\ben নমো পকবতে নারায়ণায়!}\\
{\tam நமோ பகவதே நாராயணாய!}\\

{\eng namo bhagavate naraayanaaya}\\
%the next line does not begin liekt he ones above. so it defaults to mainfont which is devanagari.
शुभम।
\end{document}

 

Check the output too.

Thanks for Dr.Vasudevan Tirumurti for the latex file.

10 thoughts on “Indian Languages in Latex

  1. Is there any way to type math formulas in indic languages? For example, \frac{ઇનપુટ}{સાધનો} should print ઇનપુટ/સાધનોનો. The Script is Gujarati, and font is Arial Uncode MS

  2. Thanks Sir.
    LaTex என்பது ஒரு Document Preparation System மற்றும் Document Markup Language ஆகும். இதைப் பற்றி மேலும் தெரிந்து கொள்ள விக்கிப்பீடியா பக்கத்திற்குச் செல்லவும். இதில் தமிழ் மொழியையும் பயன்படுத்தலாம். தமிழைப் பயன்படுத்துவதுப் பற்றி இங்கு பார்ப்போம். http://gnutamil.blogspot.in/2015/01/latex.html

Leave a comment