5

Here i have taken the LaTeX code from songs package manual

\documentclass{article}
\usepackage[chorded]{songs}
\noversenumbers
\begin{document}
\songsection{Worship Songs}
\begin{songs}{}
\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken}, sr={Revelation 5:13}, cr={Public domain.}]
\beginverse
\[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;
\[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;
\[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav’n\[D]ly \[Em]host;
\[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.
\[C]A\[G]men.
\endverse
\endsong
\end{songs}
\end{document}

earlier it is used to run successfully without any error but after updating packages it is showing error messages as shown below enter image description here

8
  • That is a bug in the songs package. Notify the author. The line \IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\ifpdf\SB@pdftrue\fi} is not a good idea ... Aug 5, 2019 at 6:56
  • How to notify the author since there is no email ID @Ulrike Fischer
    – Biki Teron
    Aug 5, 2019 at 7:55
  • The catalogue shows a homepage and a repo: ctan.org/pkg/songs Aug 5, 2019 at 7:58
  • There is no contact to send him, may be he is having account in tex.stackexchange.com/users/28900/kevin-hamlen when author show the problem may be he will rectify the bugs@UlrikeFischer
    – Biki Teron
    Aug 5, 2019 at 8:11
  • On the home page there is a large button called "contact". Aug 5, 2019 at 8:13

1 Answer 1

5

You solve the issue by adding \usepackage{ifpdf} before \usepackage[<options>]{songs}.

The code fails because of the recently added

\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\ifpdf\SB@pdftrue\fi}{
  \ifx\pdfoutput\undefined\else
    \ifx\pdfoutput\relax\else
      \ifnum\pdfoutput<\@ne\else
        \SB@pdftrue
      \fi
    \fi
  \fi
}

In the past only the “false” branch was used. The problem is that the “true” branch is placed inside a conditional. Namely, the definition reads

\long\def \IfFileExists#1#2#3{%
  \openin\@inputcheck#1 %
  \ifeof\@inputcheck
    \ifx\input@path\@undefined
      \def\reserved@a{#3}%
    \else
      \def\reserved@a{\@iffileonpath{#1}{#2}{#3}}%
    \fi
  \else
    \closein\@inputcheck
    \edef\@filef@und{#1 }%
    \def\reserved@a{#2}%
  \fi
  \reserved@a}

Since ifpdf.sty is found in all recent full TeX distributions, the \ifeof test returns false, so the line with \@iffileonpath{#1}{#2}{#3} is skipped. In doing so, TeX still takes notes of conditionals: since it is skipping

\@iffileonpath{ifpdf.sty}{\ifpdf\SB@pdftrue\fi}{...}

the \fi is considered as matching \ifx\input@path\@undefined, because \ifpdf has not yet been defined as a conditional.

The code should be, if the author is fussy about providing a (not so good) test in case ifpdf.sty is not found,

\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\csname ifpdf\endcsname\SB@pdftrue\csname fi\endcsname}{
  \ifx\pdfoutput\undefined\else
    \ifx\pdfoutput\relax\else
      \ifnum\pdfoutput<\@ne\else
        \SB@pdftrue
      \fi
    \fi
  \fi
}

You must log in to answer this question.

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