7

I am trying to typeset texts with numbered, non-titled chapters with latex and want the chapter number always large in the text. I have used lettrine in latin script text successfully, but I get horrible text overlaps in Arabic script. This is what I do.

    \documentclass{article}
    \usepackage{polyglossia}
    \usepackage{lettrine}
    \title{(My title)}
    \date{}

    \setmainlanguage{english}
    \setotherlanguage{farsi}
    \newfontfamily\englishfont{Gentium}
    \newfontfamily\farsifont[Script=Arabic,Scale=1.3,Ligatures=TeX,Mapping=arabicdigits]{Nazli}


    \begin{document}
    \maketitle
    \begin{farsi}


    \lettrine[lines=3]{1}{ }    تقدیم به عالیجناب تئوفیلوس:

تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند
     \end{farsi}
     \end{document}

Any useful suggestions?

  • 1
    Can you please post a Minimal Working Example? You are more likely to get useful answers if people can reproduce the problem you're having easily. Basically, show us just enough code for us to be able to compile your example and see the problem you're having. Then people will try to adapt it and post back modified versions which may resolve the problem. – cfr Jan 2 '14 at 20:56
  • @cfr \documentclass{article} \usepackage{polyglossia} \usepackage{lettrine} \title{(My title)} \date{} \setmainlanguage{english} \setotherlanguage{farsi} \newfontfamily\englishfont{Gentium} \newfontfamily\farsifont[Script=Arabic,Scale=1.3,Ligatures=TeX,Mapping=arabicdigits]{Nazli} \begin{document} \maketitle \begin{farsi} \lettrine[lines=3]{1}{ } تقدیم به عالیجناب تئوفیلوس: تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند \end{farsi} \end{document}` – peter Jan 2 '14 at 21:06
  • I can't reproduce as I don't have that font but hopefully somebody else does. – cfr Jan 2 '14 at 21:13
  • The font can bew replaced with another - Scheerazadeh does the same. scripts.sil.org/cms/scripts/page.php?item_id=Scheherazade – peter Jan 2 '14 at 21:18
  • In principle, the bidi package is aware of lettrine, since it patches it, but I'm not sure why it's not working. – Alan Munn Jan 3 '14 at 5:24
1

I finally realised that switching the chapter number demonstrated the problem. (With a '1' it is much less obvious there is overlap between text and number. An '8' makes this clear.)

The problem, I think is that lettrine is designed to cope with a paragraph but the original code included a paragraph break after the first line. So subsequent lines did not get indented correctly. Using a line break rather than a paragraph break avoids this problem. I've set the chapter number in \englishfont but it works with \farsifont also.

\documentclass{article}
\usepackage{polyglossia}
\usepackage{lettrine}
\usepackage{fontspec}
\title{(My title)}
\date{}

\setmainlanguage{english}
\setotherlanguage{farsi}
\newfontfamily\englishfont{Gentium}
\newfontfamily\farsifont[Script=Arabic,Scale=1.3,Ligatures=TeX,Mapping=arabicdigits]{Scheherazade-R.ttf}
\renewcommand{\LettrineTextFont}{\farsifont}
\renewcommand{\LettrineFontHook}{\englishfont}

\begin{document}
\maketitle
\begin{farsi}

\lettrine[lines=3]{8}{ }    تقدیم به عالیجناب تئوفیلوس:\\
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند

\end{farsi}
\end{document}

This produces:

No idea what it means but I take it it is Farsi with dropped Arabic numberal as chapter number (or would be if this was a chapter)

  • This doesn't solve the problem, which is that with the Arabic font, the (Arabic) digit overlaps the text. – Alan Munn Jan 3 '14 at 5:22
  • @AlanMunn I said it was not intended as an answer. Just the problem was not at all clear to me until I changed the chapter number which made the overlap obvious. – cfr Jan 3 '14 at 17:01
  • You're welcome. It was interesting working with a script so different, even if it was incomprehensible to me. So that was intriguing but then I kind of liked the fact that the problem turned out to have nothing to do with its being Arabic script at all! – cfr Jan 7 '14 at 22:51
  • @peter Unlike Hasan Zakeri, I don't know anything about typesetting Persian as such - I am just somewhat fascinated by fonts in general. (Which is why my answer just answered the question - I'm in no position to advise anybody on formatting Persian!) – cfr Jan 7 '14 at 22:57
5

First of all, if you are typesetting in Persian, you should totally consider using xepersian instead of polyglossia.

Second, using lettrine in non-latin scripts needs a special consideration: your font must have x character. Otherwise you will get a divide by zero error. You can see comments of Vafa Khalighi, author of bidi on this issue here in persian.

This example here typesets what you meant with xepersian, and with no problem.

\documentclass{article}
\usepackage{lettrine}
\usepackage{xepersian}   
\settextfont{XB Zar}
\begin{document}
\lettrine[lines=3]{1}{ }    تقدیم به عالیجناب تئوفیلوس:\\
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام             کردهاند
 تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند 
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند
\end{document}

lettrine with xepersian

Take note please, that you need at least 3 lines of text after \lettrine. Hence I copied your text multiple times.

Now if you insist on using polyglossia, here's a working example of \lettrine. The only modification is removing paragraph break to avoid merging dropped letter with the next paragraph.

\documentclass{article}
\usepackage{polyglossia}
\usepackage{lettrine}
\title{(My title)}
\date{}

\setmainlanguage{english}
\setotherlanguage{farsi}
\newfontfamily\englishfont{Gentium}
\newfontfamily\farsifont[Script=Arabic,Scale=1.3,Ligatures=TeX,Mapping=arabicdigits]{B Nazanin}{Nazli}


\begin{document}
\maketitle
\begin{farsi}


\lettrine[lines=3]{1}{ }    تقدیم به عالیجناب تئوفیلوس:\\
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام         کردهاند
\end{farsi}
\end{document}

lettrine with polyglossia

You may also want to define a chapter counter, and a \chapter control sequence to automate this:

\documentclass{article}
\usepackage{lettrine}
\usepackage{xepersian}   
\settextfont{XB Zar}
\newcounter{chapter}
\newcommand{\chapter}{%
    \vskip2em
    \stepcounter{chapter}%
    \lettrine[lines=3]{\arabic{chapter}}{}%
}
\begin{document}
\chapter
    تقدیم به عالیجناب تئوفیلوس:\\
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام    کردهاند 
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند 
تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام             کردهاند تا به حال نویسندگان بسیاری به نوشتن شرح وقایعی كه در بین ما رخ داده است، اقدام کردهاند
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.