2

I'm using the graphicx package with

\begin{center}
\makebox[0pt][c]{\includegraphics[scale=0.5]{example2.2}}
\end{center}

to insert images into my LaTeX file.

However, I get an error because of the "." in the image file name "example2.2". If I change it to "example2", then it works fine. Is there any way to use file names with periods in them without getting an error?

3 Answers3

5

The grffile package was born mainly for this purpose.

\documentclass{article}
\usepackage{graphicx,grffile}

\begin{document}

\includegraphics{example2.2}

\end{document}
egreg
  • 1,121,712
4

Yes, use this

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{{example2.2}.png}
\end{document}

if png file etc...

enter image description here

1

This will probably break all sorts of things, but...

\documentclass{article}
\usepackage{graphicx}
\def\.{.}
\catcode`.\active\def.{\.}
\begin{document}
\includegraphics{example2.2}
\end{document}
Ian Thompson
  • 43,767