3

I use TexniCentre and Miktex 2.8 in Windows XP. I would like to typeset Tamil text, and so far I've been unsuccessful.

Please suggest me a working TeX/LaTex/variants setup for Tamil language.

Thanks for any help in advance.

5

(Recommended) The XeLaTeX/LuaLaTeX way with polyglossia

You'll need a Tamil font installed on your operating system; I used Noto Serif Tamil and Noto Sans Tamil as example below.

\usepackage{polyglossia}
\setmainlanguage{tamil}
\setotherlanguage{english} %% OPTIONAL if you have some English text in your book

 %% Select fonts for Tamil
\newfontfamily\tamilfont[Script=Tamil]{Noto Serif Tamil}
\newfontfamily\tamilfontsf[Script=Tamil]{Noto Sans Tamil}

%% OPTIONAL; Select fonts for English
\setmainfont{Times New Roman}
\setsansfont{Arial}

Then compile the document with xelatex or lualatex.

The pdfLaTeX way with the itrans package

Typesetting Tamil is possible with the itrans pakcage, but it's not packaged properly in MikTeX. You will 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
  • Refresh the file name database (e.g. via MikTeX Options/Settings)

Then try out the minimal example I gave in my answer to this related question. You would need to evoke itrans.exe in the itrans53\bin folder. (However I'm not sure if it works in 64-bit Windows.)

  • There is a possibly-related post at latex-my.blogspot.com/2010/08/… – Joseph Wright Aug 21 '10 at 7:49
  • @Joseph, yes, I wrote that post. ;-) Tamil is widely spoken in Malaysia so I thought it was appropriate to do a post on how it can be done in LaTeX for our blog (M'sian LaTeX Users). I'd got itrans working on my systems when these questions were posted here on SE. – LianTze Lim Aug 21 '10 at 13:08
1

For my Ubuntu system I used the package manager to install the itrans and itrans-fonts packages. No muss No fuss.

For Windows and MiKTex 2.9 the set up process was more involved. Below is the batch file I created to facilitate the copying.

1) Install MiKTeX

2) Use the MiKTeX package manage to install the indic-type1 package and the devanagari packages.

3) download itrans53-win32.zip from http://www.aczoom.com/files/itrans/53/itrans53-win32.zip

4) extract itrans53-win32.zip to some temporary location. I used C:\temp\Tamil\ITRANS53.

5) Open a command window which is running as administrator. (many of the copies are into c:\program files\ and that requires the process be run with elevated privilege)

6) CD to the temporary location of ITrans (e.g. C:\temp\Tamil\ITRANS53)

7) execute the batchfile commands below.

8) close the command window

9) Right click on start->computer and select Properties.

10) Select Advanced System Settings->Environment Variables

11) add new system environment variable named: ITRANSPATH. See the batch file commands below for the exact value for this variable.

12) open a command window

13) The command:

itrans -I <filename>.itx -o <filename>.tex 

will now work and (pdf)latex can resolve the packages, fonts, and commands referenced in the output from itrans.exe.

I can now process LaTeX files in both Ubuntu and Windows 7 and have the source files (.Tex, .ITX, etc.) under revision control

The batch file is:

echo off

rem Record where is MikTeX is installed
set MiktexRoot=C:\Program Files\MiKTeX 2.9

rem copy itrans.exe to a directory already within the path environment variable
rem   namely the path adjustment made by the installer for MiKTeX which puts
rem   all of the MiKTeX installed tools on the PATH variable
rem
rem for 32-bit windows systems remove the x64 suffix
copy ".\bin\*.exe" "%MiktexRoot%\miktex\bin\x64\*.*" /Y /V 

rem Create the directories within the MikTeX structure used or referenced by the itrans package
mkdir "%MiktexRoot%\doc\itrans"
mkdir "%MiktexRoot%\doc\itrans\contrib"
mkdir "%MiktexRoot%\fonts\source\public\itrans"
mkdir "%MiktexRoot%\fonts\type1\public\itrans" 
mkdir "%MiktexRoot%\fonts\tfm\public\itrans" 
mkdir "%MiktexRoot%\fonts\afm\public\itrans" 
mkdir "%MiktexRoot%\fonts\truetype\public\itrans" 
mkdir "%MiktexRoot%\tex\latex\itrans"
mkdir "%MiktexRoot%\tex\latex\itrans\fonts"

