4

I changed the definition of the quote environment to not indent on the right side. But this change doesn't work between \pstart and \pend of eledmac. How would I do that? I tried by redefing the \quote command from eledmac.sty, see the lines commented out, but it didn't work.

\documentclass{memoir}
\usepackage{lipsum}
\usepackage[noreledmac]{eledmac}
\renewenvironment{quote}{\list{}{\rightmargin=0pt}\item[]}{\endlist}
%\renewcommand{\quote}{\par\leavevmode%
%                                \parindent=0pt%
%                                \skipnumbering%
%                                \ifautopar%
%                                    \vskip-\parskip%
%                                \else%
%                                    \vskip\topsep%
%                                \fi%
%                                \global\leftskip=\leftmargin%
%                                \global\rightskip=0pt%
%    }
\begin{document}
\lipsum[1]
\begin{quote}
\lipsum[2]
\end{quote}
\beginnumbering
\pstart
\begin{quote}
\lipsum[2]
\end{quote}
\pend
\endnumbering
\end{document}

output

1 Answer 1

3

eledmac changes the definition of \quote only as part of \beginnumbering.

\documentclass{memoir}
\usepackage{lipsum}
\usepackage[noreledmac]{eledmac}
% \usepackage{etoolbox} % eledmac already loads etoolbox.

\makeatletter
\appto\initnumbering@sectcmd{%
  \ifnoquotation@\else
    \patchcmd{\quote}{\global\rightskip=\leftmargin}{\global\rightskip=0pt }{}{}%
  \fi
}
\makeatother

\begin{document}

\lipsum[1]
\beginnumbering
\pstart
\begin{quote}
\lipsum[2]
\end{quote}
\pend
\endnumbering

\end{document}

You may want to patch also \quotation:

\appto\initnumbering@sectcmd{%
  \ifnoquotation@\else
    \patchcmd{\quote}{\global\rightskip=\leftmargin}{\global\rightskip=0pt }{}{}%
    \patchcmd{\quotation}{\global\rightskip=\leftmargin}{\global\rightskip=0pt }{}{}%
  \fi
}

enter image description here

2
  • O.k., so I see now that the command redefinition I wanted to changed lived within another very long command definition, that's why my redefinition of eledmac's \quote command didn't work, as the version from the class file would overwrite when the \initnumbering@sectcmd is called by \beginnumbering. Your \appto instead adds three lines add the end of the initnumbering@sectcmd definition, which check if we're in a quotation I guess, I don't fully understand latex conditionals yet, and, if we are, patch the lines that set the right indents in \quote and quotation?
    – muk.li
    Aug 16, 2015 at 15:21
  • 1
    @muk.li The conditional \ifnoquotation is true if the noquotation option is passed to eledmac: in this case, no redefinition of quote and quotation is performed (which probably has the effect that numbering doesn't work). The lines I add to the \initnumbering@sectcmd patch the redefined \quote command. I tried patching directly \initnumbering@sectcmd, but didn't succeed, so I resorted to this method.
    – egreg
    Aug 16, 2015 at 15:25

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.