完整 MWE

完整 MWE

将 polyglossia 或 babel/bidi 与 LuaLatex 结合使用似乎会导致不同的问题。就我而言,我完全无能为力。我需要使用\texthebrew\RL命令,但我无法运行它。

另外,我不知道为什么我无法将 babel-main-language 从 更改englishngerman

任何形式的帮助都将非常感激!

完整的标头相当复杂:

% 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

是(不是)我们:

% 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}

(顺便说一句:看起来我被迫使用 LuaLatex,使用 Xelatex 一切都没有问题;所以请避免朝这个方向解决)

答案1

babel不提供\texthebrew命令(尽管您可以使用 创建一个命令\babeltags)。相反,您可以使用 选择内联希伯来语\foreignlanguage{hebrew}{…}。但您实际上不需要在您的示例中这样做,因为您正在处理以 开头的整个希伯来语块\selectlanguage{hebrew}

babel为您处理文本方向,因此您不需要使用 明确设置它\textdir TLT

要将主要语言更改为,ngerman您可以将其ngerman作为选项包含在内并在选项中babel删除:main\babelprovidehebrew

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

在您的示例中,您不需要明确定义希伯来语字体,因为您的 Linux Libertine O 主字体已经支持希伯来语。您可以fontspec通过将希伯来语文本的语言设置为默认而不是希伯来语来隐藏警告\babelprovide[import,language=Default]{hebrew}

您不必明确加载,fontspec因为babel当您使用时它会自动加载\babelfont

完整 MWE

我也整理了一下代码。

\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}

相关内容