ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Q about hangaround commands
@ 2010-10-26  6:26 Vladimir Lomov
  2010-11-03  4:47 ` Vladimir Lomov
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Lomov @ 2010-10-26  6:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

Hi.

I'm trying to figure out the limitation of \start/stophangaround commands.

1. Is it correct that currently the figure could be placed only on
left? If so is it easy to extend the command to allow placing figure
at right side?
2. Is there way to increase/decrease the space between the text and image?
3. Is it correct that hangaround command is tricky hack that change normal flow?

I prepare simple example (it is attached). 1) is obvious from the
example (default behavior I assume). 3): I got the '2.' not on left
side as 1) and 3) but on left side of text block right after image.
Another example if 3): if I put empty line between \starthangaround
and \input (see the file) then there would be mess.

P.S. I tried the example with MkIV only.
---
WBR, Vladimir Lomov

[-- Attachment #2: ex1.tex --]
[-- Type: application/x-tex, Size: 262 bytes --]

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2010-10-26  6:26 Q about hangaround commands Vladimir Lomov
@ 2010-11-03  4:47 ` Vladimir Lomov
  2010-11-03  6:51   ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Lomov @ 2010-11-03  4:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi.

Some answers I found myself :)

2010/10/26 Vladimir Lomov <lomov.vl@gmail.com>:
> Hi.
>
> I'm trying to figure out the limitation of \start/stophangaround commands.
>
> 1. Is it correct that currently the figure could be placed only on
> left? If so is it easy to extend the command to allow placing figure
> at right side?
> 2. Is there way to increase/decrease the space between the text and image?
> 3. Is it correct that hangaround command is tricky hack that change normal flow?
2. -> \setuphanging[desitance=0.7em], for example.
3. -> To make '2.' appear on left side it is enough to put empty line
between \item and
\starthangaround. IMHO, this is workaround, not solution.

P.S. I have feeling that feature like 'hangaround' doesn't fit well
with tex (page layout ...?) model.

---
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2010-11-03  4:47 ` Vladimir Lomov
@ 2010-11-03  6:51   ` Wolfgang Schuster
  2010-11-03  7:28     ` Vladimir Lomov
  2012-12-06  9:58     ` Mikael P. Sundqvist
  0 siblings, 2 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2010-11-03  6:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
      \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

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2010-11-03  6:51   ` Wolfgang Schuster
@ 2010-11-03  7:28     ` Vladimir Lomov
  2012-12-06  9:58     ` Mikael P. Sundqvist
  1 sibling, 0 replies; 10+ messages in thread
From: Vladimir Lomov @ 2010-11-03  7:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2010-11-03  6:51   ` Wolfgang Schuster
  2010-11-03  7:28     ` Vladimir Lomov
@ 2012-12-06  9:58     ` Mikael P. Sundqvist
  2012-12-06 10:44       ` Otared Kavian
  2012-12-06 16:57       ` Hans Hagen
  1 sibling, 2 replies; 10+ messages in thread
From: Mikael P. Sundqvist @ 2012-12-06  9:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3009 bytes --]

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
>       \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
>
> 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

[-- Attachment #1.2: Type: text/html, Size: 4083 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  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
  1 sibling, 2 replies; 10+ messages in thread
From: Otared Kavian @ 2012-12-06 10:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3921 bytes --]

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=500] must be used in mkiv.

Best regards: OK

On 6 déc. 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
>       \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
> 
> 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.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5968 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2012-12-06 10:44       ` Otared Kavian
@ 2012-12-06 16:53         ` Mikael P. Sundqvist
  2012-12-06 17:23         ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Mikael P. Sundqvist @ 2012-12-06 16:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 4918 bytes --]

On Thu, Dec 6, 2012 at 11:44 AM, Otared Kavian <otared@gmail.com> wrote:

> 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=500] must be used in mkiv.
>
> Best regards: OK
>
> On 6 déc. 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
>>       \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
>>
>> 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.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>
>
>
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

Hi Otared,

thank you for your answer. I work in mkiv, so I have to wait for a fix if
there will be one.

(I work in a two-column document, so \placefigure[right]... does not work,
it seems, otherwise I could have used that)

Best regards, Mikael

[-- Attachment #1.2: Type: text/html, Size: 6959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2012-12-06  9:58     ` Mikael P. Sundqvist
  2012-12-06 10:44       ` Otared Kavian
@ 2012-12-06 16:57       ` Hans Hagen
  2012-12-06 17:49         ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-12-06 16:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael P. Sundqvist

On 12/6/2012 10:58 AM, Mikael P. Sundqvist wrote:
> On Wed, Nov 3, 2010 at 7:51 AM, Wolfgang Schuster
> <schuster..wolfgang@googlemail.com
> <mailto: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
>            \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

as mkiv has a starthangaround but uses a different parameter handler, 
this works:

\unexpanded\def\starthangaround
   {\dontleavehmode\bgroup
    \dosingleempty\spac_hanging_around_start}

\def\spac_hanging_around_start[#1]%
   {\edef\m_spac_hanging_location{#1}%
    \dowithnextboxcs\spac_hanging_around_finish\hbox}

\def\spac_hanging_around_finish
   {\scratchdistance\directhangingparameter\c!distance\relax
    \ifdim\ht\nextbox>\strutht
      \setbox\nextbox\tbox{\box\nextbox}%
    \fi
    \getboxheight\scratchdimen\of\box\nextbox
    \getnoflines\scratchdimen
    \ht\nextbox\strutht
    \dp\nextbox\strutdp
    \hangafter-\noflines
    \scratchwidth\dimexpr\wd\nextbox+\scratchdistance\relax
    \ifx\m_spac_hanging_location\v!right
      \hangindent-\scratchwidth
      \rlap{\hskip\dimexpr\hsize-\wd\nextbox\relax\box\nextbox}%
    \else
      \hangindent\scratchwidth
      \llap{\box\nextbox\hskip\scratchdistance}%
    \fi
    \ignorespaces}

i adapted the core code

>     Wolfgang
>
>     ___________________________________________________________________________________
>     If your question is of interest to others as well, please add an
>     entry to the Wiki!
>
>     maillist : ntg-context@ntg.nl <mailto: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.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2012-12-06 10:44       ` Otared Kavian
  2012-12-06 16:53         ` Mikael P. Sundqvist
@ 2012-12-06 17:23         ` Wolfgang Schuster
  1 sibling, 0 replies; 10+ messages in thread
From: Wolfgang Schuster @ 2012-12-06 17:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian


Am 06.12.2012 um 11:44 schrieb Otared Kavian <otared@gmail.com>:

> 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=500] must be used in mkiv.

The definitions of commands/environments have changed in MkIV, as you can see in the following example there are differences between the MkII and MkIV version of the same command.

\starttexcode

\def\mkiiemphasized
  {\dosingleempty\domkiiemphasized}

\def\domkiiemphasized[#1]#2%
  {\getrawparameters[mkiiemphasized][style=,color=,#1]
   \doattributes{mkiiemphasized}{style}{color}{#2}}

\def\mkivemphasized
  {\dosingleempty\mkivemphasized_direct}

\def\mkivemphasized_direct[#1]#2%
  {\begingroup
   \getdummyparameters[#1]%
   \usedummystyleandcolor\c!style\c!color
   #2%
   \endgroup}

\stoptexcode

\starttext
\mkiiemphasized[style=bold,color=green]{\MKII}
\mkivemphasized[style=italic,color=red]{\MKIV}
\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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Q about hangaround commands
  2012-12-06 16:57       ` Hans Hagen
@ 2012-12-06 17:49         ` Hans Hagen
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2012-12-06 17:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael P. Sundqvist

Hi,

I combined some functionality into:

\showframe

\starttext

\starthanging{\externalfigure[cow][scale=500]}
     \input tufte
\stophanging

\blank

\starthanging[right]{\externalfigure[cow][scale=500]}
     \input tufte
\stophanging

\blank

\starthanging[location=right,n=2,distance=1cm]{\externalfigure[cow][scale=500]}
     \input tufte
\stophanging

\stoptext

after all, these were yet unofficial commands

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-06 17:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26  6:26 Q about hangaround commands Vladimir Lomov
2010-11-03  4:47 ` Vladimir Lomov
2010-11-03  6:51   ` Wolfgang Schuster
2010-11-03  7:28     ` Vladimir Lomov
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

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).