# Typesetting in Tamil on ShareLaTeX

My main goal is to display Tamil script in LaTeX using ShareLaTeX. I would be happy to figure out a minimal working code to display வணக்கம் in ShareLaTeX.

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Tirukkural}
\date{April 2014}
\begin{document}
\maketitle

அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு

\end{document}


I have tried several packages, however, I run into a lot of errors whenever I use them. Here are some of my attempts:

1) itrans-package: Transliteration Example LaTeX/XeTeX setup Tamil/Indic languages

When I use the code suggested in the thread above, I get the error: 'File 'itrans.sty' not found'. How could I include it into ShareLaTeX?

2) otamil-package: Tamil Font Example

When I try to include the otamil-package the documentation says I have to install Yudit which would therefore not allow me to use tamil through ShareLaTeX. Does anyone have a suggestion how I could bring the code to use?

\usepackage[chandra]{otamil}


3) babel-package: Tamil Font Example http://www.sharelatex.com/learn/International_language_support

ShareLaTeX has a sample code for using Russian script. However, applying the same logic to Tamil I get the following error message: Package babel Error: Unknown option tamil'. Either you misspelled it

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english, tamil]{babel}
\usepackage[T1, T2A]{fontenc}

\begin{document}

அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு

\end{document}


Fast solution for ShareLaTeX: upload the font file(s) into the project and use the fontspec package with ExternalLocation parameter in the xelatex engine.

My best guess is that there is no solution for ShareLaTeX/WriteLaTeX at the moment. As far as I know, there is no font in TeX distribution supporting Tamil. There is/was support for Omega, see tamil-omega, but you cannot run it. Even an example in itrans-xetex uses the JanaTamil font which must be installed somehow. There is a great support for Indic fonts in T1 encoding created by Karel Píška, but you cannot install it on those servers by yourself.

There are fonts on the Internet, but you need to grab, install and use them, see a list of them. If you are a Microsoft Windows user, use Arial Unicode MS, if you are a Linux user, install ttf-indic-fonts package (8 fonts). If nothing from these options is working for you on your local computer, use the Code2000 font as a starting point.

The only solution I see is to upload font file to the server's project (in the same way as uploading pictures) and use ExternalLocation from the fontspec package (untested). Uploading files is possible in TeXonWeb project, http://tex.mendelu.cz/en/. It is similar project to the ShareLaTeX.

Edit 1: I am uploading TAMu_Kadampari.ttf file from Linux distribution (ttf-indic-fonts) as my testing font sample. I haven't found solution in ShareLaTeX (I am not able to switch to xelatex/lualatex from pdflatex, so installing a font is almost impossible there, but uploading files is possible - I wrote an email to the maintainers if they could improve it), but after registration this approach works in WriteLaTeX, http://www.writelatex.com/, and TeXonWeb, http://tex.mendelu.cz/en/. I enclose several screenshots, the first picture is taken from ShareLaTeX (not working), the second picture is taken from WriteLaTeX (working) and the last one is from TeXonWeb project (it is working in Czech version, in English version we cannot switch the engine to xelatex right now - I have notified the author of this project).

Edit 2: It is working in ShareLaTeX as well. We need to switch to the project settings in the left tool bar, return to code and recompile the document. I illustrate it with two screenshots.

Screenshots from Edit 1:

Solution for local computer: On a local computer this task is rather easy as already mentioned by David Carlisle. Use polyglossia and run the xelatex engine. I enclose my example and a preview of it.

%! xelatex mal-tamil.tex
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{tamil}
\setotherlanguage{english}
\usepackage{fontspec}
% http://www.wazu.jp/gallery/Fonts_Tamil.html
% Linux (ttf-indic-fonts):
%    TAMu_Kalyani.ttf
%    TSCu_Comic.ttf
%    TSCu_Paranar.ttf
%    TSCu_paranarb.ttf
%    TSCu_paranari.ttf
%    TSCu_Times.ttf
% Microsoft Windows: Arial Unicode MS
%    http://web.archive.org/web/20101122142710/http://code2000.net/code2000_page.htm
\begin{document}
\selectlanguage{english}
\title{Tirukkural}
\date{April 14, 2014}
\maketitle
\thispagestyle{empty}
\selectlanguage{tamil}
அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு
\end{document}


You will I think find that it is much easier to use xelatex and fontspec rather than pdflatex and inputenc package. This is apparently supported on sharelatex.

Running xelatex locally I get

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Vijaya}% or any system font that has this script

\title{Tirukkural}
\date{April 2014}
\begin{document}
\maketitle

அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு

\end{document}


Note that this gives access to the script, you may still want to use a language package such as polyglossia so that the generated strings such as the date come out in Tamil rather than English.

(I hope that date is right: I can't read it:-)

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Vijaya}% or any system font that has this script

\usepackage{polyglossia}
\setdefaultlanguage{tamil}

\title{Tirukkural}
%\date{April 2014}
\begin{document}
\maketitle

அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு

\end{document}
`
• Thanks @david-carlisle! Your answer got me close, but the uploading the font into the server's project file as suggested @Malipivo solved the issue. – soosap Apr 14 '14 at 16:49
• @Prasath glad you got it working yes the other answer addresses the server versions so you should accept that:-) – David Carlisle Apr 14 '14 at 17:05