Saturday, December 12, 2020

Some Essential difference in Writing a letter in Tamil using XeLaTeX

 
Typesetting  a Tamil letter in XeLaTeX is essentially the same as typesetting a letter in  English.But it has some significant difference. I will list it out below. 

1. Load the Polyglossia or Babel Package

To typeset in Tamil  one has to load either the polyglossia or Babel package. 
Add the following to your preamble.

\usepackage[babelshorthands=true]{polyglossia}
\enablehyphenation
\setmainlanguage{tamil}
% if you need English
\setotherlanguage{english}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]
% if you need English then set the font
\newfontfamily\englishfont{Times New Roman}[Scale=MatchLowercase,Renderer=Harfbuzz,Ligatures=TeX]  
 
OR if you are using the Babel Package then add the following to your preamble 

\usepackage{babel}
\babelprovide[main, import]{tamil}
% if you need English
 \babelprovide[import]{english}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]

% if you need English then set the font
\newfontfamily\englishfont{Georgia}[Scale=0.98,Renderer=Harfbuzz,Ligatures=TeX]

2. Date is Messed up. 

If you want the date to print automatically it follows Year-Month-date format Since  most people Follow either dd/mm/yyyy or month-date-year format. So you have to set manually the date, to do this load the datetime package
 
\usepackage{datetime}
\date{dd/mm/yyyy}   or
\date{month date, year} 

3. You Can't use \cc or \encl command  

Unless you create your own class and style it is impossible to use the native \cc and \encl command in the letter class. However we can do it manually in the letter class. Since CC and Enclosures are placed after the signature we manually  typeset them.
In Tamil cc is typed as நகல்  and enclosures as இணைப்புகள்.You can use the following commands after the signature in letter.

\par
நகல்:{\par\hspace{10mm}{1. அ \par\hspace{10mm} 2. ஆ}}
\par
இணைப்புகள்:{\par\hspace{10mm}
{2. அ \par\hspace{10mm} 2.ஆ}}
 

No comments:

Post a Comment

Popular Posts