Showing posts with label Tamil. Show all posts
Showing posts with label Tamil. Show all posts

Sunday, December 13, 2020

Typesetting in Tamil Brahmi in XeLaTeX

         Recently I found that Tamil Brahmi which is the precursor to the modern Tamil Language was included in the Unicode Standard. It is encoded in the range 11000-1107F. So I thought if its encoded in Unicode I wondered if I could typeset in Latex.This is my experiment. First we need the fonts for Brahmi and fortunately there is a font called Adinatha Tamil Brahmi and also its font manual.  and another font from Google Noto-Fonts called Noto Sans Brahmi.

         I Checked if I could type freely using IBus but unfortunately you can only enter characters one at a time this would be very time consuming, Luckily for us there is a transliteration tool from the authors of the font called Aksharamukha. To transliterate, set the base as Tamil and the output as Tamil Brahmi and you are good to go. Don't set the base as Tamil extended it doesn't work. Remember Aksharamukha is not a Translation tool.  Type your work and transliterate and copy the Tamil Brahmi letters. 

       Download and install the font. Run the following commands 
 
sudo fc-cache -v
sudo mkfontscale
sudo mkdir  
 
 IF you are using LuaLaTex run the following command to load the font 
 
luaotfload-tool --find "Adinatha Tamil Brahmi"
 
This  will load the font. Now you can typeset in either XeLaTex or LuaLaTex. Since both Polyglossia and  Babel don't support the Tamil Brahmi language natively we are turning to the fontspec package.  Here is the minimal working example. 

\RequirePackage[orthodox]{nag}
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{fontspec}
\usepackage{ClearSans}
\newfontfamily{\TACtam}{Lohit Tamil}
\newfontfamily{\bram}{Adinatha Tamil Brahmi}
\begin{document}
Hello.{\TACtam{வணக்கம்}}.{\bram{𑀯𑀡𑀓𑁆𑀓𑀫𑁆}}.
\end{document} 
 
Here is the screenshot.  

Image showing containg the word hello in three languages

Well my document compiled perfectly. Once again kudos to
Vindodh Rajan, Shriramana Sharma and Udhaya Sankar for the Font and Vindoh Rajan For maintaining the Aksharamuka transliteration tool. 




 

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.ஆ}}
 

Friday, December 11, 2020

Typesetting in Tamil For Multilingual Documents

 

When you are typesetting Multilingual document it doesn't make sense to load Polyglossia or Babel package just for a single line. All one has to load is the Fontspec package and the requisite font. Whenever Fontspec package is loaded it must be compiled in either XeLaTeX or LuaLaTex. Here is the minimal working example.

\RequirePackage[orthodox]{nag}
\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{ClearSans}
\usepackage{courier}
\newfontfamily{\TACtam}{Lohit Tamil}
\newfontfamily{\ctam}{Noto Sans Tamil Supplement}
\begin{document}
    normal  \emph{italic} \textbf{extra bold} \textit{italy} \texttt{help}
    {\TACtam அய்யா வணக்கம்.}{\ctam 𑿀}
\end{document}

You can name the Commands \TACtam and \ctam , wordings of your choice, this is saying to XeLaTeX to encode the fonts in Tamil.

 Reference: 

https://tex.stackexchange.com/a/241960/229186

Friday, October 16, 2020

Best Fonts for writing in Tamil in Debian Linux

 
Today there are many fonts for Tamil language, some fonts supports the sri [ஶ்ரீligature and some don't, also most fonts renders the word ர், ரி, ரீ as ர், ரி, ரீ. There is no balance between these renderings. The Tamil Nadu govt in order to avoid the confusion specified that  ர், ரி, ரீ should be rendered as  ர், ரி, ரீ and most of the people become accustomed to this usage and moved on. As for the Word ஶ்ரீ it is a ligature of ஶ் + ரீ so some fonts renders ஶ்ரீ  as  ஶ்ரீ. In my opinion these are some of the best Tamil fonts. 

1. Lohit Tamil Classical


This font by Red Hat renders the words properly and also looks more professional and antique. As the word classical implies the word னை will be rendered as னை. This was how the word was written before the 70's. Here is a look of how this font looks.

ஶ்ரீ கிருஷ்னர் வந்தார். அனைவரும் வணக்கம் செலுத்தினர்.



2. Noto Serif Tamil


This Font by  Google is the next best font. it renders  the  word  ர், ரி, ரீ  as  ர், ரி, ரீ


 ஶ்ரீ கிருஷ்னர் வந்தார். அனைவரும் வணக்கம் செலுத்தினர்.



3. TAU Series Fonts


The TAU series of fonts are released by Tamil Virtual Academy[TVA]. There  

is  also  TAU- Elango series also released by TVA don't get confused with

that series  of  Fonts.  Of all the fonts TAU-Barathi  has good font 

shape and renderings. Its also  like  Noto  serif Tamil.

ஶ்ரீ கிருஷ்னர் வந்தார். அனைவரும் வணக்கம் செலுத்தினர்.

There you have it. I believe these three fonts  are enough for professional looking documents written in Tamil language.


References:


1. http://www.tamilvu.org/tkbd/Tamil_Unicode_G.O.zip

2. https://logic10.tumblr.com/post/25302495177

Wednesday, October 14, 2020

Writing in Indian Launguages in Linux using IBus


To compose a document other than in English you need transliteration software. In Linux there is one such software that is IBus.Through IBus you can write in any language with ease. 

Installation

 In Debian start the synaptic package manager click the search button  and type IBus in the search field and press enter.

Image showing synaptic package manager with the search dialog box
Synaptic Package Manager

 Now scroll down and select IBus it will show the dependencies of the packages click ok and again the same with IBus-m17n and click apply in the taskbar. Make sure you have m17n-db package is installed before installing IBus.  

Location & Usage

After installation configure your system to make IBus starts when you login.IBus is typically located in your systray. It will show as EN.

image showing the xfce systray with IBus input system

This is your default locale setting. Now right click that icon in your panel and click preferences, a dialog box will open up and then goto Input Method 

Image showing the IBus Preferences Dialog box
IBus Preferences Dialog Box

 

Click the Add button and click the … in the bottom it will show you more choice and scroll down and you can now select your desired Indian language to write. 




Image showing the input method selection screen after clicking the add button


 

Image showing the indian language Tamil option







Image showing the type of input method to be selected after selecting the Tamil Language


Image showing the input method options when we right click the IBus interface in the systray

The Indian languages supported in IBus are Assamese, Bengali, Devanagari, Gujrati, Malayalam, Marathi, Tamil, Telugu, Kannada, Kashmiri, Maithili, Oriya, Punjabi, Sanskrit and Urdu. You can now open your favourite text editor and left click the Ibus icon in your systray to select your language or pressing ctrl+spacebar to change the language.

Popular Posts