# Writing in தமிழ் (Tamil)

I see from this answer in tex.stackexchange that to write in Tamil I need to use XeLaTeX to compile the document.

But my case is a bit different. I am writing my thesis and my references come from BibTeX. At the moment I am using TexMaker to compile my document via

PdfLaTeX + Bib(la)tex + PdfLaTex(x2) + View Pdf


I see that there exists an option for XeLaTex, but this is without Bib(la)tex for my reference.

I just need to write one sentence in Tamil in the entire document, is there an easy solution to this?

• Depends a bit on the length of the sentence. I would probably create a graphic and include it. – Ulrike Fischer Sep 23 '16 at 10:26
• @UlrikeFischer: That is exactly what I was thinking about! But I also need to add words in English in between the sentence. Can you provide a minimal example so that the graphic looks as though it has been typed? – Srivatsan Sep 23 '16 at 10:27
• Is there a reason why could not use XeLaTeX instead? – wilx Sep 23 '16 at 11:07
• Oh, never mind, you only need one sentence... – wilx Sep 23 '16 at 11:08
• @ThePredator Check the anwer here tex.stackexchange.com/questions/319/… It might help. – Tanvir Sep 23 '16 at 12:25

Following Ulrike's suggestion, and my code at create latex symbol from vector graphics. To get phrase1.jpg, I just cropped the title to this page. To get phrase2.jpg, I cropped phrase1, so as to demonstrate the method when the descenders are different for each phrase (only change is the \raisebox argument).

The scalerel approach adopted will scale the graphics to the height of a letter X, regardless of the current font size.

\documentclass{article}
\fboxsep=-\fboxrule
\usepackage{scalerel}
\def\phraseA{\scalerel*{%
\setbox0=\hbox{\raisebox{-9pt}{\includegraphics{phrase1}}}\dp0=0pt\box0}{X}}
\def\phraseB{\scalerel*{%
\setbox0=\hbox{\raisebox{-2pt}{\includegraphics{phrase2}}}\dp0=0pt\box0}{X}}
\begin{document}
Can I insert my \phraseA{} inline along with \phraseB?

\tiny Can I insert my \phraseA{} inline along with \phraseB?

The original images:\fboxsep=1pt\relax
\fbox{\includegraphics{phrase1}} and \fbox{\includegraphics{phrase2}}
\end{document}


If, instead of cropping jpgs with different top/bottom cut lines, you use Xelatex to to create a standalone PDF of \strut<Tamil word or phrase> with minimal margin, then each implementation of of \phraseX will use the identical \raisebox parameters. Furthermore, the image, deriving from a vector graphic PDF, should scale without pixelation.

• possibly just need \includegraphics[height=1ex]{phrase2} using a non-dependent length and skipping the measuring. – David Carlisle Sep 23 '16 at 11:58
• @DavidCarlisle Maybe so...but in that case, \includegraphics is doing the measuring and scaling, rather than scalerel. There is still the issue of descenders. – Steven B. Segletes Sep 23 '16 at 12:03
• Shouldn't it be \phraseB{} ?? – Srivatsan Sep 23 '16 at 12:23
• @ThePredator One only need follow it with a {} if a space needs to be preserved afterwards. In this case, since a ? immediately follows, the {} can be dispensed with. – Steven B. Segletes Sep 23 '16 at 12:26
• @ThePredator Two choices: 1) crop the images tighter so there is no white zone above the top/below the bottom of the text images; or 2) Instead of using {X} as the second argument of the scalerel* macro, use something taller, such as {\rule{0pt}{\ht\strutbox}}. If you go taller than \ht\strutbox, it will affect the line spacing unless you \smash the result. – Steven B. Segletes Sep 23 '16 at 12:44