2

In a reledpar project I'd like for some sections to appear in the TOC with different names than how they appear in the body. Normally this is straightforward: \section[name in TOC]{name in body}. However, this generates an error if attempted within reledpar (Argument of \ttl@straight@i has an extra }) or reledmac (Incomplete \iffalse).

Is there a way to make this sectioning feature work in reledpar? An alternate solution through titlesec and titletoc may be possible, but it would be more complex.

MWE:

\documentclass{article}
\usepackage{reledmac, reledpar}
\begin{document}
  \tableofcontents
  \begin{pages}
    \begin{Leftside}
      \beginnumbering
      %% the line below gives an error `Argument of \ttl@straight@i has an extra }`
      %% (error even if the right side too has differentiated TOC and body section names to match these)
      %\pstart[\section[Left section in TOC]{Left section in body}]
      \pstart[\section{Left section}]
        Left paragraph.
      \pend
      \endnumbering
    \end{Leftside}
    \begin{Rightside}
      \beginnumbering
      \pstart[\section{Right section}]
        Right paragraph.
      \pend
      \endnumbering
    \end{Rightside}
  \end{pages}
  \Pages

  %\beginnumbering
  %% the line below gives an error `Incomplete \iffalse`
  %  \pstart[\section[Reledmac section in TOC]{Reledmac section in body}]
  %    A reledmac paragraph.
  %  \pend
  %\endnumbering

  % no error outside of reledpar and reledmac
  \section[Non-reledpar section in TOC]{Non-reledpar section in body}
\end{document}
  • titlesec, titletoc and tocloft, in one file? That's a pretty combination ;-) – user31729 Jan 12 at 15:11
  • Oops! tocloft must have stuck when copied from somewhere else. I was experimenting with the other two, but they're not necessary either for this MWE, so I've removed them. Thanks. – fvogel Jan 12 at 15:36
2

It is a problem of expansion. I have notime now to understand the problem in reledmac code (you could open an issue), but a \unexpanded work around.

\documentclass{article}
\usepackage{reledmac, reledpar}
\begin{document}
\tableofcontents
  \beginnumbering
   \pstart[\unexpanded{\section[reledmac section in toc]{reledmac section in body}}]
      a reledmac paragraph.
    \pend
  \endnumbering

  % no error outside of reledpar and reledmac
  \section[Non-reledpar section in TOC]{Non-reledpar section in body}
\end{document}

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.