3

I have set up a layout using paracol with expex glosses in one column and regular text in the other column directly across.

At the page break of the MWE below, you can see that the regular-text column does not stay in alignment with the gloss. I have even added and adjusted a special strut just for that final paragraph but to no avail (if you adjust the strut so that the regular text moves over to the next page, then it does not come close to aligning properly). Most of the time, the gloss page breaks work just fine, but special cases like this do happen regularly over a long document.

How can the code be adjusted to yield proper alignment, even when this happens at a page break in the middle of a document?

Note: you must use the latest expex package for the glbreaking feature to work.

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}

Output: enter image description here

7
  • 1
    If you adjust \strutd to 20pt and add a \flushpage before the last translationspecial doesn't this do what you want? (No need for the interlinearspecial it seems.) It's not totally automatic, but can be done once at in the final stages of the document.
    – Alan Munn
    Apr 8, 2018 at 3:05
  • @AlanMunn It works if I put the \flushpage before interlinearspecial but not translationspecial. That's a good worst case scenario for me, but I would much prefer an automatic solution if possible. Is this a bug in the underlying expex package that can be fixed?
    – AML
    Apr 8, 2018 at 13:08
  • @AlanMunn I'd never seen flushpage before actually, and when I searched the site for it I found this answer. Perhaps it's relevant for automating.
    – AML
    Apr 8, 2018 at 13:38
  • Sorry, that's what I meant. You don't need the interlinealspecial though, just the translationspecial. Shall I add this as an answer? Do these bad breaks come up a lot in the document?
    – Alan Munn
    Apr 8, 2018 at 14:26
  • @AlanMunn Yes it comes up a decent amount over a several hundred page document. Sure you can add it as an answer, since it certainly works, but I prefer automation. Also, the strut in interlinearspecial is set to zero so it shouldn't matter that it's there, right? I just placed it there in case there was ever a need to adjust it.
    – AML
    Apr 8, 2018 at 15:03

1 Answer 1

1
+50

The following is semi-automated solution. The paracol package provides a \flushpage command to clear the end parallel pair and and start a new page.

This, in conjunction with the \strut you've added in the {translationspecial} will line up the parallel columns correctly again. (I think the alignment problem is due to paracol not ExPex).

Although not totally automatic, I've made things a bit simpler so that you don't need the special versions of your environments. Instead I've created a \flushtrans command which issues the \flushpage command and then sets a conditional to trigger use the right size \strut command.

So whenever you have a bad break, issue a \flushtrans command before the relevant {interlinear} environment, and the rest will happen automatically.

We can use the same technique to eliminate the need for your translationfirst and interlinearfirst environments. Instead I've added a second conditional which is set at the beginning of a paracol environment. This will be used inside the translation environment to use the correct 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}

partial output of code

4
  • I'm clear on everything except how you are calling up translationspecial when you got rid if it. That is, you have if, true, and false, but there is no translationspecial environment anymore. How does that work?
    – AML
    Apr 13, 2018 at 12:14
  • @AML The only difference between your translation and translationspecial environments was whether you used \strutb or \strutd. So the conditional changes which strut gets used. Whenever you issue the \flushtrans command, it sets the conditional to use \strutd. At the end of the environment the flag is set back so that subsequent uses will use \strutb until another \flushtrans command is issued.
    – Alan Munn
    Apr 13, 2018 at 12:23
  • @AML I've now edited to do the same for the ...first environments, which are no longer needed.
    – Alan Munn
    Apr 13, 2018 at 12:40
  • ahhh, now I get. Thanks for the explanation.
    – AML
    Apr 13, 2018 at 12:54

You must log in to answer this question.

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