![노래 패키지에서 오류가 발생했습니다.](https://rvso.com/image/399848/%EB%85%B8%EB%9E%98%20%ED%8C%A8%ED%82%A4%EC%A7%80%EC%97%90%EC%84%9C%20%EC%98%A4%EB%A5%98%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
여기에서는 노래 패키지 매뉴얼에서 LaTeX 코드를 가져왔습니다.
\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}
이전에는 오류 없이 성공적으로 실행되었지만 패키지를 업데이트한 후에는 아래와 같이 오류 메시지가 표시됩니다.
답변1
\usepackage{ifpdf}
before를 추가하여 문제를 해결합니다 \usepackage[<options>]{songs}
.
최근에 추가된 코드로 인해 코드가 실패합니다.
\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
}
과거에는 "false" 분기만 사용되었습니다. 문제는 "참" 분기가 조건문 내부에 배치된다는 것입니다. 즉, 정의는 다음과 같습니다.
\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}
는 ifpdf.sty
최근의 모든 전체 TeX 배포판에서 발견되었으므로 \ifeof
테스트는 false를 반환하므로 다음 줄을 \@iffileonpath{#1}{#2}{#3}
건너뜁니다. 그렇게 하는 동안 TeX는 여전히 조건문을 기록합니다. 건너뛰기 때문입니다.
\@iffileonpath{ifpdf.sty}{\ifpdf\SB@pdftrue\fi}{...}
은 아직 조건부로 정의되지 않았기 때문에 \fi
일치하는 것으로 간주됩니다 .\ifx\input@path\@undefined
\ifpdf
코드는 작성자가 테스트를 ifpdf.sty
찾을 수 없는 경우에 대비하여 (별로 좋지 않은) 테스트를 제공하는 데 까다로워야 합니다.
\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
}