फ्लोटिंग आइकॉन

Monday 29 June 2015

Type in devnagari in LaTeX

1.The ITRANS format

A short guide to using ITRANS for embedding Hindi, Marathi and Sanskrit in Latex documents by Rushikesh K. Joshi, IIT Bombay. Install itrans package and latex to use the notations given in this short guide.

http://www.cse.iitb.ac.in/~rkj/itrans/keyboardmap.pdf

++++++++++++++++++++++++++++++++++++++++++++

  1. \documentclass[12pt]{article}
  2. \usepackage{devanagari}
  3. \begin{document}
  4. Lets write in devanagari
  5.  
  6. {\dn calo devanagarI me likhate hai}
  7. \end{document}
+++++++++++++++++++++++++++++++++++++++++++++++
2.  direct using input tools

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Devanagari]{Mangal}
\begin{document}
\section{संस्कृतम्}
जीवनस्य लक्ष्यमेव संस्कृतस्य वर्धनम्
\subsection{कोऽम्}
\end{document}


using xeLatex


++++++++++++++++++++++++++++++++++++++++++++
more detailed


\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}




i hve miktex 2.9 & using TeXworks

No comments:

Post a Comment