While the question is answered for the generic case - I often have a case, where I have files with constant (unchanging), yet unstandard extensions; and where I'd like to use these files as input "as is" to pdflatex in a batch script context (meaning, I wouldn't want to code any parsing logic in respect to filenames, either in the Latex code, or the batch code).
For instance, the usual \includegraphics{mydir/file01.csv_.pdf} would fail with:
! LaTeX Error: Unknown graphics extension: .csv_.pdf.
One thing that works, is as per the answer by @DavidCarlisle:
\includegraphics[ext=.csv_.pdf,type=pdf,read=*]{mydir/file01}
... but this requires me to strip the extension from the filename, so I'd have to introduce filename parsing logic somewhere.
However, what really works for me is using \DeclareGraphicsRule{ext}{type}{read-file}{command} (see grfguide.pdf: Packages in the 'graphics' bundle):
% preamble:
\DeclareGraphicsRule{.csv_.pdf}{pdf}{*}{}
% ...
\begin{document}
% ...
\includegraphics{mydir/file01.csv_.pdf}
... and this seems to work fine, without any changes to the filename argument of \includegraphics. Note that command argument can be left empty (it's for a system conversion otherwise), and read-file is where do we read the size/bounding box information from: since the .csv_.pdf is a .pdf file proper, with * we simply say - read the size from the same file that has matched the declared extension.
grffileeasier as it provides other features too (like spaces in filenames). – Martin Schröder Dec 31 '11 at 11:46/dir/{name.with.dots}.pdf, but that is no longer the case in recent versions of latex. – Marten Dec 09 '20 at 22:49.pngor.pdf) in the argument and the base filename has dots (as intrajectoryAtg=9.8). I generally export my graphics in two extensions.pngand.pdffor quick viewing in file explorer and for publication respectively. To avoid errors, declare the extensions apriorily in the preamble\DeclareGraphicsExtensions{.pdf, .png, .jpg}. For more informaton, please refer Section 4.5 of graphics package user manual – baalkikhaal Mar 03 '21 at 13:01\includegraphics{/dir/{name.with.dots}.pdf}indeed solves the compilation error with on Debian buster (texlive 2018.20190227-2), while the curly brackets are not necessary anymore on Debian bullseye (texlive 2020.20210202-3). I've not yet made the reverse test (do the addition of{...}breaks the compilation on more recent texlive?) – Pierre H. Oct 07 '21 at 12:47