1

Using polyglossia or babel/bidi with LuaLatex seems to cause different problems. In my case I am totally helpless. I need to use the \texthebrew and \RL commands, but I can't get it run.

Also, I don't know why, I can't change the babel-main-language from englishto ngerman.

Any kind of help would be very much appreciated!

The full header is quite complex:

% arara: lualatex
% arara: makeglossaries
% arara: lualatex
% arara: biber
% arara: biber
% arara: lualatex
% arara: lualatex
% arara: lualatex
% arara: biber
% arara: lualatex
% arara: lualatex

\documentclass[10pt,twoside]{scrbook}
\KOMAoptions
  {
    fontsize=10pt,
    paper=24cm:16cm,
    pagesize=pdftex,
    DIV=calc,
  }


 \usepackage{leading}
  \leading{12pt}




  \usepackage[%%%text={12cm,17.8cm},
paperwidth=17cm,
paperheight=23cm,
    top=1.6cm,%%%3.45cm,
    bottom=3.45cm,%%%8.04cm,
    inner=2.7cm,%%%4.15cm,
    outer=2.3cm,%%%4.85cm,
   %%% marginparsep=7mm,
    %%%marginparwidth=48mm,
  ]{geometry} %%% Seitenlayout 

%%\usepackage[onehalfspacing]{setspace}

%%\usepackage[bmargin=2.25cm]{geometry}


%%zwei Bilder nebeneinander
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

%%\setheadsepline{0.4pt}
\setkomafont{pageheadfoot}{\normalfont\normalcolor\small}\setkomafont{pagenumber}{\normalfont}

%Formatierung der Kopfzeilen:
\addtokomafont{pagehead}{\normalfont}


\setkomafont{disposition}{\normalcolor\bfseries} %Schrift in Überschriften, Inhaltsverzeichnis

\clubpenalty=10000
\widowpenalty=10000
\widowpenalty10000
\displaywidowpenalty=10000


\usepackage[parfill]{parskip}
\usepackage[series={A,B,C}]{reledmac}
\usepackage{reledpar}


\makeatletter
%%\renewcommand*{\bodyfootmarkA}{%
%%  \hbox{\normalfont\@nameuse{@thefnmarkA}}%
%%}
\renewcommand*{\footfootmarkA}{%
  \@nameuse{@thefnmarkA}%
}
%%\renewcommand*{\bodyfootmarkB}{%
 %% \hbox{\normalfont\@nameuse{@thefnmarkB}}%
%%}
\renewcommand*{\footfootmarkB}{%
  \@nameuse{@thefnmarkB}%
}

\hangindentX{0.8em}
%%\Xhangindent{0.8em}


\makeatother

\usepackage{hyperref}
\usepackage{epigraph} %für Zitate

\usepackage{tipa} %%für IPA-Zeichen
%%%\Xendnumberonlyfirstinline

\Xendbeforepagenumber{S.\,}
\Xendafterpagenumber{:\,}
\Xendlineprefixsingle{Z.\,}


\setgoalfraction{0.85}

\usepackage{url}
\urlstyle{same}

\lineation{section}
\linenummargin{left}%%right für Zeilennummern rechts
%\setRlineflag{}


\usepackage{pdflscape} %%Querformatiges Bild

\linenumincrement*{5}
\firstlinenum*{0} %Zahl hochsetzen, um Titelei unnummeriert zu haben

\maxchunks{10000}

\usepackage{tabularx}

\usepackage{color}
\usepackage{multicol,multirow, bigdelim}%%times RAUS

 \usepackage{textcomp} %für \dag



\usepackage{amsmath}


\usepackage{fontspec}


%%MWE\usepackage{polyglossia, xunicode}
%%MWE \usepackage{libertine}


\usepackage[ngerman,bidi=basic]{babel} 
\babelprovide[import,language=Default]{hebrew}

\babelfont{rm}[Language=Default,Ligatures=TeX]{Linux Libertine O}
\babelfont[hebrew]{rm}{EzraSIL}

\usepackage[xindy={language=hebrew,glsnumbers=false},counter=pageline,nosuper,nolong]{glossaries}


\glsSetCompositor{-}% Use - as separator
\pretocmd{\gls}{\doedindexlabel}{}{}% Call \doedindexlabel at the begining of \gls

\makeglossaries

