Graphics, Figures & TablesGraphics with periods in the name

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Lindley
Posts: 3
Joined: Sat Feb 27, 2010 1:40 am

Graphics with periods in the name

Post by Lindley »

Is there a way to \includegraphics{A.png.png}, for instance?

In this case, I'm analyzing a particular graphic, and then generating others based on it. I could excise the first extension from the new names, but I didn't this time. Is there a way to display the images in a LaTeX document, or do I have to go back and re-name everything manually?

Also, when I display a graphic, I'd like to have a bit of blank space around it on all 4 sides. A \framebox does exactly what I want, except that I'd rather not have the frame itself. I looked around but couldn't figure out a way to do something equivalent without the frame. Any suggestions?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Graphics with periods in the name

Post by frabjous »

Lindley wrote:Is there a way to \includegraphics{A.png.png}, for instance?

In this case, I'm analyzing a particular graphic, and then generating others based on it. I could excise the first extension from the new names, but I didn't this time. Is there a way to display the images in a LaTeX document, or do I have to go back
and re-name everything manually?
I'm not exactly sure what you're asking, but try adding this to your preamble:

\DeclareGraphicsRule{.png.png}{png}{.png.png}{}

That should tell it to treat the .png.png extension as .png.

But even if you did want to rename everything, you shouldn't have to do it manually! You can batch rename... even on lowly old windows.
Also, when I display a graphic, I'd like to have a bit of blank space around it on all 4 sides. A \framebox does exactly what I want, except that I'd rather not have the frame itself. I looked around but couldn't figure out a way to do something equivalent without the frame. Any suggestions?
The \makebox command is exactly like \framebox without the frame. There are other ways of doing this too.
Lindley
Posts: 3
Joined: Sat Feb 27, 2010 1:40 am

Re: Graphics with periods in the name

Post by Lindley »

Hmm, that's useful to know, but it probably doesn't help much in my situation since I can't predict all extensions (there's a float value in the filename too, I just didn't mention that for brevity). I'll need to work something else out, then.

I know the \makebox documentation says it's identical to \framebox, but it sure didn't look that way when I tested it. I didn't see the whitespace border I was hoping for, and the graphics were still obscuring the table hlines (which is what I wanted to avoid).
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Graphics with periods in the name

Post by frabjous »

Does the \DeclareGraphicsRule command help with the .png.png problem?

As for your other problem, we'd need to see some sample code, in the form of a minimal working example.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Graphics with periods in the name

Post by phi »

use the grffile package
Lindley
Posts: 3
Joined: Sat Feb 27, 2010 1:40 am

Re: Graphics with periods in the name

Post by Lindley »

I just re-ran the C++ program which generates my Latex code and the images in question, making sure I modified the filenames to avoid the problem.

The \framebox/makebox issue still persists, but I'm not worrying about it for now.
Post Reply