2

I get two problems when I use expex and parcolumns together.

  1. A big gap appears in the non-glossed column.
  2. A gap above the gloss appears, such that the two columns/paragraphs are no longer aligned.

Why do these problems arise, and how to overcome them?

EDIT #1: This question exhibits a similar problem, but the solution is not quite relevant to me.

MWE (XeLaTeX):

\documentclass{book}

\usepackage{parcolumns}

\usepackage{expex}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{FrankRuehl}
\newfontfamily\englishfont{Linux Libertine O}

\usepackage{lipsum}

\usepackage{changepage}
\strictpagecheck

\makeatletter
\def\pc@placeboxes{%
  \global\let\@tempa\relax%
  \hb@xt@\linewidth{%
    \vfuzz30ex %
    \vbadness\@M%
    \splittopskip\z@skip%
    \checkoddpage\ifoddpage
      \count@\z@%
      \loop\ifnum\count@<\pc@columncount%
        \advance\count@\@ne%
        \my@placeboxes@body%
      \repeat%
    \else
      \count@\pc@columncount%
      \loop\ifnum\count@>\z@%
        \my@placeboxes@body%
        \advance\count@\m@ne%
      \repeat%
    \fi
  }%
  \@tempa%
}

\def\my@placeboxes@body{%
  \expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
    \hskip\csname pc@column@width@\number\count@\endcsname%
  \else%
    \expandafter\setbox\expandafter\@tempboxa%
      \expandafter\vsplit\csname pc@column@\number\count@\endcsname%
        to \dp\strutbox%
    \vbox{\unvbox\@tempboxa}%
  \fi%
  \expandafter\ifvoid\csname pc@column@\number\count@\endcsname%
  \else%
    \global\let\@tempa\pc@placeboxes%
  \fi%
  \ifnum\count@>\z@%
    \strut%
    \hfill%
    \ifpc@rulebetween%
      \vrule%
      \hfill%
    \fi%
  \fi%
}
\makeatother

\begin{document}

\begin{parcolumns}[%
  sloppy        = true,
  sloppyspaces  = true,
  nofirstindent = true,
  colwidths     = {1=0.67\textwidth, 2=0.29\textwidth}
]{2}

\colchunk[1]{\exdisplay\begingl

\gla Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

  \glb Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

  \glc Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

\endgl\xe
}

\colchunk[2]{\small%
  \lipsum[2]
}
\end{parcolumns}

\end{document}

Output:

enter image description here

EDIT #2: Simpler MWE (XeLaTeX):

\documentclass{book}

\usepackage{parcolumns}
\usepackage{expex}
\usepackage{lipsum}

\begin{document}

\begin{parcolumns}[%
  sloppy        = true,
  sloppyspaces  = true,
  nofirstindent = true,
  colwidths     = {1=0.67\textwidth, 2=0.29\textwidth}
]{2}

\colchunk[1]{\exdisplay\begingl

\gla Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

  \glb Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

  \glc Far far away behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. //

\endgl\xe
}

\colchunk[2]{\small%
  \lipsum[2]
}
\end{parcolumns}

\end{document}
1
  • For what it's worth, the parallel package also produces this same issue.
    – AML
    Commented Mar 16, 2018 at 18:23

1 Answer 1

1

The stuff between \begingl and \endgl is put into a box. Therefore, parcolumns and parallel are unable to do their job properly, because they only see a tall line.

The following hack unboxes the outer box. But the inner parts are still boxed.

\documentclass{book}

\usepackage{parcolumns}
\usepackage{expex}
\usepackage{lipsum}

\newsavebox\expexBox
\newenvironment{unvtop}{%
  \let\orgvtop\vtop
  \protected\def\vtop{%
    \let\vtop=\orgvtop
    \global\setbox\expexBox=\vtop
  }%
  \ignorespaces
}{%
  \unvbox\expexBox
  \ignorespacesafterend
}

\begin{document}

\begin{parcolumns}[%
  sloppy        = true,
  sloppyspaces  = true,
  nofirstindent = true,
  colwidths     = {1=0.67\textwidth, 2=0.29\textwidth}
]{2}

\colchunk[1]{%
  \begin{unvtop}
    \exdisplay\begingl

    \gla A Far far away behind the word mountains, far from the countries
      Vokalia and Consonantia, there live the blind texts.  //

    \glb B Far far away behind the word mountains, far from the countries
      Vokalia and Consonantia, there live the blind texts.  //

    \glc C Far far away behind the word mountains, far from the countries
      Vokalia and Consonantia, there live the blind texts.  //

  \endgl\xe
  \end{unvtop}
}

\colchunk[2]{\small%
  \lipsum[2]
}
\end{parcolumns}

\end{document}

Result

3
  • Is there no way around this problem?
    – AML
    Commented Mar 22, 2018 at 19:11
  • regarding your edit (code): interesting, only the \gla was "fixed". If \gla can be unpacked, can't \glb and \glc?
    – AML
    Commented Mar 22, 2018 at 19:17
  • 1
    @AML The further internal box structure is quite complicate, the next level is \hbox, then \vbox with the lines. Another approach would be rewriting the plain TeX macros of expex. But I do not see any volunteers for such a job. Commented Mar 22, 2018 at 19:23

You must log in to answer this question.

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