Which file does includegraphics select if there are multiple files with different extensions? [duplicate]












5
















This question already has an answer here:




  • Graphics file extensions and their order of inclusion when not specified

    2 answers




We usually write something like



includegraphics{image}


instead of:



includegraphics{image.png}  


That is, includegraphics does not usually require a file extension such as .png .pdf .jpg, etc... That is,



Suppose that I have all of the following files in the same directory. Which file will includegraphics embed?



my_pic.jpg
my_pic.psd
my_pic.png
my_pic.pdf
my_pic.jpeg
my_pic.gif


Document:



documentclass{minimal}
begin{document}
begin{figure}[htpb]
centering
includegraphics[width=linewidth]{my_pic}
caption{Sunshine and Rainbows}
Description{summertime}
end{figure}
end{document}









share|improve this question









New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Werner, Kurt, Troy, marmot, Stefan Pinnow 10 mins ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • ! LaTeX Error: Environment figure undefined

    – David Carlisle
    10 hours ago
















5
















This question already has an answer here:




  • Graphics file extensions and their order of inclusion when not specified

    2 answers




We usually write something like



includegraphics{image}


instead of:



includegraphics{image.png}  


That is, includegraphics does not usually require a file extension such as .png .pdf .jpg, etc... That is,



Suppose that I have all of the following files in the same directory. Which file will includegraphics embed?



my_pic.jpg
my_pic.psd
my_pic.png
my_pic.pdf
my_pic.jpeg
my_pic.gif


Document:



documentclass{minimal}
begin{document}
begin{figure}[htpb]
centering
includegraphics[width=linewidth]{my_pic}
caption{Sunshine and Rainbows}
Description{summertime}
end{figure}
end{document}









share|improve this question









New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Werner, Kurt, Troy, marmot, Stefan Pinnow 10 mins ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • ! LaTeX Error: Environment figure undefined

    – David Carlisle
    10 hours ago














5












5








5









This question already has an answer here:




  • Graphics file extensions and their order of inclusion when not specified

    2 answers




We usually write something like



includegraphics{image}


instead of:



includegraphics{image.png}  


That is, includegraphics does not usually require a file extension such as .png .pdf .jpg, etc... That is,



Suppose that I have all of the following files in the same directory. Which file will includegraphics embed?



my_pic.jpg
my_pic.psd
my_pic.png
my_pic.pdf
my_pic.jpeg
my_pic.gif


Document:



documentclass{minimal}
begin{document}
begin{figure}[htpb]
centering
includegraphics[width=linewidth]{my_pic}
caption{Sunshine and Rainbows}
Description{summertime}
end{figure}
end{document}









share|improve this question









New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













This question already has an answer here:




  • Graphics file extensions and their order of inclusion when not specified

    2 answers




We usually write something like



includegraphics{image}


instead of:



includegraphics{image.png}  


That is, includegraphics does not usually require a file extension such as .png .pdf .jpg, etc... That is,



Suppose that I have all of the following files in the same directory. Which file will includegraphics embed?



my_pic.jpg
my_pic.psd
my_pic.png
my_pic.pdf
my_pic.jpeg
my_pic.gif


Document:



documentclass{minimal}
begin{document}
begin{figure}[htpb]
centering
includegraphics[width=linewidth]{my_pic}
caption{Sunshine and Rainbows}
Description{summertime}
end{figure}
end{document}




This question already has an answer here:




  • Graphics file extensions and their order of inclusion when not specified

    2 answers








includegraphics






share|improve this question









New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 14 hours ago









Sigur

24.4k355138




24.4k355138






New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 14 hours ago









IdleCustardIdleCustard

1456




1456




New contributor




IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






IdleCustard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by Werner, Kurt, Troy, marmot, Stefan Pinnow 10 mins ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Werner, Kurt, Troy, marmot, Stefan Pinnow 10 mins ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • ! LaTeX Error: Environment figure undefined

    – David Carlisle
    10 hours ago



















  • ! LaTeX Error: Environment figure undefined

    – David Carlisle
    10 hours ago

















! LaTeX Error: Environment figure undefined

– David Carlisle
10 hours ago





! LaTeX Error: Environment figure undefined

– David Carlisle
10 hours ago










2 Answers
2






active

oldest

votes


















9














It depends on the engine. With pdftex the current list (which you can find in pdftex.def) is:



defGin@extensions{%
.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
}


That means that e.g. pdf will be prefered, then png etc.






share|improve this answer



















  • 1





    Very useful. It could be in graphicx documentation.

    – Sigur
    13 hours ago











  • I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

    – Bakuriu
    12 hours ago











  • @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

    – Ulrike Fischer
    12 hours ago






  • 1





    @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

    – David Carlisle
    10 hours ago



















3














As documented in the graphics guide (section 4.5), this is user settable.



If you have



DeclareGraphicsExtensions{.pdf,.png}


in your document then it will just try .pdf then .png in that order, and ignore the rest.



The default value as shown in Ulrike's answer is set in the driver file for the option you are using. (Using a lower level def syntax rather than DeclareGraphicsExtensions because the driver files might be loaded by the color package, before DeclareGraphicsExtensions is defined.)