\newglossarystyle{germanhebrew}
{% base it on the tree style:
  \setglossarystyle{tree}%
  % switch to german
  \renewenvironment{theglossary}%
    {\setlength{\parindent}{0pt}%
     \setlength{\parskip}{0pt plus 0.3pt}%
     \begin{german}
    }%
    {\end{german}}%
  \renewcommand{\glossentry}[2]{%
    \hangindent0pt\relax
    \parindent0pt\relax
    \glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{%
      \texthebrew{\glossentryname{##1}}}}%
    \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}%
    \glstreepredesc\glossentrydesc{##1}\glspostdescription\space##2\par
  }%
}

%addsubsection definiert
\makeatletter
\newcommand*\addsubsec{\secdef\@addsubsec\@saddsubsec}
\newcommand*{\@addsubsec}{}
\def\@addsubsec[#1]#2{\subsection*{#2}\addcontentsline{toc}{subsection}{#1}
  \if@twoside\ifx\@mkboth\markboth\markright{#1}\fi\fi
}
\newcommand*{\@saddsubsec}[1]{\subsection*{#1}\@mkboth{}{}}
\makeatother


\input{glossaries.tex}


%%Header Neu
\usepackage[automark]{scrlayer-scrpage}

\DeclareNewLayer[
  oddpage,
  rightmargin,
  height=1in+\voffset+\topmargin+\headheight,
  contents={\usekomafont{pageheadfoot}\usekomafont{pagehead}%
    \vfill%
    \hspace{\marginparsep}\pagemark\hfill%
  }
]{pagenumber.odd}

\DeclareNewLayer[
  evenpage,
  leftmargin,
  height=1in+\voffset+\topmargin+\headheight,
  contents={\usekomafont{pageheadfoot}\usekomafont{pagehead}%
    \vfill% 
    \hfill\pagemark\hspace{\marginparsep}%
  }
]{pagenumber.even}

\AddLayersToPageStyle{scrheadings}{pagenumber.odd, pagenumber.even}

\clearscrheadfoot
\chead{\headmark}
\automark[section]{chapter}
\renewcommand*{\sectionmarkformat}{}
\renewcommand*{\chaptermarkformat}{}




%HAMSA für Schirm
\newcommand{\dotplus}{\includegraphics[width=0.07in]{images/trefoil.png}}






\newcommand\einzugjid{\hangindent=5mm\hangafter=1}

\newcommand\speaker[1]{\noindent{\textdir TLT #1} \einzugjid}

\newcommand\einzug{\hangindent=5mm\hangafter=1}

\newcommand\speakerd[1]{\noindent
{\textsc{#1}} \einzug
}


\usepackage[normalem]{ulem}

\usepackage[german=guillemets]{csquotes}


\newcommand{\rot}[1]{{\color{red} #1}}
\newcommand{\hai}[1]{\textsf{#1}} %für Text in Arial
\newcommand{\qu}[1]{»#1«} % >> <<
\newcommand{\quji}[1]{»#1«} %jiddische (dt.) Anführungszeichen
\newcommand{\quein}[1]{›#1‹} %einfache > <
\newcommand{\quf}[1]{\frqq#1\flqq} %franz. Anführungszeichen
\newcommand{\qufs}[1]{\frq#1\flq} %einfache franz. Anführungszeichen
\newcommand{\sem}[1]{›#1‹} %‘#1' 69er anführungszeichen Bedeutungsangabe





\usepackage[style=authoryear,language=ngerman]{biblatex} \bibliography{LitGrobsdorfEdition}
\renewcommand*{\postnotedelim}{\addcolon\,}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}



\deffootnote[\normalparindent]
            {0em}
            {\normalparindent}
            {\thefootnotemark\ \,}
\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}


\deffootnote{1em}{1em}{\thefootnotemark\ \,} %%neu aus Ricarda-Diss


\wrapcontentX[A]{\texthebrew}
\makeatletter
\renewcommand{\footnoteruleA}{\right@footnoterule}
\makeatother



\usepackage{gb4e}
\noautomath

A M(not)WE:

% arara: lualatex



\documentclass[10pt,twoside]{scrbook}
\KOMAoptions
  {
    fontsize=10pt,
    paper=24cm:16cm,
    pagesize=pdftex,
    DIV=calc,
  }

\usepackage[parfill]{parskip}
\usepackage[series={A,B,C}]{reledmac}
\usepackage{reledpar}

\usepackage{fontspec}

\usepackage[english,bidi=basic]{babel} 
\babelprovide[import,main]{hebrew}

\babelfont{rm}[Language=Default,Ligatures=TeX]{Linux Libertine O}
\babelfont[hebrew]{rm}{Linux Libertine O}

\newcommand\einzugjid{\hangindent=5mm\hangafter=1}

\newcommand\speaker[1]{\noindent{\textdir TLT #1} \einzugjid}

\newcommand\einzug{\hangindent=5mm\hangafter=1}

\newcommand\speakerd[1]{\noindent
{\textsc{#1}} \einzug
}


\begin{document}


\begin{pages}
\begin{Leftside} \selectlanguage{hebrew}
\beginnumbering

\pstart  {\texthebrew{\speaker{יוקב.}
  דאַס זינגט דער באָססע מעכער.}}
  \pend

\pstart   {\texthebrew{\speaker{בויער.}
 וואָהס טויט דאַן דער רעבינער?}}
 \pend

\endnumbering
\end{Leftside}


\begin{Rightside}
\selectlanguage{english}
\beginnumbering

\pstart \speakerd{First.} Lorem Ipsum dolor sit amed? Lorem Ipsum dolor sit amed!  \pend

\pstart \speakerd{Second.} Lorem Ipsum dolor sit amed. \pend
\endnumbering

\end{Rightside}
\end{pages}
\Pages

\end{document}

(BTW: It looks like I am forced to use LuaLatex, with Xelatex everything would be no problem; so please avoid solutions going in this direction)

  • To define \texthebrew you can use \babeltags{hebrew=hebrew}. But in your example the use doesn't make sense, as the speaker command resets the textdir to TLT (left-to-right). – Ulrike Fischer Mar 20 at 12:54
3

babel does not provide a \texthebrew command (although you can create one with \babeltags). Instead you select inline Hebrew with \foreignlanguage{hebrew}{…}. But you don't actually need this in your example because you are dealing with whole blocks of Hebrew that start with \selectlanguage{hebrew}.

babel takes care of text direction for you, so you don't need to explicitly set it with \textdir TLT.

To change the main language to ngerman you can include ngerman as an option to babel and remove main in the \babelprovide options for hebrew:

\usepackage[ngerman,bidi=basic]{babel} 
\babelprovide[import]{hebrew}

In your example you don't need to explicitly define a Hebrew font because your main font of Linux Libertine O supports Hebrew already. You can suppress a fontspec warning be setting the language of Hebrew text to Default instead of Hebrew with \babelprovide[import,language=Default]{hebrew}.

You don't have to explicitly load fontspec as babel does it automatically when you use \babelfont.

Full MWE

I tidied up the code a bit too.

\documentclass[10pt,twoside]{scrbook}
\KOMAoptions
  {
    fontsize=10pt,
    paper=24cm:16cm,
    pagesize=pdftex,
    DIV=calc,
  }

\usepackage[parfill]{parskip}
\usepackage[series={A,B,C}]{reledmac}
\usepackage{reledpar}

\usepackage[ngerman,bidi=basic]{babel} 
\babelprovide[import,language=Default]{hebrew}

\babelfont{rm}[Ligatures=TeX]{Linux Libertine O}

\newcommand\einzugjid{\hangindent=5mm\hangafter=1}
\newcommand\speaker[1]{\noindent #1\einzugjid}
\newcommand\einzug{\hangindent=5mm\hangafter=1}
\newcommand\speakerd[1]{\noindent\textsc{#1}\einzug}

\begin{document}

\begin{pages}

  \begin{Leftside}
    \selectlanguage{hebrew}
    \beginnumbering

    \pstart
    \speaker{יוקב.}
    דאַס זינגט דער באָססע מעכער.
    \pend

    \pstart
    \speaker{בויער.}
    וואָהס טויט דאַן דער רעבינער?
    \pend

    \endnumbering
  \end{Leftside}

  \begin{Rightside}
    \selectlanguage{ngerman}
    \beginnumbering

    \pstart
    \speakerd{First.}
    Lorem Ipsum dolor sit amed? Lorem Ipsum dolor sit amed!
    \pend

    \pstart
    \speakerd{Second.} Lorem Ipsum dolor sit amed.
    \pend

    \endnumbering
  \end{Rightside}

\end{pages}

\Pages

\end{document}
  • thank you very much! But my example was too minimal: I do have a special hebrew font \babelfont[hebrew]{rm}{EzraSIL} that creates now the error: LaTeX Font Warning: Font shape TU/EzraSIL(0)/bx/n' undefined (Font) using TU/EzraSIL(0)/m/n' instead on input line 6. – לאה פּאַסטעך Mar 20 at 14:58
  • @לאהפּאַסטעך, it's just a warning not an error. \babelfont is requesting a slanted shape for Ezra SIL, but this shape does not exist, so the default upright font is substituted. As far as I can see you are not using a slanted (or italic) shape for Hebrew in your document, so you can ignore this warning. You can also suppress the error be more precisely defining the font or using a font which also has a slanted variant. You have defined the Hebrew font correctly though and it should be using Ezra SIL. – David Purton Mar 20 at 22:17
  • Thank you David! The problem is: i am on the verge of publication and the document is relatively old (i am glad that it still compiles at all). The problem here is that I had to switch to lualatex: tex.stackexchange.com/questions/477875/… I'm afraid it won't be possible anymore to change everything to LUALATEX and I'll have to live with the fact that the moves aren't nice. – לאה פּאַסטעך Mar 20 at 22:29
  • @לאהפּאַסטעך, you can use \babelfont[hebrew]{rm}[SlantedFont = Ezra SIL]{Ezra SIL}. This will suppress the warning. – David Purton Mar 20 at 22:30

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.