我遵循 Overleaf 的“子文件”示例
... 还有一些“诗歌”和“歌曲”包的例子
子文件运行良好,但当由 main.tex 调用时,歌曲包无法正常工作
这在 Latex 中很常见吗?例如,软件包不能与“子文件”一起使用
主文本
\documentclass{article}
\usepackage{subfiles}
\title{Subfiles package example}
\author{Overleaf}
\date{ }
\begin{document}
\maketitle
\section{Poems}
\subfile{sections/poems}
%\pagebreak
\section{Songs}
\subfile{sections/cords}
\end{document}
cords.tex
\documentclass[../main]{subfiles}
\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.},
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}
诗歌.tex
\documentclass[../main]{subfiles}
\usepackage{verse}
\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)}
\end{document}