1

This question is a follow up to this question, which asked about justifying all the glosses. The solution worked for justifying \gla, \glb, and \glc but not for \glft. The problem is clearly because the default language is Hebrew \setdefaultlanguage{hebrew}, but I don't know how to get around it.

MWE:

\documentclass{book}

\usepackage{ragged2e}

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

\begin{document}

\lingset{
    everygla=\Large,
    everyglb=\footnotesize\englishfont,
    everyglc=\footnotesize\englishfont,
    everyglft=\small,
    glftpos=right,
    glwordalign=center,
    glhangindent=0em,
}

\definelingstyle{justified}{
    glrightskip=0pt,glspace=0.5em plus 3em minus 0.15em,
    everyglft=\justifying\noindent
}

\exdisplay[lingstyle=justified]

\begingl
  \gla אאאא בבגגגגב גגגג דדדדדדדד אאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדד אאאאאאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדדדדדד אאאאאאא בבבב גגגג דדדד אאאא בבגגגגבב גגגג דדדדדד //

  \glb aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //

  \glc aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd  //

\glft
    \textenglish{Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation. Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation.} //
\endgl

\xe

\end{document}

OUTPUT: enter image description here

As you can see, the Hebrew gloss is nicely justified, but the English free translation is ragged left, even though in a fully English environment it comes out fully justified.

  • How crucial is it for Hebrew to be the default language and English to be the other language? If you switch those (and put \hebrewfont in \gla) it works as expected, and the free translation appears on the right of the page instead of the left. – Jason Zentz Mar 6 '17 at 16:23
  • I tested it by switching the default and other language and then implementing your suggestion, and it doesn't work. It forces the Hebrew text into left-to-right. While the individual words are RTL, then Hebrew text as a whole is LTR. equivalent English the of example an is Here. – AML Mar 6 '17 at 16:38
  • Ah yes, right. And of course surrounding the example with \begin{hebrew}...\end{hebrew} (and \englishfont\setLTR in English gloss lines) puts you back with the problem you have in your MWE. – Jason Zentz Mar 6 '17 at 17:17
  • Aside from interlinear and translation environments, though, does it matter whether the default language is Hebrew or English? What is the language of the main body text outside of these special environments? – Jason Zentz Mar 6 '17 at 17:36
  • The glosses are the main environment in my case. – AML Mar 6 '17 at 17:48
1

I have tried a lot of things to get the justification to work in the \glft when the example is in a RTL language (either through the document's default language or a \begin{hebrew}...\end{hebrew} environment that surrounds the example), but I haven't been successful. I also tried putting it in a side panel following the code in section 12.3 of the expex manual, but that didn't help either.

What I would suggest would be to use the paracol package rather than expex itself to split your translation into a second column. This way your translation column won't be constrained by expex at all.

In the example below, I created interlinear and translation environments that subsume commands from paracol, expex, and general formatting so that your code can be simpler. I don't have FrankRuehl so I used Ezra SIL for the Hebrew font instead.

\documentclass{book}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{Ezra SIL}
\newfontfamily\englishfont{Corbel}

\usepackage{microtype} % for better automatic spacing in the narrow justified column

\usepackage{expex}

\lingset{
    everygla=\Large,
    everyglb=\footnotesize\englishfont,
    everyglc=\footnotesize\englishfont,
    glwordalign=center,
    glhangindent=0em,
    glrightskip=0pt,
    glspace=0.5em plus 3em minus 0.15em,
}

\usepackage{paracol}

\newenvironment{interlinear}%
    {\begin{leftcolumn*}\begin{hebrew}\exdisplay\begingl}%
    {\endgl\xe\end{hebrew}\end{leftcolumn*}}
\newenvironment{translation}%
    {\begin{rightcolumn}\small\noindent\ignorespaces}%
    {\end{rightcolumn}}

\begin{document}

%   \columnratio{0.6} % 0.6 is the default value for expex's ssratio, so if you want that ratio, uncomment this and adjust as needed
%   \setlength{\columnsep}{3em} % this is the default value for expex's sssep, so if you want that amount of column separation, uncomment this and adjust as needed
\begin{paracol}{2}

\begin{interlinear}
  \gla אאאא בבגגגגב גגגג דדדדדדדד אאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדד אאאאאאאא בבבב גגגג דדדד אאאא בבבב גגגג דדדדדדדד אאאאאאא בבבב גגגג דדדד אאאא בבגגגגבב גגגג דדדדדד //

  \glb aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd //

  \glc aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd aaaa bbbb gggg dddd  //
\end{interlinear}

\begin{translation}
    Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation. Some English text so that you can see whether the hyphenation and justification provided by \LaTeX{} are actually working in this free translation.
\end{translation}

\end{paracol}

\end{document}

enter image description here

  • Thanks very much, though the free translation doesn't quite look fully justified. – AML Mar 6 '17 at 19:24
  • It is fully justified, but it has a few overfull \hboxes due to the column being so narrow. That's really a separate issue. – Jason Zentz Mar 6 '17 at 19:27
  • @AML, I just edited the answer to use the default column widths provided by paracol, which gives wider columns and shows the justification more clearly. If you want to restore the widths that expex uses, uncomment the \columnratio and \setlength\columnsep lines. – Jason Zentz Mar 6 '17 at 19:39
  • Thanks again. Finally, how would you modify this to make the top of each column perfectly line up with each other? And furthermore, if you copy/paste the section from \begin{interlinear} through \end{translation}, to create multiple glosses with free translation, this doesn't work well because they lose "connection" to each other across the pages. Might \parbox be a better solution? – AML Mar 6 '17 at 19:53
  • @AML, it seems that paracol lines up the baselines of the top line of the interlinear and translation environments. I'm not a paracol user myself so I don't know the best way to change that behavior within the package, but you could ask a separate question. – Jason Zentz Mar 6 '17 at 20:45

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.