0

Am I writing a short story, and I feel most comfortable writing with Latex than any rich-text editor. Yet for the first time I have to use two different languages in my story. French as the main language (my native one), and Tamil (since my story takes places in Tamil Nadu).

But I have an issue that only happens once when rendering my pdf: xetex rendering my pdf with a bunch of squares before the tamil text

And the next time I use tamil everything is fine, I don't have any error compiling my project.

I configured my babel as such

\usepackage[french]{babel}

\babelprovide[
    main,
    import,
    language = Default]
    {french}
\babelprovide[import]{tamil}
\defaultfontfeatures{Scale=MatchLowercase}
\babelfont[*tamil]{rm}{Lohit Tamil}
\renewcommand{\FBthinspace}{\FBcolonspace}

My configuration file is way longer, but I only put the babel part, since most of the rest is from a template.

Also I'm using XeTeX, it seems to work fine with luatex, but I have a timeout when trying to compile with luatex on Overleaf

EDIT: I have a very dirty solution: I added \phantom{\foreignlanguage{tamil}{தாலுகா}} to correct the glitch of the first occurence, don't know why it happens only on first occurence though, but thank you all for your replies

7
  • 1
    .Welcome to tex.sx Commented Sep 5 at 0:19
  • The font probably does not have some of the glyphs. Can you post what you typed to get the image you posted?
    – yannisl
    Commented Sep 5 at 2:44
  • don't use \babelprovide for languages which have an ldf unless you really know what you are doing. as I understand it, it is meant for cases where a full language definition isn't available. maybe that's the case for Tamil, but it surely isn't for French.
    – cfr
    Commented Sep 5 at 4:18
  • @yannis! : I typed this : தாலுகா, in the file it looks like this : \foreignlanguage{tamil}{தாலுகா}
    – Adr4m
    Commented Sep 5 at 10:51
  • @cfr It is indeed not necessary for french thank you
    – Adr4m
    Commented Sep 5 at 10:52

1 Answer 1

0

This file seems to compile fine both with XeTeX and LuaTeX engines (after copying the font Lohit-Tamil.ttf in the local directory):

\documentclass[a4paper,french]{article}
\usepackage{fontspec}
\usepackage{babel}
\frenchsetup{ThinColonSpace}
\babelprovide[import]{tamil}
\defaultfontfeatures{Scale=MatchLowercase}
\babelfont[*tamil]{rm}{Lohit Tamil}

\begin{document}

Du texte en français: oui!

\begin{otherlanguage}{tamil}
தமிழ்
\end{otherlanguage}
\end{document}

enter image description here

2
  • Yet, when I use \foreignlanguage{tamil}{தாலுகா}} I have this weird glitch, but only the first time I use it, I will try to come up with a solution to make it work on my project with XeTeX. I quite don't understand why it seems that only my project has this glitch. I will also try to use otherlanguage environment to be sure thank you
    – Adr4m
    Commented Sep 5 at 10:54
  • First, you have a spurious closing brace at the end of your \foreignlanguage command. Second, inserting your \foreignlanguage command (without the last brace) instead of my otherlanguage environment works perfectly with XeLaTeX and LuaLaTeX on my system. The culprit is probably somewhere else in your template. Commented Sep 5 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .