Graphics, Figures & TablesAutomatically detecting wrapfigure width?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
crispy_chunks
Posts: 11
Joined: Wed Oct 27, 2010 2:59 pm

Automatically detecting wrapfigure width?

Post by crispy_chunks »

Hi, for the concern of my reader I will wrap some pictures in my text with \wrapfigure. Typically the code for this would looke like:

Code: Select all

\begin{wrapfigure}{l}{5cm}
 \centering
 \includegraphics[scale=\highresscaledown,keepaspectratio=true]{../Images/(E)-3-methyl-4-nitro-5-styrylisoxazole.png}
 % (E)-3-methyl-4-nitro-5-styrylisoxazole.png: 2069x1101 pixel, 96dpi, 54.74x29.13 cm, bb=0 0 1552 826
\end{wrapfigure}
Now the problem is I will have, maybe 30 of these wrapped pictures, and I need them to scale the same way. I can easily define the scale for \includegraphics to use (so I can control the scale of all the pictures at once.), but I would like wrapfigure to also allocate enough space in the text for the picture bases on this scale. The pictures will have variable length. Is there a way for wrapfigure to automatically detect how much space it needs to allocate for the wrapped picture? I have experimented with the calc package and \setlength but have not come up with a solution.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

johnjamessmith0
Posts: 37
Joined: Sun Mar 29, 2009 1:41 am

Automatically detecting wrapfigure width?

Post by johnjamessmith0 »

I don't have much time right now, but I think you should be able to do what you want with a savebox. See http://lglinux.blogspot.com/2008/01/mea ... vebox.html. Good luck.
Post Reply