[OS X TeX] List items wrapped around figures?
Thomas Rike
tricycle222 at earthlink.net
Mon Nov 27 20:30:06 EST 2006
On Nov 27, 2006, at 1:41 PM, Jeffrey Weimer wrote:
> 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-695
J.J.
Thanks for posting this very nice procedure. It is what I have wanted
since I had to leave Textures. I answered David off-list with my way
of doing it using picins and minipage, but it was cumbersome and
needed to be fine-tuned. I did spend a lot of time trying to get your
to work without success until I discovered that \ifthenelse is not
part of LaTeX, so one must \usepackage{ifthen} and then it works like
a charm. I don't know if this is because I just switched to TeXLive.
Maybe \ifthenelse is part of teTeX.
Another pointer for those switching to TeXLive, my first attempt to
use it after downloading failed because the package picins is not
part of TeXLive due to a licensing problem. I don't know about that
stuff, but I was able to download picins.sty and put it in my home
directory( /Users/trike/Library/texmf/tex/latex/picins.sty) It was a
bit disconcerting since I use it as part of my preamble for almost
everything I do in LaTeX, but now everything is working fine.
Tom Rike
------------------------- 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