4

I am creating a sample of an interlinear dual-language text produced using LaTeX. Everything is finished and the text consists of three things: an English gloss (top row); a Hebrew text (note it's a right-to-left language); and a free translation below them.

But for the final product I would like to add a margin note on the right side of the Hebrew line giving the verse number. The problem is that neither \marginpar nor the marginnotes package work very well with the interlinear environment, with the note appearing at the top or bottom of the environment.

What are some solutions to aligning a margin note with the middle of an interlinear text?

\documentclass[draft, a4paper]{article}
\usepackage[a4paper, left=3.5cm, right=3.5cm, top=2.5cm,bottom=4cm]{geometry}

\setlength{\parindent}{0em}     
\setlength{\parskip}{1em}           
\linespread{1.1}

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{Arial}
\newfontfamily\englishfont[Script=Latin]{Calibri}

\usepackage{expex}
\lingset{everygla=\footnotesize\englishfont\beginL, everyglb=\large\hebrewfont, everyglft=\large\englishfont\beginL,
  glwordalign=center,
  aboveglftskip=-.15cm,
  glspace=1em, 
}
\newcommand{\vsd}{\vspace{0.8cm}}

\begin{document}
\setLR
\begin{center} \LARGE
Demonstration of \LaTeX\ Layout
\end{center}
\begin{flushleft}
\section*{Book of Deuteronomy}
\subsection*{ Chapter 8 \textemdash\ The Seven Species of the Land of Israel} 
\end{flushleft} 
\setRL
\begingl
\gla {And you will keep} {the commandments} {the LORD} {your God} {to walk} {in his ways} {and to fear} him //
\glb וְשָׁמַרְתָּ, אֶת-מִצְו‍ֹת השם אֱלֹהֶיךָ, לָלֶכֶת בִּדְרָכָיו, וּלְיִרְאָה אֹתוֹ //
 \glft And you will keep the commandments of the LORD your God, to walk in his ways and to fear him.//
\endgl
 \vsd %command for vertical space
 \setLR 
\section*{Textual Analysis}
\raggedright \large \englishfont
The verses above are taken from the Biblical Book of Deuteronomy.
\end{document}

I want something like this: (inserted via PDF comment).

Picture of target layout with margin note

4

Note: I do not have Arial or Calibri so I'm using libertine in the following example.

You need marginnote release 1.2b from 22th April 2017 (or newer). Previous releases do not handle right-to-left typesetting. But from release 1.2b the following example:

\documentclass[draft, a4paper]{article}
\usepackage[a4paper, left=3.5cm, right=3.5cm, top=2.5cm,bottom=4cm]{geometry}

\usepackage{parskip}
%\setlength{\parindent}{0em}     
\setlength{\parskip}{1em}           
\linespread{1.1}

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\usepackage{libertine}

\usepackage{expex}
\lingset{everygla=\footnotesize\beginL, everyglft=\large\beginL,
  glwordalign=center,
  aboveglftskip=-.15cm,
  glspace=1em, 
}
\newcommand{\vsd}{\vspace{0.8cm}}
\usepackage{marginnote}[2017/04/22]% at least marginnote 1.2b needed
\reversemarginpar

\begin{document}
\setLR
\begin{center} \LARGE
Demonstration of \LaTeX\ Layout
\end{center}
\begin{flushleft}
\section*{Book of Deuteronomy}
\subsection*{ Chapter 8 \textemdash\ The Seven Species of the Land of Israel} 
\end{flushleft} 
\setRL
\begingl
\gla {And you will keep} {the commandments} {the LORD} {your God} {to walk} {in his ways} {and to fear} him //
\glb\marginnote{6 Verse}וְשָׁמַרְתָּ, אֶת-מִצְו‍ֹת השם אֱלֹהֶיךָ, לָלֶכֶת בִּדְרָכָיו, וּלְיִרְאָה אֹתוֹ //
 \glft And you will keep the commandments of the LORD your God, to walk in his ways and to fear him.//
\endgl
 \vsd %command for vertical space
 \setLR 
\section*{Textual Analysis}
\raggedright \large
The verses above are taken from the Biblical Book of Deuteronomy.
\end{document}

results in:

enter image description here

marginnote 1.2b is already part of TL 2017 pretest (but not TL 2016) and available for MiKTeX.

If you cannot update to marginnote 1.2b please have a look at my answer to: Margin Notes in Unicode RTL.

  • Thanks! And now I know how to update my packages too. :) – greglo May 2 '17 at 9:29

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.