Re: Graphicx TeXnicians: Best way to find finished size of included graphic?
- From: Jonathan Fine <jfine@xxxxxxxxx>
- Date: Tue, 31 Jan 2006 09:04:03 +0000
Tim Arnold wrote:
<daveandes@xxxxxxxxxxx> wrote in message news:1138653227.443585.294660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm hoping someone might help me find a (relatively) easy solution to a
big graphicx problem!
I'm wondering if there's a decent way to figure out what size the graphic is _before_ calling \includegraphics. I envision a macro, maybe called \getgraphicsize, that would read the file and get its size. Optionally, it would provide the finished size after transformations when called with optional parameters; i.e. \getgraphicsize[scale=0.8]{mygraphic}. Then I could use the dimensions to somehow select which environment I want to call.
Thanks for any suggestions you might have...
David
hi,
This is what I would do: \newsavebox{\graphbox} \savebox{\graphbox}{\includegraphics[scale=.75]{filename}} and then use \ifthenelse with \wd\graphbox to decide on which of your environments to use.
btw, you can then \usebox since you've already loaded your graphic.
In addition to Tim's excellent suggestion, you might try something like $ grep BoundingBox *.eps
This would allow you to get some sense of the sizes presented.
(Apologies if you've thought of this already.)
-- Jonathan
.
- References:
- Prev by Date: Re: Not impressed with pdflatex
- Next by Date: (rounded) multi-page frame
- Previous by thread: Re: Graphicx TeXnicians: Best way to find finished size of included graphic?
- Next by thread: Newbie Question: Indents in \tableofcontents
- Index(es):
Relevant Pages
|