3

I previously asked a similar question, but that was related to paracol. This question is related to parbox, so I think the solution will be a bit different.

As you can see, the two parboxes don't line up as I want. The red and blue lines should be exactly even.

enter image description here

MWE:

\documentclass{book}

\usepackage{microtype}  
\usepackage{expex}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{FrankRuehl}
\newfontfamily\englishfont{Times New Roman}

\lingset{
    everygla=\Large,
    everyglb=\scriptsize\englishfont,
    everyglc=\scriptsize\englishfont,
    glwordalign=center,
    glhangindent=0em,
    glrightskip=0pt,
   }

\usepackage{ifoddpage}

\newcommand{\swapboxes}[2]% #1 = wide text, #2 = narrow text
{\noindent\makebox[\textwidth]{\checkoddpage
 \ifoddpageoroneside
   \parbox[t]{.71\textwidth}{#1}\hfill\parbox[t]{.26\textwidth}{#2}%
 \else
   \parbox[t]{.26\textwidth}{#2}\hfill\parbox[t]{.71\textwidth}{#1}%
 \fi}}% this \swapboxes macro forces the parboxes to switch sides every odd page

\begin{document}

\swapboxes{\exdisplay\begingl
  \gla אאאא בבבב גגגג דדדד אא בב גג דד אאאא בב גגגג דדד אאאא בבבבב גג דדדד אא בבבב גגגגג דדד אאאא בבבב גגגג דדדד אא בב גג דד אאאא //

  \glb aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa  //

  \glc aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa //

\endgl \xe}{\exdisplay\footnotesize\textenglish{Here is some non lipsum text to fill up this space Here is some non lipsum text to fill up this space Here is some non lipsum text to fill up this space Here is the end} \xe}

\end{document}
4

Just add a \strut before going to \footnotesize on the left text, as in \exdisplay\strut\footnotesize\textenglish{...}.

\documentclass{book}

\usepackage{microtype}  
\usepackage{expex}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{FrankRuehl}
\newfontfamily\englishfont{Times New Roman}

\lingset{
    everygla=\Large,
    everyglb=\scriptsize\englishfont,
    everyglc=\scriptsize\englishfont,
    glwordalign=center,
    glhangindent=0em,
    glrightskip=0pt,
   }

\usepackage{ifoddpage}

\newcommand{\swapboxes}[2]% #1 = wide text, #2 = narrow text
{\noindent\makebox[\textwidth]{\checkoddpage
 \ifoddpageoroneside
   \parbox[t]{.71\textwidth}{#1}\hfill\parbox[t]{.26\textwidth}{#2}%
 \else
   \parbox[t]{.26\textwidth}{#2}\hfill\parbox[t]{.71\textwidth}{#1}%
 \fi}}% this \swapboxes macro forces the parboxes to switch sides every odd page

\begin{document}

\swapboxes{\exdisplay\begingl
  \gla אאאא בבבב גגגג דדדד אא בב גג דד אאאא בב גגגג דדד אאאא בבבבב גג דדדד אא בבבב גגגגג דדד אאאא בבבב גגגג דדדד אא בב גג דד אאאא //

  \glb aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa  //

  \glc aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa bbb ggg ddd aaaa //

\endgl \xe}{\exdisplay\strut\footnotesize\textenglish{Here is some non lipsum text to fill up this space Here is some non lipsum text to fill up this space Here is some non lipsum text to fill up this space Here is the end} \xe}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.