gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
164 stars 43 forks source link

Vbar and Rbar don't work with new lists #1486

Closed Nokel81 closed 4 years ago

Nokel81 commented 4 years ago

The following small file fails to compile.

\documentclass{book}
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage[autocompile]{gregoriotex}

\newlist{alternate}{enumerate}{1}
\renewcommand\labelalternatei{\bfseries\protect\ifnumodd{\value{alternatei}}{\Vbar.}{\Rbar.}}

\begin{document}

Some text some text some text some text some text some text some text some text some text some text some text some text some text.
\begin{alternate}[wide=0pt]
  \item First
  \item Second
  \item Third
  \item Fourth
  \item Fifth
  \item Sixth
\end{alternate}

\end{document} 

With the following error: ! Use of \\alternate doesn't match its definition..

However, if you change the \renewcommand... to ...{V.}{R.}} then it does compile.

rpspringuel commented 4 years ago

I think \Vbar et al. are fragile commands. Try adding \protect in front of them in the original definition of your list.

✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ Fr. Samuel, OSB (R. Padraic Springuel) St. Anselm’s Abbey 4501 South Dakota Ave, NE Washington, DC, 20017 202-269-2300 (c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

On Feb 3, 2020, at 7:48 AM, Sebastian Malton notifications@github.com wrote:

 The following small file fails to compile.

\documentclass{book} \usepackage{enumitem} \usepackage{etoolbox} \usepackage[autocompile]{gregoriotex}

\newlist{alternate}{enumerate}{1} \renewcommand\labelalternatei{\bfseries\protect\ifnumodd{\value{alternatei}}{\Vbar.}{\Rbar.}}

\begin{document}

Some text some text some text some text some text some text some text some text some text some text some text some text some text. \begin{alternate}[wide=0pt] \item First \item Second \item Third \item Fourth \item Fifth \item Sixth \end{alternate}

\end{document} With the following error: ! Use of \alternate doesn't match its definition..

However, if you change the \renewcommand... to ...{V.}{R.}} then it does compile.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Nokel81 commented 4 years ago

That has worked. Thank you.