Hello Wolfgang.
2010/11/3 Wolfgang Schuster
Am 03.11.2010 um 05:47 schrieb Vladimir Lomov:
Hi.
Some answers I found myself :)
P.S. I have feeling that feature like 'hangaround' doesn't fit well with tex (page layout ...?) model.
\unprotect
\def\stophangaround {\endgraf \egroup}
\def\starthangaround {\dosingleempty\dostarthangaround}
\def\dostarthangaround[#1]% {\doifelse{#1}{\v!right} {\dostartrighthangaround} {\dostartlefthangaround }}
\def\dostartlefthangaround {\noindent\bgroup \dowithnextbox {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}% \getboxheight\scratchdimen\of\box\nextbox \getnoflines\scratchdimen \nextboxht\strutht \nextboxdp\strutdp \hangindent\nextboxwd \hangafter-\noflines \llap{\flushnextbox}\ignorespaces} \hbox}
\def\dostartrighthangaround {\noindent\bgroup \dowithnextbox {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi \setbox\nextbox\hbox{\hskip\@@hadistance\flushnextbox}% \getboxheight\scratchdimen\of\box\nextbox \getnoflines\scratchdimen \nextboxht\strutht \nextboxdp\strutdp \hangindent-\nextboxwd \hangafter-\noflines \rlap{\hskip\hsize\llap{\flushnextbox}}\ignorespaces} \hbox}
\protect
\starttext
\starthangaround{\externalfigure[cow][scale=500]} \input tufte \stophangaround
\blank
\starthangaround[right]{\externalfigure[cow][scale=500]} \input tufte \stophangaround
\stoptext Thank you Wolfgang, nice example, ... of code and output, of course.
Hangaround is a very robust command and works in more cases than \placefigure[left] but you have a conflict with the \item command which place the itemize symbol before the following text which is indented in your case. And even if I use <code> \startitemize[n,inmargin] </code> I got 2 not in margin. Something similar I know about wrapfig package for LaTeX. It could 'wrap' text around figure or table while it couldn't work within list environment (start/stop).
Ok, that only means that I don't understand how lists and this 'environment' work. --- WBR, Vladimir Lomov