我试图在使用该软件包的和弦书中的一首歌曲中包含一个带有指法谱的 png 。但是,一旦我将其添加到环境中leadsheets
,文件就无法编译。在环境之外,它工作正常,因此图像确实存在并且可以被 LaTeX 找到。有没有办法解决这个问题并在歌曲中包含图像?我也尝试过将图像放在环境中,例如或嵌套在环境中。\includegraphics
song
verse
intro
song
最小工作示例(需要文件夹 ./Images/my_image.png 中的图像文件):
\documentclass[a4paper, 8pt]{book}
\usepackage{leadsheets} %songbook functionality, chords ...
\usepackage{graphicx}
\begin{document}
% if you uncomment this and comment out the other lines, it works -> The image is actually in the specified path
% \includegraphics{./Images/my_image}
\begin{song}{title={My song}}
\includegraphics{./Images/my_image}
\end{song}
\end{document}
错误日志包含这些行,应该是相关的行:
("C:\Users\Taxel\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\etexcmd
s.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
38.
Package grfext Info: Graphics extension search list:
(grfext) [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext) \AppendGraphicsExtensions on input line 456.
)
! LaTeX Error: File `./Images/my_image' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.12 \end{song}
答案1
文件名中包含特殊字符,例如_
在某些情况下可能会很棘手。最好谨慎行事,避免使用它们。
如果我重命名my_image
您my-image
的示例,效果就会很好。