rem Copy itrans package files into the MiKTeX structure
rem used http:\\tex.stackexchange.com\questions\1754\tamil-tex-in-windows
rem and the installation script for Tamil-Omega as guides for the copy commands
rem Listed below
rem

rem Copy Documentation files
copy ".\doc\*.*" "%MiktexRoot%\doc\itrans\*.*" /Y /V 
copy ".\contrib\*.*" "%MiktexRoot%\doc\itrans\contrib\*.*" /Y /V 
rem copy Font Files
copy ".\lib\fonts\*.mf"  "%MiktexRoot%\fonts\source\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.pfa" "%MiktexRoot%\fonts\type1\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.pfb" "%MiktexRoot%\fonts\type1\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.pfm" "%MiktexRoot%\fonts\type1\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.tfm" "%MiktexRoot%\fonts\tfm\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.afm" "%MiktexRoot%\fonts\afm\public\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.ttf" "%MiktexRoot%\fonts\truetype\public\itrans\*.*" /Y /V 
rem copy all of the ITRANS Lib structure into MiKTeX structure.
copy ".\lib\*.*" "%MiktexRoot%\tex\latex\itrans\*.*" /Y /V 
copy ".\lib\fonts\*.*" "%MiktexRoot%\tex\latex\itrans\fonts\*.*" /Y /V 

rem post installation commands to rebuilt the font name database ans to process all of the font MAPping files.    
texhash
updmap

rem
rem With the above copies MikTeX can now find the ITRANS fonts and resolve references created by the itrans.exe preprocessor
rem
rem But the preprocessor cannot be run from the command line because itrans.exe is expecting to find a 
rem specific ITRANS structure somewhere on the disk via the environment variable: ITRANSPATH
rem instruct the user about this environment variable requirement
rem

echo "Set the environment variable: ITRANSPATH"
echo "ITRANSPATH=%MiktexRoot%\tex\latex\itrans;%MiktexRoot%\tex\latex\itrans\fonts"
1

On Windows 10, first install the “Supplemental Tamil Fonts”, namely Latha and Vijaya. (Windows 10 comes by default with Nirmala UI, which does not work as well.) The directions are available, for instance, at Microsoft Answers. A brief summary of those directions is: Settings -> System -> Apps & features -> Manage optional features -> "+" icon next to Add a feature -> "Tamil Supplemental Fonts".

Then use XeLateX following the answers to the question “Typesetting in Tamil on ShareLaTeX” on this site, with font Latha or Vijaya.

I was writing something in both English and Tamil so the key commands I used from the answers to this other question were:

\usepackage{polyglossia}
\setmainlanguage{tamil}
\setotherlanguage{english}
\usepackage{fontspec}

along with: \selectlanguage{english} % Some English writing here \selectlanguage{tamil} % Some Tamil writing here

You also have to use \newfontfamily or \setmainfont to select the font you installed in the first step (Latha or Vijaya) as the actual font to use when rendering Tamil.

  • 1
    Welcome to TeX.SX! While these links may answer the question it would be helpful to include the essential bits here in this post. – TeXnician Mar 23 '18 at 5:22
  • Welcome. I have rewritten your answer a bit. Using XeLaTeX is indeed a good suggestion. (I agree with TeXnician in general, but in this case I think the links are ok, because one of them is to another question on this site itself, and the other is about how to install certain fonts that are available as an optional feature of Windows itself, which is probably something one can find in many places on the internet or in the Windows documentation.) – ShreevatsaR Mar 23 '18 at 6:36
  • Thanks for the feedback. @ShreevatsaR I think you did a good job rewriting, but I added a few more details to address TeXnician's concerns – anandsun Apr 2 '18 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy