5

PS: I hate to bump this, but I really need to revisit this issue. What are my options at this point? Can I temporarily use an older version of latex (how?), or some alternative version of packages other than songs?


I am using the songs package to typeset a little booklet of songs and chords. This used to work fine, but when I tried to recompile the sources I had last worked on a few weeks ago, the layout was broken. Within the \begin{songs} environment, line breaks are treated verbatim. This still works in lyric mode. (See MWE below.) When I enable chorded mode, however, these line breaks are no longer respected.

I have marked line breaks in the source with a pilcrow ¶ to make the issue easier to see.

\documentclass{article}
\usepackage[chorded]{songs}
%\usepackage[lyric]{songs}

\newindex{myindex}{index}

\begin{document}
\begin{songs}{myindex}

\beginsong{And Can It Be}
\beginverse
\[F]And \[F/A]can \[(C)]it \[F]be that \[Gm/B&]I \[C7]should \[F]gain¶
An \[B&]in\[C]terest \[F/A]in \[C/E]the \[C/G]Sav\[G7]ior's \[C]blood?¶
Died He \[F/C]for me, \[C] who \[F/A]caused \[F]His \[C]pain?¶
\endverse

\beginchorus
Amazing \[C]love! How \[C7/E]can it \[F]be¶
That \[B&]Thou, my \[F/A]God, \[Gm/B&]shouldst \[F/C]die \[C7]for \[F]me?
\endchorus
\endsong

\end{songs}
\end{document}

The songs package hasn't been updated since 2018, so I suspect something in the base LaTeX system must have changed, because this used to work fine until recently. I am on the very latest TeX Live 2022.

lyric mode (top) works, chorded mode (bottom) is freshly broken:

enter image description here

5
  • 3
    the package redefines \par and \@@par and that clashes imho with the new para hooks (see ltpara-doc.pdf). Contact the author, they will have to adapt their package. Jul 7, 2022 at 9:13
  • 1
    @UlrikeFischer I have done so already, pointing him to this thread.
    – Ingmar
    Jul 7, 2022 at 9:16
  • @UlrikeFischer That being said, it sounds like something that could be easily patched on the user level.
    – Gaussler
    Jul 7, 2022 at 11:00
  • 1
    @Gaussler well if you know a work-around, show it. Jul 7, 2022 at 11:05
  • @UlrikeFischer I don’t, as I haven’t studied the code. But if the package redefines \par in a way that crashes with the hook system, why not just re-patch \par the same way using the hook system? That’s all I was thinking.
    – Gaussler
    Jul 7, 2022 at 13:53

2 Answers 2

4

The problem is that LaTeX changed the \obeylines command. You can try this patch. The author has been notified, but I will also discuss if LaTeX should do a firstaid patch.

Update

We added a firstaid to latex. This firstaid can be used now with latex-dev and will be in the next release LaTeX release in june 23 (unless the package is updated).

\documentclass{article}
\usepackage[chorded]{songs}
%\usepackage[lyric]{songs}

\newindex{myindex}{index}
\makeatletter
\renewcommand\SB@obeylines{%
  \let\obeyedline\SB@par%
  \obeylines%
  \let\@par\SB@@par%
}
\makeatother
\begin{document}
\begin{songs}{myindex}

\beginsong{And Can It Be}
\beginverse
\[F]And \[F/A]can \[(C)]it \[F]be that \[Gm/B&]I \[C7]should \[F]gain¶
An \[B&]in\[C]terest \[F/A]in \[C/E]the \[C/G]Sav\[G7]ior's \[C]blood?¶
Died He \[F/C]for me, \[C] who \[F/A]caused \[F]His \[C]pain?¶
\endverse

\beginchorus
Amazing \[C]love! How \[C7/E]can it \[F]be¶
That \[B&]Thou, my \[F/A]God, \[Gm/B&]shouldst \[F/C]die \[C7]for \[F]me?
\endchorus
\endsong

\end{songs}
\end{document}

enter image description here

2
  • I have tried notifying the author when the issue first arose, but haven't heard back from him. Thank you, Ulrike, your efforts are greatly appreciated.
    – Ingmar
    Nov 28, 2022 at 9:09
  • Sorry it took a while for me to revisit this project, so I have just now verified and accepted your answer. This patch is exactly what I needed (even with TL 2023, BTW) and I am very grateful for that.
    – Ingmar
    Apr 14, 2023 at 13:58
1

I use songs package with Texlive with no problems. With Miktex, I see the problem you have. An alternative, it is to use leadsheets package. It is more flexible than songs package, but you need to create your own template to take advantage of all customization capabilities.
Here is a working example for you to start

\documentclass{article}
\usepackage{xcolor}
\usepackage{leadsheets}
\usepackage{booktabs}
\setlength\heavyrulewidth{0.25ex}
\definesongtitletemplate{custom}{
    \ifsongmeasuring
    {\section*}
    {\section*}{%
\begin{tabular}{p{0.05\textwidth}p{0.95\textwidth}}
    \toprule
    \noindent{\color{blue!50}1}&{\songproperty{title}}\\
\end{tabular} 
\vskip -0.15\baselineskip%
\begingroup\normalfont\footnotesize
\noindent\begin{tabular}{p{0.05\textwidth}p{0.95\textwidth}}
    \ifsongproperty{interpret}%
        {&  \GetTranslation{leadsheets/interpret}\\}
        {}% 
    \ifsongproperty{composer}%
        {&  \GetTranslation{leadsheets/composer}
            \printsongpropertylist{composer}{ \& }{, }{ \& }
            \\}
        {}%
    \ifsongproperty{lyrics}%
        {&  \GetTranslation{leadsheets/lyrics}
            \printsongpropertylist{lyrics}{ \& }{, }{ \& }
            \\}
        {}% 
    \ifsongproperty{key}
        {& \setchords{
             major = -\GetTranslation{leadsheets/major} ,
             minor = -\GetTranslation{leadsheets/minor}
             }%
         \GetTranslation{leadsheets/key}: %
         \expandcode{\writechord{\songproperty{key}}} \\%
         }
     {}%
    \midrule
\end{tabular}
\endgroup    
    }
}

\setleadsheets{verse/numbered=true, align-chords = {l}}
\setleadsheets{print-chords=true, title-template=custom, chorus*/format = \bfseries}
\setchords{format={\color{blue}\sffamily\small\bfseries\itshape}}
\begin{document}
    \begin{song}[verse/numbered, remember-chords]{
            title={Reprehenderit in Voluptate Velit},
            interpret={Copycat},
            composer={inspired by others},
            music={No One Knows},
            lyrics={John Doe},
            key={Car Keys}
        }
        \begin{chorus*}
            LOR^{E}EM ipsum dolor sit A^{A}MET, consect^{B7}etur ADIPIS^*{E}CING \\
            elit, ^{A}sed do eiusmod tempor ^{B7}incididunt ut labore et dolore magna a^{E}liqua LOR^{E}EM ipsum dolor sit A^{A}MET, consect^{B7}etur ADIPIS^*{E}CING 
        \end{chorus*}
        
        \begin{verse}
            Lor^{E}em ipsum dolor sit A^{A}MET, consect^{B7}etur adipis^*{E}cing \\
elit, ^{A}sed do eiusmod tempor ^{B7}incididunt ut labore et dolore magna a^{E}liqua LOR^{E}EM ipsum dolor sit A^{A}met, consect^{B7}etur adipis^*{E}cing 
        \end{verse}
        
        \begin{verse}
            Lor^{E}em ipsum dolor sit A^{A}MET, consect^{B7}etur adipis^*{E}cing \\
elit, ^{A}sed do eiusmod tempor ^{B7}incididunt ut labore et dolore magna a^{E}liqua LOR^{E}EM ipsum dolor sit A^{A}met, consect^{B7}etur adipis^*{E}cing
        \end{verse}
    \end{song}
    
\end{document}

enter image description here

1
  • Thank you for your suggestion; I will keep it in mind for future projects. This one has gone too far, however, to change LaTeX classes mid-stream, as it were :-)
    – Ingmar
    Apr 14, 2023 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .