From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79767 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Q about hangaround commands Date: Thu, 6 Dec 2012 11:44:07 +0100 Message-ID: <716B08DF-6EBB-49E9-A0A8-A8B9E6F42CFB@gmail.com> References: <4571F63D-01DA-4FBA-9661-72581BDD1A51@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: multipart/mixed; boundary="===============0159827125==" X-Trace: ger.gmane.org 1354790659 2504 80.91.229.3 (6 Dec 2012 10:44:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2012 10:44:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Dec 06 11:44:30 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TgYwQ-0006mr-7C for gctc-ntg-context-518@m.gmane.org; Thu, 06 Dec 2012 11:44:30 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A260810200; Thu, 6 Dec 2012 11:44:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3MntzzNq+W3Z; Thu, 6 Dec 2012 11:44:14 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0ACCC1020E; Thu, 6 Dec 2012 11:44:14 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DCAE41020E for ; Thu, 6 Dec 2012 11:44:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id C3rdb1P8KXjr for ; Thu, 6 Dec 2012 11:44:11 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 5E5E810200 for ; Thu, 6 Dec 2012 11:44:11 +0100 (CET) Original-Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qB6Ai9Pt022555 for ; Thu, 6 Dec 2012 11:44:09 +0100 Original-Received: by mail-we0-f169.google.com with SMTP id t49so3035292wey.14 for ; Thu, 06 Dec 2012 02:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to:x-mailer; bh=hSxzYgjYt0JIk2dzvSaBJW1wO4QgpcodwXWuc7lmfxI=; b=N4UW+dS7PNrReRK8BH02PWP8PrGuldO7sihZEI1q5oA5yb9Bkf5iY5Lc7/XnoZOQ1z 4sSq2rLfyeg6OZkQFI+CxbznBnSjt/HULQszcj3BVJ2LCZPvkGvG2inCxegwh66an0Ph MP9//xNzAA5QBnu3zdGuWDH9gM2neCwB93TwaHK2TECPfxDyCqmcIxt5esnI2EDma6VG llhQa5IZ4JAG8LQPfBhMEUX3KIYRDpY6QqVqXPLvh6WgxKvYaXZ2+q0Xtm6iV/duflmp tesZ2PRlKOmbf7s5+mDJeU74XbkSq840n5Kh8dkU9DgPDKOnz53Z4NjCYi3w50GEoBgl P3bQ== Original-Received: by 10.216.27.81 with SMTP id d59mr420207wea.165.1354790649062; Thu, 06 Dec 2012 02:44:09 -0800 (PST) Original-Received: from dhcp-193-51-32-162.math.uvsq.fr (dhcp-193-51-32-162.math.uvsq.fr. [193.51.32.162]) by mx.google.com with ESMTPS id hv4sm22597820wib.0.2012.12.06.02.44.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Dec 2012 02:44:07 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1499) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QIwaI9FG - 7ca3dc553149 - 20121206 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79767 Archived-At: --===============0159827125== Content-Type: multipart/alternative; boundary="Apple-Mail=_13C98980-D3BE-48F4-8BDB-04F8E5E65249" --Apple-Mail=_13C98980-D3BE-48F4-8BDB-04F8E5E65249 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Hi Mikael, The example given by Wolfgang works fine for me with mkii, but not in = mkiv: probably something has changed in mkiv, for example the way = [scale=3D500] must be used in mkiv. Best regards: OK On 6 d=E9c. 2012, at 10:58, "Mikael P. Sundqvist" = wrote: > On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster = wrote: >=20 > Am 03.11.2010 um 05:47 schrieb Vladimir Lomov: >=20 > > Hi. > > > > Some answers I found myself :) > > > > P.S. I have feeling that feature like 'hangaround' doesn't fit well > > with tex (page layout ...?) model. >=20 > 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. >=20 > \unprotect >=20 > \def\stophangaround > {\endgraf > \egroup} >=20 > \def\starthangaround > {\dosingleempty\dostarthangaround} >=20 > \def\dostarthangaround[#1]% > {\doifelse{#1}{\v!right} > {\dostartrighthangaround} > {\dostartlefthangaround }} >=20 > \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} >=20 > \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} >=20 > \protect >=20 > \starttext >=20 > \starthangaround{\externalfigure[cow][scale=3D500]} > \input tufte > \stophangaround >=20 > \blank >=20 > \starthangaround[right]{\externalfigure[cow][scale=3D500]} > \input tufte > \stophangaround >=20 > \stoptext >=20 > Wolfgang >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ >=20 > Dear ConTeXt list, >=20 > I apologize for digging up an old thread. I was searching for = \starthangaround[right] and found this thread. I tried the code that = Wolfgang gave in this thread but I guess something has changed since = then, because it does not work with latest minimals. Would it be = possible to get (a working) version of \starthangaround[right]? I think = it even would be nice to have it in the core. >=20 > As a minimal nonworking example, see the email from Wolgang in this = thread. >=20 > With best regards, Mikael > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_13C98980-D3BE-48F4-8BDB-04F8E5E65249 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 Hi = Mikael,

The example given by Wolfgang works fine for = me with mkii, but not in mkiv: probably something has changed in mkiv, = for example the way [scale=3D500] must be used in = mkiv.

Best regards: = OK

On 6 d=E9c. 2012, at 10:58, "Mikael P. = Sundqvist" <mickep@gmail.com> = wrote:

On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> = wrote:

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.

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.

\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<= br>       = \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<= br>       = \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=3D500]}
\input tufte
\stophangaround

\blank

\starthangaround[right]{\externalfigure[cow][scale=3D500]}
\input tufte
\stophangaround

\stoptext

Wolfgang

= __________________________________________________________________________= _________
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
= __________________________________________________________________________= _________

Dear ConTeXt list,

I apologize = for digging up an old thread. I was searching for = \starthangaround[right] and found this thread. I tried the code that = Wolfgang gave in this thread but I guess something has changed since = then, because it does not work with latest minimals. Would it be = possible to get (a working) version of \starthangaround[right]? I think = it even would be nice to have it in the core.

As a minimal nonworking example, see the email from Wolgang in this = thread.

With best regards, Mikael
= __________________________________________________________________________= _________
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.sup= elec.fr/projects/contextrev/
wiki     : http://contextgarden.net
________= __________________________________________________________________________= _

= --Apple-Mail=_13C98980-D3BE-48F4-8BDB-04F8E5E65249-- --===============0159827125== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0159827125==--