我已经设置了一种布局,其中一列paracol
是expex
注释,另一列是常规文本。
在下面的 MWE 的分页符中,您可以看到常规文本列与注释不对齐。我甚至strut
为最后一段添加并调整了一个特殊功能,但无济于事(如果您调整支柱,使常规文本移到下一页,那么它就无法正确对齐)。大多数情况下,注释分页符工作正常,但像这样的特殊情况在较长的文档中经常发生。
如何调整代码以实现正确的对齐,即使这种情况发生在文档中间的分页符处?
注意:您必须使用最新的 expex
glbreaking
使该功能可以正常运行的软件包。
MWE(XeTeX):
\documentclass{book}
\usepackage{microtype}
\usepackage[
paperwidth=7.5in,
paperheight=9.25in,
inner=0.5in,
outer=0.5in,
bindingoffset=0.25in,
top=0.75in,
bottom=1.25in,
twoside,
%showframe
]
{geometry}
\usepackage{paracol}
\twosided[pc]
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{Arial}
\newfontfamily\englishfont{Linux Libertine O}
\usepackage{expex}
\lingset{
everygla=\Large,
everyglb=\scriptsize\englishfont\it,
everyglc=\scriptsize\englishfont,
glwordalign=center,
glhangindent=0em,
glrightskip=0pt,
glhangstyle=none,
aboveglbskip=-0.7ex,
aboveglcskip=-0.7ex,
glbreaking
}
\columnratio{0.71}
\setlength{\columnsep}{1.0em}
\newenvironment{interlinearfirst}%
{\begin{leftcolumn*}\begin{hebrew}\mystrutfirsta\sloppy\begingl}%
{\endgl\end{hebrew}\end{leftcolumn*}}
\newenvironment{translationfirst}%
{\begin{rightcolumn}
\footnotesize\noindent\ignorespaces\mystrutfirstb\sloppy}
{\end{rightcolumn}}
\newcommand{\mystrutfirsta}{\rule{0pt}{0pt}}
\newcommand{\mystrutfirstb}{\rule{0pt}{22pt}}
\newenvironment{interlinear}%
{\begin{leftcolumn*}\begin{hebrew}\mystruta\sloppy\begingl}%
{\endgl\end{hebrew}\end{leftcolumn*}}
\newenvironment{translation}%
{\begin{rightcolumn}
\footnotesize\noindent\ignorespaces\mystrutb\sloppy}
{\end{rightcolumn}}
\newcommand{\mystruta}{\rule{0pt}{0pt}}
\newcommand{\mystrutb}{\rule{0pt}{12pt}}
\newenvironment{interlinearspecial}%
{\begin{leftcolumn*}\begin{hebrew}\mystrutc\sloppy\begingl}%
{\endgl\end{hebrew}\end{leftcolumn*}}
\newenvironment{translationspecial}%
{\begin{rightcolumn}
\footnotesize\noindent\ignorespaces\mystrutd\sloppy}
{\end{rightcolumn}}
\newcommand{\mystrutc}{\rule{0pt}{0pt}}
\newcommand{\mystrutd}{\rule{0pt}{13pt}}%adjust this strut for the last paragraph
\begin{document}
\begin{paracol}{2}
\begin{interlinearfirst}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinearfirst}
\begin{translationfirst}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translationfirst}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinearspecial}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinearspecial}
\begin{translationspecial}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translationspecial}
\end{paracol}
\end{document}
答案1
以下是半自动化解决方案。该paracol
包提供了一个\flushpage
命令来清除结束并行对并开始新的页面。
\strut
这与您添加的一起{translationspecial}
将再次正确对齐平行列。(我认为对齐问题是由于paracol
非 ExPex 造成的)。
虽然不是完全自动化的,但我让事情变得简单一些,这样您就不需要special
环境的版本了。相反,我创建了一个\flushtrans
命令,它发出\flushpage
命令,然后设置条件以触发使用正确大小的\strut
命令。
因此,每当您遇到故障时,请\flushtrans
在相关{interlinear}
环境之前发出命令,其余的事情就会自动发生。
translationfirst
我们可以使用相同的技术来消除对环境的需求interlinearfirst
。相反,我添加了第二个条件,该条件设置在环境的开头paracol
。这将在环境内部使用translation
以使用正确的 strut。
\documentclass{book}
\usepackage{microtype}
\usepackage[
paperwidth=7.5in,
paperheight=9.25in,
inner=0.5in,
outer=0.5in,
bindingoffset=0.25in,
top=0.75in,
bottom=1.25in,
twoside,
showframe
]
{geometry}
\usepackage{paracol}
\twosided[pc]
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\englishfont{Linux Libertine O}
\usepackage{expex}
\lingset{
everygla=\Large,
everyglb=\scriptsize\englishfont\it,
everyglc=\scriptsize\englishfont,
glwordalign=center,
glhangindent=0em,
glrightskip=0pt,
glhangstyle=none,
aboveglbskip=-0.7ex,
aboveglcskip=-0.7ex,
glbreaking
}
\columnratio{0.71}
\setlength{\columnsep}{1.0em}
\newif\iftranslationspecial
\newif\iffirst
\newcommand\flushtrans{\flushpage\translationspecialtrue}
\AtBeginEnvironment{paracol}{\firsttrue}
\newcommand{\mystrutfirsta}{\rule{0pt}{0pt}}
\newcommand{\mystrutfirstb}{\rule{0pt}{22pt}}
\newenvironment{interlinear}%
{\begin{leftcolumn*}\begin{hebrew}\mystruta\sloppy\begingl}%
{\endgl\end{hebrew}\end{leftcolumn*}}
\newenvironment{translation}%
{\begin{rightcolumn}
\footnotesize\noindent\ignorespaces\iffirst\mystrutfirstb\else\iftranslationspecial\mystrutd\else\mystrutb\fi\fi\sloppy}
{\end{rightcolumn}\global\translationspecialfalse\global\firstfalse}
\newcommand{\mystruta}{\rule{0pt}{0pt}}
\newcommand{\mystrutb}{\rule{0pt}{12pt}}
\newcommand{\mystrutc}{\rule{0pt}{0pt}}
\newcommand{\mystrutd}{\rule{0pt}{20pt}}%adjust this strut for the last paragraph
\begin{document}
\begin{paracol}{2}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\flushtrans % added this
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\begin{interlinear}
\gla אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד אאאאא בבבבב גגגגג דדדדד //
\glb aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\glc aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd aaaaa bbbbb ggggg ddddd //
\end{interlinear}
\begin{translation}%
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.
\end{translation}
\end{paracol}
\end{document}