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}
\newfontfamily\tamilfont[Script=Tamil,Scale=1.4]{TAMu_Kadampari.ttf}
% http://www.wazu.jp/gallery/Fonts_Tamil.html
% Linux (ttf-indic-fonts):
% TAMu_Kadampari.ttf
% TAMu_Kalyani.ttf
% TAMu_Maduram.ttf
% TSCu_Comic.ttf
% TSCu_Paranar.ttf
% TSCu_paranarb.ttf
% TSCu_paranari.ttf
% TSCu_Times.ttf
% Microsoft Windows: Arial Unicode MS
% After download: Code2000
% 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}