# Reledmac and problems with RTL (Hebrew) lemmata in critical notes

I'm getting error's as soon as I start adding critical notes in my Hebrew text. I'm using XeTeX.

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{b5paper}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{reledmac}
\usepackage[]{reledpar}
\usepackage{makeidx}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{bidi}

\newfontfamily{\I}[Scale=0.9]{Ezra SIL}
\newfontfamily{\H}[Scale=1.0]{Ezra SIL}

\renewcommand{\footfudgefiddle}{71}
\lineation{page}
\Xarrangement[]{paragraph}
\Xbeforenotes[]{12pt}
\Xbeforenumber[]{0.5em}
\Xafternumber[]{0.5em}
\Xnotenumfont[]{\bfseries}
\Xafterlemmaseparator{0.5em}
\Xparafootsep[]{$\parallel$}
\Xragged{R}

\begin{document}
\author{Robert Voogdgeert}
\title{\H{שיר השרים}}
\maketitle
\thispagestyle{empty}

\section*{\H{א}}
\numberpstarttrue
\sidepstartnumtrue
\linenummargin{inner}
\sidenotemargin{outer}
\lineation*{page}

\begin{pages}
\begin{Rightside}
\beginnumbering
\linenummargin{left}
\pstart\noindent Overstelp 2 Kon. 11:29 mij met de kussen van je mond, want je liefkozingen zijn zoeter dan wijn.\pend
\endnumbering
\end{Rightside}

\begin{Leftside}
\beginnumbering
\begin{doublespace}
\linenummargin{right}
\setRTL
\pstart\noindent{\H \edtext{\RL{יִשָּׁקֵ֙נִי֙}}{\Afootnote{\LR{Ook in systeem A. Dit moet een hif. zijn.}}} מִנְּשִׁיק֣וֹת \edtext{\RL{פִּ֔יהוּ}}{\Afootnote{\LR{Dit is een voetnoot in systeem A.}}} כִּֽי־טוֹבִ֥ים דֹּדֶ֖יךָ מִיָּֽיִן׃}\pend
\unsetRTL
\end{doublespace}
\endnumbering
\end{Leftside}
\end{pages}
\Pages
\end{document}


These are the errors:

The last critical note is always on the next page.

I don't know why this happens. I read in the Reledmac manual:

\footnotelang@lua is called to remember the information about the direction of a lemma when LuaLATEX is used.

Now, I typesetting in XeTeX, not LuaTex, but maybe this is related?

• Welcome to TeX.SX!! It is better to post a full minimal working example. For example, A LaTeX MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! The code fragment that you have posted doesn't give enough information as we can't reproduce your error from it.. – Andrew Apr 28 '16 at 14:59
• @Andrew I changed the message and added an MWE. – Robert Voogdgeert Apr 28 '16 at 16:45
• reledmac is compatible with RTL language but only if you use polyglossia (and in any case you must use it, at least to have good hyphenation) – Maïeul Apr 29 '16 at 7:37

## 1 Answer

Here a full working MWE.

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{b5paper}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{reledmac}
\usepackage[]{reledpar}
\usepackage{makeidx}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{polyglossia}
\setmainlanguage{dutch}
\setotherlanguage{hebrew}
\newfontfamily{\hebrewfont}[Scale=0.9]{Ezra SIL}
\newfontfamily{\I}[Scale=0.9]{Ezra SIL}
\newfontfamily{\H}[Scale=1.0]{Ezra SIL}

\renewcommand{\footfudgefiddle}{71}
\lineation{page}
\Xarrangement[]{paragraph}
\Xbeforenotes[]{12pt}
\Xbeforenumber[]{0.5em}
\Xafternumber[]{0.5em}
\Xnotenumfont[]{\bfseries}
%\Xafterlemmaseparator{0.5em}
\Xparafootsep[]{$\parallel$}
\Xragged{R}

\begin{document}
\author{Robert Voogdgeert}
\title{\texthebrew{שיר השרים}}
\maketitle
\thispagestyle{empty}

\section*{\H{א}}
\numberpstarttrue
\sidepstartnumtrue
\linenummargin{inner}
\sidenotemargin{outer}
\lineation*{page}

\begin{pages}
\begin{Rightside}
\beginnumbering
\linenummargin{left}
\pstart\noindent Overstelp 2 Kon. 11:29 mij met de kussen van je mond, want je liefkozingen zijn zoeter dan wijn.\pend
\endnumbering
\end{Rightside}

\begin{Leftside}
\begin{hebrew}
\beginnumbering

\linenummargin{right}

\pstart\noindent{\edtext{{יִשָּׁקֵ֙נִי֙}}{\Afootnote{\textdutch{Ook zijn.}}} מִנְּשִׁיק֣וֹת \edtext{{פִּ֔יהוּ}}{\Afootnote{\textdutch{Ook in systeem A. Dit moet een hif. zijn.}}} כִּֽי־טוֹבִ֥ים דֹּדֶ֖יךָ מִיָּֽיִן׃}\pend

\endnumbering
\end{hebrew}
\end{Leftside}

\end{pages}
\Pages
\end{document}


Please note the following points:

• actually, there is no way in reledpar to have not the same interline spacing on both side. So it is normal that you doublespace do nothing (fixing this bug is on the reledpar to do list, but I have no time until a long, long time).
• using paragraphed notes with alternance between LR and RL can make notes not to be paragraphed if their content are long. In general, paragraphed notes are for short notes.
• Thank you, @Maïeul! This is helpful. Just one more question: Can the overal direction of a critical note to a Hebrew lemma of a Hebrew text be LTR. When I use your MWE the layout of the critical note is RTL, of course because of the \begin{hebrew} . What I like to do is as the layout of the critical apparatus in BHS and (now) BHQ. Thanks again! – Robert Voogdgeert Apr 29 '16 at 19:10
• Hum, you mean something like this framapic.org/besnYjRHEe5O/Pa0VnPSE9VvT.png ? for now, there is no solution. – Maïeul Apr 29 '16 at 20:10
• But I could add hooks allowing to obtain that. Unfortunetally, the most complex thing will be to explain in the handbook how to use them, because it is very special hooks. – Maïeul Apr 29 '16 at 20:11
• Yes! That's exactly what I need. If you would be willing to share the hooks, it would be very much helped. I'm doing research into north-west semitic languages and texts, mostly researching classical Hebrew texts and dialects. I'm currently working on and preparing a study on the language of שיר השירים. – Robert Voogdgeert Apr 30 '16 at 6:10
• it would also render reledmac a package which makes setting modern text-critical editions like BHQ possible. This would, to my opinion, be a true benefit and as such a reason for other scholars of TeNeCh that otherwise write in LTR languages, to start using it, provided that they'd be willing to write in LaTeX. – Robert Voogdgeert Apr 30 '16 at 6:35