[OS X TeX] List items wrapped around figures?
Jeffrey Weimer
weimerj at email.uah.edu
Mon Nov 27 16:41:04 EST 2006
On Nov 24, 2006, at 9:45 PM, david craig wrote:
> What I want is to place figures (preferably with \includegraphics),
> usually on the right, top aligned with the first line of the list
> item, with the list item text wrapped around it. It has to play
> nice with what follows -- I often have
...
> Any suggestions? Help!
I use the code below. It may not always align exactly with the top of
the first text line for the item .. you might be able to adjust this
with \vspace*{...} commands. The figure ALWAYS appears on the right.
This should be changable by interchanging the two \parbox{} commands
within the entire command itself.
I would not swear that this code will "place nice" with multiply
nested \item lists ... you will certainly have to balance everything
carefully within the {text} portion of the command.
The command requires the graphix package.
Example use is as follows:
\begin{enumerate}
\item \putitemfig[0.5]{0.45}{myfigure}{The figure on the right is my
figure.}
...
\end{enumerate}
Hope this helps.
%% *****
%% \putitemfig[figwidthfactor]{textwidthffactor}{figname}{text}
%% [figwidthfactor] - size of figure (as fraction of its natural size!)
%% default 0 - graphic is put at its natural size
%% {textwidthfactor} - size of text (as fraction of textwidth)
%% figname - full path to figure (generally without extension)
%% {text} - text (always put on left side)
\newcommand{\putitemfig}[4][0]{%
\begin{minipage}[t][\height][t]{\textwidth}
\parbox[t]{#2\textwidth}{#4}
\hspace*{5mm}
\parbox[t][\height][b]{0pt}{%
\ifthenelse{\equal{#1}{0}}%
{{\includegraphics{#3}}}
{{\includegraphics[width=#1\textwidth]{#3}}}
}
\\ \mbox{}
\end{minipage}
}
--
J. J. Weimer, Chemistry / Chemical & Materials Engineering
University of Alabama in Huntsville, MSB 125, 301 Sparkman Dr
Huntsville, AL 35899 phone: 256-824-6954
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the MacOSX-TeX
mailing list