Menu

#2118 Includegraphics with identical file name but different type

None
wont-fix
nobody
5*
2017-04-15
2017-03-21
Anonymous
No

I was using the built-in functionality to drag and drop graphics into my LaTeX document. I noticed that the code used strips the file extension. After some testing, I discovered that if I have two files with identical names and different extensions in the same folder, for example jpg and png, this creates the following scenario:
1. If I include the png in the document and then later delete it, it gets replaced by the jpg file after building and compiling.
2. Deleting both of the files is the first time it will throw an error about the file not being found.

This is not standard behavior, as I tested it in TeXWorks and there the extension is included in the \includegraphics parameter and deleting the files throws an error.

Discussion

  • Tim Hoffmann

    Tim Hoffmann - 2017-04-09

    According to https://en.wikibooks.org/wiki/LaTeX/Importing_Graphics#Including_graphics removing extensions is the recommended behavior:

    The argument in the curly braces is the name of the image. Write it without the extension.

     

    Last edit: Tim Hoffmann 2017-04-09
  • Tim Hoffmann

    Tim Hoffmann - 2017-04-15
    • status: open --> wont-fix
    • Group: -->
     

Log in to post a comment.