maieul / ledmac

package reledmac for latex
http://www.ctan.org/tex-archive/macros/latex/contrib/reledmac
54 stars 28 forks source link

Reledpar: Issue with Print stanza numbering #934

Closed Giacomo1453 closed 2 years ago

Giacomo1453 commented 2 years ago

I have a issue with reledpar. I want the number of the stanzas to appear together with the number of lines in all my critical apparatus (e.g., 9.2 where 9 is the stanza and 2 is the line): before using reledpar, the commands \Xstanza and \Xstanzaseparator worked, but now they do not produce any output. I believe it depends on stanzaL and stanzaR. I tried the following command I found on reledmac documentation (both as it is and with \makeatletter ... \makeatother):

\newcommand{\printstanza}[0]{% \ifboolexpr{bool{l@dpairing} or bool{l@dprintingpages} or bool{l@dprintingcolumns}}{% \ifledRcol@% \thestanzaR% \else% \thestanzaL% \fi% }{% \thestanza% }% }

It generates the following error: "Command \printstanza already defined or name \end... illegal, see p. 192 of the manual". Furthermore, in this command I cannot understand how to add information as through \Xstanzaseparator.

Disclaimer: in my edition, the critical text and the footnotes will be on the left page only.

MWE:


% !TeX TS-program = xelatex
% !TeX spellcheck = it_IT
% !TeX root = Example.tex
% !BIB TS-program = biber

\documentclass[a4paper,11pt]{book}

\usepackage[no-math]{fontspec} 

\usepackage{polyglossia} 
    \setmainlanguage[babelshorthands=true]{italian}
    \setotherlanguages{latin,greek}
        \setkeys{greek}{variant=polytonic}
        \setkeys{latin}{variant=modern}

%Critical edition
\usepackage{reledmac}
\usepackage{verse}
\usepackage{afterpage}

\Xarrangement[A,B,C]{paragraph}
\Xbeforenotes[A,B,C]{2em plus.4em minus.4em} 
\Xafternote[A,B,C]{2em plus.4em minus.4em} 
\Xnotenumfont{\bfseries}
\Xnumberonlyfirstinline[A,B,C]
\Xnumberonlyfirstintwolines[A,B,C]
\Xlemmaseparator[A,B,C]{]}
\Xbeforelemmaseparator[A,B,C]{0.1em}
\Xinplaceofnumber{0pt}
\Xafterrule[A,B,C]{1em}
\setmsdataposition{regular-msdata}
\setmsdataseries{A,B,C}
\Xstanza[A,B,C]
\Xstanzaseparator[A,B,C]{.}
\usepackage{reledpar}

\begin{document}

\begin{pages}
\begin{Leftside}

\beginnumbering
\numberstanzatrue

\setstanzaindents{0,0,0,0}
\setcounter{stanzaindentsrepetition}{2}

\stanza
Lorem ipsum \edtext{dolor sit}{\Bfootnote{dolui M}} amet&
consectetur adipiscing elit&
Morbi ultricies nulla vel turpis maximus, vitae sollicitudin metus efficitur&
Morbi vel enim dolor.&
Vivamus quis accumsan augue.\&

%----------------------------------------------------------------------------------------

\stanza[\vspace{1mm}]

Lorem ipsum dolor sit amet&
consectetur adipiscing elit&
Morbi ultricies nulla vel \edtext{turpis}{\Afootnote{turpius}} maximus, vitae sollicitudin metus efficitur&
Morbi vel enim dolor.&
Vivamus quis accumsan augue.\&

\numberstanzafalse
\endnumbering

\end{Leftside}

%------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

\begin{Rightside}

\beginnumbering
\numberstanzatrue

\setstanzaindents{0,0,0,0}
\setcounter{stanzaindentsrepetition}{2}

\stanza
Lorem ipsum dolor sit amet&
consectetur adipiscing elit&
Morbi ultricies nulla vel turpis maximus, vitae sollicitudin metus efficitur&
Morbi vel enim dolor.&
Vivamus quis accumsan augue.\&

%----------------------------------------------------------------------------------------

\stanza[\vspace{1mm}]

Lorem ipsum dolor sit amet&
consectetur adipiscing elit&
Morbi ultricies nulla vel turpis maximus, vitae sollicitudin metus efficitur&
Morbi vel enim dolor.&
Vivamus quis accumsan augue.\&

\numberstanzafalse
\endnumbering

\end{Rightside}
\end{pages}
\Pages

\end{document}
maieul commented 2 years ago

Well,

there is some problem in your code. You call \numberstanzatrue in the Leftside and Rightside environments. So, the values are set locally, that is when reading the code. But not when printing the pages (with \Pages), and so the footnote. So, the solution is very easy: put \numberstanzatrue outside of the Left/Rigth side environment, for example before \begin{pages} (and forget the \numberstanzafalse.

One word about your test with \printstanza macro. As explained by error message, it is already defined. That is in the reledmac code. You found the macro in the second part of the handbook, with section in roman numbering, which explains the internal code of reledmac. So, what you tried to do was to define it again, so you get the error. Even with success (with \renewcommand), as it would have been exactly the same code as the already defined in reledmac, it would have change nothing to your problem.