0

When I try to use the lettrine package in Hebrew (via Babel), I can't seem to get the text to properly wrap around the drop cap, which works fine in English. How can I get lettrine to work with Hebrew text?

MWE below

\documentclass{article}
\usepackage{fontspec}
\usepackage[nil,bidi=default]{babel}
\babelprovide[import=en-GB,main]{british}

\babelprovide[import=he]{hebrew}
\babelfont[hebrew]{rm}[
Renderer=HarfBuzz,
Scale = 1.2,
Mapping=arabicdigits
]{KeterYG-Medium}
\babeltags{hebrew=hebrew}
    %English, works
    \usepackage{lettrine}
\setcounter{DefaultLines}{2}
\renewcommand{\DefaultLraise}{0}
\begin{document}
\lettrine{W}{hereas} recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world. Whereas disregard and contempt for human rights have resulted in barbarous acts which have outraged the conscience of mankind, and the advent of a world in which human beings shall enjoy freedom of speech and belief and freedom from fear and want has been proclaimed as the highest aspiration of the common people,

\vspace{2em}


\begin{hebrew}
\lettrine{ה}{ואיל}%
 והכרה בכבוד הטבעי אשר לכל בני משפחת האדם ובזכויותיהם השוות והבלתי נפקעות הוא יסוד החופש, הצדק והשלום בעולם. הואיל והזלזול בזכויות האדם וביזוין הבשילו מעשים פראיים שפגעו קשה במצפונה של האנושות; ובנין עולם, שבו ייהנו כל יצורי אנוש מחירות הדיבור והאמונה ומן החירות מפחד וממחסור, הוכרז כראש שאיפותיו של כל אדם.

  
 
\end{hebrew}



\end{document}

1 Answer 1

1

Use \selectlanguage{hebrew} instead of \begin{hebrew}...\end{hebrew} (the latter does not change paragraph direction):

\documentclass{article}
\usepackage{fontspec}
\usepackage[nil,bidi=default]{babel}
\babelprovide[import=en-GB,main]{british}

\babelprovide[import=he]{hebrew}
\babelfont[hebrew]{rm}[
Renderer=HarfBuzz,
Scale = 1.2,
% Mapping=arabicdigits % LuaTeX does not support this
]{KeterYG-Medium}
\babeltags{hebrew=hebrew}
%English, works
\usepackage{lettrine}
\setcounter{DefaultLines}{2}
\renewcommand{\DefaultLraise}{0}
\AddToHook{cmd/lettrine/before}{\ifnum\pardirection=1\shapemode=3\fi}
\begin{document}
    \lettrine{W}{hereas} recognition of the inherent dignity and of the equal and inalienable rights of all members of the human family is the foundation of freedom, justice and peace in the world. Whereas disregard and contempt for human rights have resulted in barbarous acts which have outraged the conscience of mankind, and the advent of a world in which human beings shall enjoy freedom of speech and belief and freedom from fear and want has been proclaimed as the highest aspiration of the common people,
    
    \vspace{2em}
    
    
    \selectlanguage{hebrew}
        
        \lettrine[loversize=.4]{ה}{ואיל}
        והכרה בכבוד הטבעי אשר לכל בני משפחת האדם ובזכויותיהם השוות והבלתי נפקעות הוא יסוד החופש, הצדק והשלום בעולם. הואיל והזלזול בזכויות האדם וביזוין הבשילו מעשים פראיים שפגעו קשה במצפונה של האנושות; ובנין עולם, שבו ייהנו כל יצורי אנוש מחירות הדיבור והאמונה ומן החירות מפחד וממחסור, הוכרז כראש שאיפותיו של כל אדם.
    
\end{document}

Unrelated to the question, LuaTeX does not support input mapping.

3
  • In babel, \begin{otherlanguage}{hebrew} should be correct. The \begin{hebrew} command is a polyglossia command emulated imperfectly by \babeltags.
    – Davislor
    Commented May 16, 2023 at 3:57
  • And using \babeltags is discouraged, for the reasons explained in the manual. I shouldn't have included it. Commented May 16, 2023 at 17:57
  • Thank you! this is perfect
    – ezgranet
    Commented May 16, 2023 at 18:07

You must log in to answer this question.

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