I am trying to include a png with a tablature in a song in my chord book which uses the leadsheets package. However, the file fails to compile once I add \includegraphics inside the song environment. Outside it works fine, therefore the image actually exists and can be found by LaTeX. Is there some way to get around this and include an image in a song? I have also tried putting the image inside environments like verse or intro nested inside a song environment.

Minimum working example (needs an image file in the folder ./Images/my_image.png):

\documentclass[a4paper, 8pt]{book}

\usepackage{leadsheets} %songbook functionality, chords ...

    % 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}}

The error log contains these lines, which should be the relevant ones:

("C:\Users\Taxel\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\etexcmd
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
Package grfext Info: Graphics extension search list:
(grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE
(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 Answer 1


File names with special characters, such as _ can be tricky in some cases. Best stay on the safe side and avoid them.

If I rename my_image to my-image your example works fine.

You must log in to answer this question.

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