左右 parbox 对齐问题

左右 parbox 对齐问题

以前问过类似的问题,但那与有关paracol。这个问题与有关parbox,所以我认为解决方案会有所不同。

如您所见,两个parbox线没有按我想要的方式对齐。红线和蓝线应该完全对齐。

在此处输入图片描述

梅威瑟:

\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}

答案1

\strut只需在左侧文本之前添加一个\footnotesize,如\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}

在此处输入图片描述

相关内容