ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vladimir Lomov <lomov.vl@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Q about hangaround commands
Date: Wed, 3 Nov 2010 15:28:54 +0800	[thread overview]
Message-ID: <AANLkTi=QXHC4Ny3dOtS2ad=OUa+5h8ZBg8K6dv-_haQ2@mail.gmail.com> (raw)
In-Reply-To: <4571F63D-01DA-4FBA-9661-72581BDD1A51@gmail.com>

Hello Wolfgang.

2010/11/3 Wolfgang Schuster <schuster.wolfgang@googlemail.com>:
>
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2010-11-03  7:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26  6:26 Vladimir Lomov
2010-11-03  4:47 ` Vladimir Lomov
2010-11-03  6:51   ` Wolfgang Schuster
2010-11-03  7:28     ` Vladimir Lomov [this message]
2012-12-06  9:58     ` Mikael P. Sundqvist
2012-12-06 10:44       ` Otared Kavian
2012-12-06 16:53         ` Mikael P. Sundqvist
2012-12-06 17:23         ` Wolfgang Schuster
2012-12-06 16:57       ` Hans Hagen
2012-12-06 17:49         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=QXHC4Ny3dOtS2ad=OUa+5h8ZBg8K6dv-_haQ2@mail.gmail.com' \
    --to=lomov.vl@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).