itrans
package and the devanagari
fonts, this exact question was asked on the TeX-LaTeX Stack Exchange site, to which I posted what worked for me. So this post is essentially a re-write of my answers there.(These instructions are LaTeX-only; I’ve not dabbled much in XƎLaTeX.)
Installation on Ubuntu (TeXLive)
This one’s easy. Grab theitrans
and itrans-fonts
packages for Tamil, and also the texlive-lang-indic
package for the Hindi fonts via synaptic (or apt-get).Installation on Windows XP (MikTeX)
Grab thedevanagari
package using MikTeX’s Package Manager. As for itrans
, since it’s not packaged properly in MikTeX, so we’ll need to install it manually. Download itrans53-win32.zip
from CTAN. After unzipping the contents (say C:\itrans53\
), assuming <texmf>
being your local TEXMF
tree,- Move the contents of the
lib
folder into<texmf>\tex\latex\itrans
- Move the contents of the
fonts
folder into the appropriate locations, i.e. *.mf
in<texmf>\fonts\source\itrans
*.afm
in<texmf>\fonts\afm\itrans
*.tfm
in<texmf>\fonts\tfm\itrans
*.pfb
,*.pfa
,*.pfm
in<texmf>\fonts\type1\itrans
*.ttf
in<texmf>\fonts\truetype\itrans
*.fd
in<texmf>\tex\latex\itrans
- Refresh the file name database (e.g. via MikTeX Options/Settings)
Using itrans
itrans
doesn’t let you type in Tamil or Hindi (or Marathi, Sanskrit, Telugu and Gujarati) directly, rather you have to key in the ASCII transcription, then process it with itrans
from the command prompt, then run (pdf)latex
on the resultant file.Say I have the following file
indic-pre.tex
:\documentclass[11pt]{article}
\usepackage[preprocess]{itrans}
\newfont{\tmlb}{wntml12}
\newfont{\tmls}{wntml10}
\newfont{\devnf}{dvng10 scaled \magstep1}
#tamilifm=wntml.ifm
#tamilfont=\tmlb
#hindiifm=dvng.ifm
#hindifont=\devnf
\begin{document}
Thank you!
{#tamil na^nRi #endtamil}
{#hindi dhanyavaad #endhindi}
\end{document}
\usepackage[preprocess]{itrans}
\newfont{\tmlb}{wntml12}
\newfont{\tmls}{wntml10}
\newfont{\devnf}{dvng10 scaled \magstep1}
#tamilifm=wntml.ifm
#tamilfont=\tmlb
#hindiifm=dvng.ifm
#hindifont=\devnf
\begin{document}
Thank you!
{#tamil na^nRi #endtamil}
{#hindi dhanyavaad #endhindi}
\end{document}
Process it with
itrans
: (Windows MikTeX users need to change path to itrans53\bin
to evoke itrans.exe
$ itrans -i indic-pre.tex -o indic.tex
Then run
(pdf)latex
on indic.tex
, which is of course the file to edit if you have further text to add. Here's the output of that little file:Hold on! How’d you know you needed to type na^nRi
etc?
I peeked at the transliteration map files ☺. For example, tamil.ps for the Tamil transliteration, dvng.ps for the Hindi (devanagari) transliteration, etc. If your LaTeX set up doesn’t install these files by default, you can download the package source .zip
and look in the doc
folder. The .itx
files are sample source .tex
files that generated the .ps
files.
very nice
ReplyDeletebut i want to know how this newfont is defined
Rajan, I don't quite understand your question, can you describe in more detail what is it that you want to know?
ReplyDelete@Rajan T K, There are many tools for creating fonts. E.g Metafont is a free but powerful tool.
ReplyDeleteHi,
ReplyDeleteI tried the steps mention here.
When i ran the command "itrans -i indic-pre.tex -o indic.tex",
I get the error:
** ITRANS 5.30 (29 July 2006) (TeX Interface)
Loading IFM file wntml.ifm ...Error: could not open wntml.ifm for reading
Error: fillup font error (fill up from wntml.ifm)
Error: could not load in IFM file (line 7, #tamilifm=wntml.ifm)
What am I doing wrong?
Can you please help?
Thanks,
Ram
Hello Ram, What OS are you on? It sounds like you're missing the itrans font files.
DeleteThanks very much for the post, it is exactly what I have been trying to do, but in Gujarati. I needed to make one change that other users might find useful though. I could not initially run latex or pdflatex successfully, and I kept getting the message below.
ReplyDelete!pdfTeX error: pdflatex (file itxguj.pfa): cannot open Type 1 font file for reading
What I needed to do was to copy the itxguj.pfa file to the /usr/share/texmf-texlive/fonts/type1/public/velthuis/ directory (on ubuntu 12.04) and run texhash as the user (sudo texhash). It worked beautifully thereafter!
Thanks for the helpful tips!
DeleteHi,
ReplyDeleteI am getting error in windows 7 while evoking itrans.exe. The error is "Not a TDS-compliant root directory" How can I rectify the error.
The MiKTeX instructions above are a bit incomplete.
ReplyDeleteI posted more complete installation instructions for integrating MiKTeX and ITRANS at:
http://tex.stackexchange.com/questions/319/latex-xetex-setup-tamil-indic-languages
I have a problem with Itrans and dvnc font for sanskrit. I follow these steps:
ReplyDelete1.- I write a file "my-file.itx"
2.- I use the pre-processor: itrans -i my-file.itx -o my-file.tex
3.- I open "my-file.tex" with TexnicCenter y make the ouput profile Latex->Ps (no problem)
4.- I try to see "my-file.ps" but it's impossible to view anything.
Where is the problem?
Thankyou very much for your help
I'm not quite sure what's the cause of the problem here. If you convert the PS to a PDF, do you get any contents in your PDF?
DeleteI tried this in Windows 7 (example file from linux user group)
ReplyDelete\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Arial}
\begin{document}
\font\rm="Arial Unicode MS" at 16pt \rm
அன்புள்ள அய்யாவுக்கு,\\
வணக்கம். \\
என்னுடைய இக்கடிதம் கிடைத்ததும் பதில் அனுப்புக
\end{document}
and run xelatex instead of pdflatex.
I get tamil output but the rendering of tamil characters are not correct.
Can any one offer help?
I ran your code (Windows 7, MikTeX 2.9) and got some colleagues who can read Tamil to vet the output; things seem to be running fine here..
DeleteHi Lian,
ReplyDeleteThank you so much for this information. I am not too familiar with the commands in LaTeX. Please can you help me with getting the output for Sanskrit, Kannada and English with diacritics. I am not sure how to specify the \newfont{.....} commands.
Thank you!
This is such a great blog post. I was exactly looking for something like this to get tamil fonts. Let me try it out and see how it goes. Thanks
ReplyDelete