0

For interlinear text, code such as egreg's here fits my workflow better than a package such as expex; however, keeping the interlinear and non-interlinear text aligned (on the baseline) has proven difficult.

\newcommand\wrd[2]{%
  \leavevmode
  \vbox{\offinterlineskip
    \halign{%
      \hfil##\hfil\cr
      {\footnotesize\sffamily\vphantom{p}#1}\cr
      \noalign{\vskip\lineskip}%
      \vphantom{A}#2\cr
    }%
  }%
}

I've tried replacing \vphantom with a \vrule of fixed height (hence, no \strut) to: (a) keep the text aligned even if I need to lower the font-size of the glosses, i.e., by replacing #2 with \footnotesize#2 (b) try to match the non-interlinear text, which is thrown out of alignment even with itself (most noticeably in two-column mode).

MWE:

\documentclass{scrbook,fontsize=10pt}

\usepackage{fontspec} \setmainfont{Linux Libertine O}

\usepackage{fix-cm}%attempt to rule out issues with the font \usepackage{lipsum}

\raggedbottom \raggedright

\newcommand\wrd[2]{% \leavevmode \vbox{\offinterlineskip \halign{% \hfil##\hfil\cr {{\vrule height 8pt depth 4pt width 0pt}#1}\cr \noalign{\vskip\lineskip}% {\vrule height 8pt depth 4pt width 0pt}#2\cr }% }% }

\begin{document}

\twocolumn

{\footnotesize 1:1} \wrd{Align}{with} \wrd{interlinear text}{non-interlinear text -->}

{\footnotesize 1:2} \wrd{Align}{with} \wrd{interlinear text}{non-interlinear text -->}

{\footnotesize 1:3} \wrd{Align}{with} \wrd{interlinear text}{non-interlinear text -->}

{\footnotesize 1:4} \wrd{Align}{with} \wrd{interlinear text}{non-interlinear text -->}

{\footnotesize 1:5} \wrd{Align}{with} \wrd{interlinear text}{non-interlinear text -->}

\lipsum

\end{document}

It seems that it should be possible to achieve the aforementioned alignment without one of the grid packages, which I'm not going to use.

  • 1
    Keeping the text aligned to what? I can't understand. – egreg Jul 31 '21 at 17:24
  • Keep the interlinear text and non-interlinear text aligned with each other (as if both were locked to the same baseline grid). At present, when the interlinear text stops, the text that makes up the remainder of the column is out of alignment with the text in the column following, as I've tried to show in the MWE. Alignment is restored on the following page, but until then, the text looks ugly. –  Jul 31 '21 at 19:06
  • I think that the problem is either (a) that the glue inserted between vboxes is throwing the text out of alignment or (b) that the vrule is offsetting the text from the baseline (or both). –  Aug 18 '21 at 20:57

0 Answers0