share|improve this answer






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    9














    It depends on the engine. With pdftex the current list (which you can find in pdftex.def) is:



    defGin@extensions{%
    .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
    .PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
    }


    That means that e.g. pdf will be prefered, then png etc.






    share|improve this answer



















    • 1





      Very useful. It could be in graphicx documentation.

      – Sigur
      13 hours ago











    • I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

      – Bakuriu
      12 hours ago











    • @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

      – Ulrike Fischer
      12 hours ago






    • 1





      @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

      – David Carlisle
      10 hours ago
















    9














    It depends on the engine. With pdftex the current list (which you can find in pdftex.def) is:



    defGin@extensions{%
    .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
    .PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
    }


    That means that e.g. pdf will be prefered, then png etc.






    share|improve this answer



















    • 1





      Very useful. It could be in graphicx documentation.

      – Sigur
      13 hours ago











    • I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

      – Bakuriu
      12 hours ago











    • @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

      – Ulrike Fischer
      12 hours ago






    • 1





      @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

      – David Carlisle
      10 hours ago














    9












    9








    9







    It depends on the engine. With pdftex the current list (which you can find in pdftex.def) is:



    defGin@extensions{%
    .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
    .PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
    }


    That means that e.g. pdf will be prefered, then png etc.






    share|improve this answer













    It depends on the engine. With pdftex the current list (which you can find in pdftex.def) is:



    defGin@extensions{%
    .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
    .PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
    }


    That means that e.g. pdf will be prefered, then png etc.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 13 hours ago









    Ulrike FischerUlrike Fischer

    188k7292673




    188k7292673








    • 1





      Very useful. It could be in graphicx documentation.

      – Sigur
      13 hours ago











    • I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

      – Bakuriu
      12 hours ago











    • @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

      – Ulrike Fischer
      12 hours ago






    • 1





      @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

      – David Carlisle
      10 hours ago














    • 1





      Very useful. It could be in graphicx documentation.

      – Sigur
      13 hours ago











    • I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

      – Bakuriu
      12 hours ago











    • @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

      – Ulrike Fischer
      12 hours ago






    • 1





      @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

      – David Carlisle
      10 hours ago








    1




    1





    Very useful. It could be in graphicx documentation.

    – Sigur
    13 hours ago





    Very useful. It could be in graphicx documentation.

    – Sigur
    13 hours ago













    I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

    – Bakuriu
    12 hours ago





    I always wondered: what's the point of this? Why doesn't it simply accept the full name of the file?

    – Bakuriu
    12 hours ago













    @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

    – Ulrike Fischer
    12 hours ago





    @Bakuriu it does accept the full name of the file. example-image.pdf works fine.

    – Ulrike Fischer
    12 hours ago




    1




    1





    @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

    – David Carlisle
    10 hours ago





    @Sigur the user documentation tells you how to set the list texdoc graphics section 4.5 DeclareGraphicsExtensions the default is driver specific and initially there were dozens of different drivers they are not documented in the core documentation.

    – David Carlisle
    10 hours ago











    3














    As documented in the graphics guide (section 4.5), this is user settable.



    If you have



    DeclareGraphicsExtensions{.pdf,.png}


    in your document then it will just try .pdf then .png in that order, and ignore the rest.



    The default value as shown in Ulrike's answer is set in the driver file for the option you are using. (Using a lower level def syntax rather than DeclareGraphicsExtensions because the driver files might be loaded by the color package, before DeclareGraphicsExtensions is defined.)






    share|improve this answer




























      3














      As documented in the graphics guide (section 4.5), this is user settable.



      If you have



      DeclareGraphicsExtensions{.pdf,.png}


      in your document then it will just try .pdf then .png in that order, and ignore the rest.



      The default value as shown in Ulrike's answer is set in the driver file for the option you are using. (Using a lower level def syntax rather than DeclareGraphicsExtensions because the driver files might be loaded by the color package, before DeclareGraphicsExtensions is defined.)






      share|improve this answer


























        3












        3








        3







        As documented in the graphics guide (section 4.5), this is user settable.



        If you have



        DeclareGraphicsExtensions{.pdf,.png}


        in your document then it will just try .pdf then .png in that order, and ignore the rest.



        The default value as shown in Ulrike's answer is set in the driver file for the option you are using. (Using a lower level def syntax rather than DeclareGraphicsExtensions because the driver files might be loaded by the color package, before DeclareGraphicsExtensions is defined.)






        share|improve this answer













        As documented in the graphics guide (section 4.5), this is user settable.



        If you have



        DeclareGraphicsExtensions{.pdf,.png}


        in your document then it will just try .pdf then .png in that order, and ignore the rest.



        The default value as shown in Ulrike's answer is set in the driver file for the option you are using. (Using a lower level def syntax rather than DeclareGraphicsExtensions because the driver files might be loaded by the color package, before DeclareGraphicsExtensions is defined.)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 10 hours ago









        David CarlisleDavid Carlisle

        484k4111171859




        484k4111171859















            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