这个问题是这个问题,询问如何对所有注释进行对齐。该解决方案适用于对齐\gla
、\glb
和,\glc
但对无效\glft
。问题显然是因为默认语言是希伯来语\setdefaultlanguage{hebrew}
,但我不知道如何解决这个问题。
梅威瑟:
\documentclass{book}
\usepackage{ragged2e}
\usepackage{expex}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{FrankRuehl}
\newfontfamily\englishfont{Corbel}
\begin{document}
\lingset{
everygla=\Large,
everyglb=\footnotesize\englishfont,
everyglc=\footnotesize\englishfont,
everyglft=\small,
glftpos=right,
glwordalign=center,
glhangindent=0em,
}
\definelingstyle{justified}{
glrightskip=0pt,glspace=0.5em plus 3em minus 0.15em,
everyglft=\justifying\noindent
}
\exdisplay[lingstyle=justified]
\begingl
\gla אאאא בבגגגגב גגגג דדדדדדדד אאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדד אאאאאאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדדדדדד אאאאאאא בבבב גגגג דדדד אאאא בבגגגגבב גגגג דדדדדד //
\glb aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //
\glc aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //
\glft
\textenglish{Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation. Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation.} //
\endgl
\xe
\end{document}
如您所见,希伯来语注释对齐得很好,但英语自由翻译却左边不整齐,即使在完全英语的环境中它也是完全对齐的。
答案1
\glft
当示例使用 RTL 语言时,我尝试了很多方法来实现对齐(无论是通过文档的默认语言还是\begin{hebrew}...\end{hebrew}
围绕示例的环境),但都没有成功。我还尝试过按照手册第 12.3 节中的代码将其放在侧面板中expex
,但这也无济于事。
我的建议是使用paracol
包而不是expex
包本身将你的翻译拆分到第二列。这样你的翻译列就不会受到expex
任何限制。
在下面的示例中,我创建了interlinear
和translation
环境,它们包含了paracol
、expex
和常规格式的命令,以便您的代码更简单。我没有 FrankRuehl,所以我改用 Ezra SIL 作为希伯来语字体。
\documentclass{book}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
\newfontfamily\englishfont{Corbel}
\usepackage{microtype} % for better automatic spacing in the narrow justified column
\usepackage{expex}
\lingset{
everygla=\Large,
everyglb=\footnotesize\englishfont,
everyglc=\footnotesize\englishfont,
glwordalign=center,
glhangindent=0em,
glrightskip=0pt,
glspace=0.5em plus 3em minus 0.15em,
}
\usepackage{paracol}
\newenvironment{interlinear}%
{\begin{leftcolumn*}\begin{hebrew}\exdisplay\begingl}%
{\endgl\xe\end{hebrew}\end{leftcolumn*}}
\newenvironment{translation}%
{\begin{rightcolumn}\small\noindent\ignorespaces}%
{\end{rightcolumn}}
\begin{document}
% \columnratio{0.6} % 0.6 is the default value for expex's ssratio, so if you want that ratio, uncomment this and adjust as needed
% \setlength{\columnsep}{3em} % this is the default value for expex's sssep, so if you want that amount of column separation, uncomment this and adjust as needed
\begin{paracol}{2}
\begin{interlinear}
\gla אאאא בבגגגגב גגגג דדדדדדדד אאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדד אאאאאאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדדדדדד אאאאאאא בבבב גגגג דדדד אאאא בבגגגגבב גגגג דדדדדד //
\glb aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //
\glc aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //
\end{interlinear}
\begin{translation}
Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation. Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation.
\end{translation}
\end{paracol}
\end{document}