套餐内容和歌曲冲突

套餐内容和歌曲冲突

最近发表的一篇文章,@AWE 报告称在同一个文档中使用包versesongs会导致冲突:

软件包歌曲错误:在没有首先看到 \beginsong 行的情况下遇到了 \beginverse。

如何修复此问题?

\documentclass{article}
\usepackage{verse}
\newcommand{\attrib}[1]{\nopagebreak{\raggedleft\footnotesize #1\par}}

\usepackage[chorded]{songs}
\noversenumbers

\begin{document}
\poemtitle{Mathematics}
\settowidth{\versewidth}{Than Tycho Brahe, or Erra Pater:}
\begin{verse}[\versewidth]
In mathematics he was greater \\
Than Tycho Brahe, or Erra Pater: \\
For he, by geometric scale, \\
Could take the size of pots of ale;\\
Resolve, by sines and tangents straight, \\
If bread or butter wanted weight; \\
And wisely tell what hour o’ the day \\
The clock does strike, by Algebra.
\end{verse}
\attrib{Samuel Butler (1612--1680)}

\songsection{Worship Songs}

\begin{songs}{}
\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
                     sr={Revelation 5:13},
                     cr={Public domain.},
                     index={Praise God, from Whom all blessings flow}]
\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

LaTeX 定义了一个环境verse,但两个软件包以不兼容的方式重新定义了它。要修复此问题,请按以下步骤操作:

  1. 首先加载verse包。

    \usepackage{verse}
    
  2. 将环境重命名versepoemverse

    \let\poemverse\verse
    \let\endpoemverse\endverse
    
  3. 加载songs包。

  4. 每当您需要包verse的环境时verse,请使用poemverse

    \begin{poemverse}
    ...
    \end{poemverse}
    

在此处输入图片描述

\documentclass{article}
\usepackage{verse}
\let\poemverse\verse
\let\endpoemverse\endverse
\newcommand{\attrib}[1]{\nopagebreak{\raggedleft\footnotesize #1\par}}

\usepackage[chorded]{songs}
\noversenumbers

\begin{document}
\poemtitle{Mathematics}
\settowidth{\versewidth}{Than Tycho Brahe, or Erra Pater:}
\begin{poemverse}[\versewidth]
In mathematics he was greater \\
Than Tycho Brahe, or Erra Pater: \\
For he, by geometric scale, \\
Could take the size of pots of ale;\\
Resolve, by sines and tangents straight, \\
If bread or butter wanted weight; \\
And wisely tell what hour o’ the day \\
The clock does strike, by Algebra.
\end{poemverse}
\attrib{Samuel Butler (1612--1680)}

\songsection{Worship Songs}

\begin{songs}{}
\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
                     sr={Revelation 5:13},
                     cr={Public domain.},
                     index={Praise God, from Whom all blessings flow}]
\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}

相关内容