ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Conditional text
@ 2002-03-07 18:49 Giuseppe Bilotta
  2002-03-07 22:54 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-03-07 18:49 UTC (permalink / raw)


Hello,

I'd like to separate two blocks of text with some stuff which
depending on wether the two blocks are on the same page or not.

Example one: two paragraph are separate by a \blank of space, but
if there is a page change, then three starts are inserted on top
of the next page.

Example two: sections start without creating a new page, but if
they stay on the same page, then a line is drawn before them.

The nicest thing would be a command (to be used after a \blank)
like \ifstillonsamepageelse{do something}{do something else}.

Do I have to go through the referencing mechanism or is there
something built-in already?

--
Giuseppe "Oblomov" Bilotta


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

* Re: Conditional text
  2002-03-07 18:49 Conditional text Giuseppe Bilotta
@ 2002-03-07 22:54 ` Hans Hagen
  2002-03-08 11:15   ` Re[2]: " Giuseppe Bilotta
  2002-03-11  0:21   ` Daniel Pittman
  0 siblings, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2002-03-07 22:54 UTC (permalink / raw)
  Cc: ntg-context

At 07:49 PM 3/7/2002 +0100, Giuseppe Bilotta wrote:
>Hello,
>
>I'd like to separate two blocks of text with some stuff which
>depending on wether the two blocks are on the same page or not.
>
>Example one: two paragraph are separate by a \blank of space, but
>if there is a page change, then three starts are inserted on top
>of the next page.
>
>Example two: sections start without creating a new page, but if
>they stay on the same page, then a line is drawn before them.
>
>The nicest thing would be a command (to be used after a \blank)
>like \ifstillonsamepageelse{do something}{do something else}.
>
>Do I have to go through the referencing mechanism or is there
>something built-in already?

Ah, another example of italian typesetting:

\setuplayout[height=12cm]

\starttext

\xypos{b1}\input tufte\xypos{e1}

\doifpositionsonsamepageelse{e1,b2}{yes}{no}

\xypos{b2}\input tufte\xypos{e2}

\doifpositionsonsamepageelse{e2,b3}{yes}{no}

\xypos{b3}\input tufte\xypos{e3} \page

\doifpositionsonsamepageelse{e3,b4}{yes}{no}

\xypos{b4}\input tufte\xypos{e4}

\stoptext

Unfortunately i found out that there is a circular call in the macro (will 
send you the patch)

[beware: such playing with spacing may influence the process and you can 
end up in cycles, so, make sure to start without a tuo file, and only move 
forward, not back]

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re[2]: Conditional text
  2002-03-07 22:54 ` Hans Hagen
@ 2002-03-08 11:15   ` Giuseppe Bilotta
  2002-03-08 13:23     ` Re[3]: " Giuseppe Bilotta
  2002-03-11  0:21   ` Daniel Pittman
  1 sibling, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-03-08 11:15 UTC (permalink / raw)
  Cc: ntg-context

Thursday, March 07, 2002 Hans Hagen wrote:

HH> At 07:49 PM 3/7/2002 +0100, Giuseppe Bilotta wrote:

>>I'd like to separate two blocks of text with some stuff which
>>depending on wether the two blocks are on the same page or not.

[snip]

HH> Ah, another example of italian typesetting:

Well, I don't know if that' a typographical rule here in Italy
but, yes, I've seen it in Italian books. :-)

HH> \setuplayout[height=12cm]

HH> \starttext

HH> \xypos{b1}\input tufte\xypos{e1}

HH> \doifpositionsonsamepageelse{e1,b2}{yes}{no}

HH> \xypos{b2}\input tufte\xypos{e2}

HH> \doifpositionsonsamepageelse{e2,b3}{yes}{no}

HH> \xypos{b3}\input tufte\xypos{e3} \page

HH> \doifpositionsonsamepageelse{e3,b4}{yes}{no}

HH> \xypos{b4}\input tufte\xypos{e4}

HH> \stoptext

HH> Unfortunately i found out that there is a circular call in the macro (will 
HH> send you the patch)

Thank you very much. I'll give it a try.

--
Giuseppe "Oblomov" Bilotta


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

* Re[3]: Conditional text
  2002-03-08 11:15   ` Re[2]: " Giuseppe Bilotta
@ 2002-03-08 13:23     ` Giuseppe Bilotta
  2002-03-08 15:35       ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-03-08 13:23 UTC (permalink / raw)


Friday, March 08, 2002 Giuseppe Bilotta wrote:

HH>> \doifpositionsonsamepageelse{e1,b2}{yes}{no}

Ok, it works! :-)

--
Giuseppe "Oblomov" Bilotta


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

* Re[3]: Conditional text
  2002-03-08 13:23     ` Re[3]: " Giuseppe Bilotta
@ 2002-03-08 15:35       ` Hans Hagen
  2002-03-08 16:46         ` Re[4]: " Giuseppe Bilotta
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2002-03-08 15:35 UTC (permalink / raw)
  Cc: ntg-context

At 02:23 PM 3/8/2002 +0100, Giuseppe Bilotta wrote:

>Friday, March 08, 2002 Giuseppe Bilotta wrote:
>
>HH>> \doifpositionsonsamepageelse{e1,b2}{yes}{no}
>
>Ok, it works! :-)

guess what: i tried it before sending you the code

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re[4]: Conditional text
  2002-03-08 15:35       ` Hans Hagen
@ 2002-03-08 16:46         ` Giuseppe Bilotta
  0 siblings, 0 replies; 7+ messages in thread
From: Giuseppe Bilotta @ 2002-03-08 16:46 UTC (permalink / raw)
  Cc: ntg-context

Friday, March 08, 2002 Hans Hagen wrote:

HH> At 02:23 PM 3/8/2002 +0100, Giuseppe Bilotta wrote:

>>Friday, March 08, 2002 Giuseppe Bilotta wrote:
>>
>>HH>> \doifpositionsonsamepageelse{e1,b2}{yes}{no}
>>
>>Ok, it works! :-)

HH> guess what: i tried it before sending you the code

I thought as, much considering the patch that followed :-)

Now I'll put this together with whatever comes from the thread
about the \filbreak (How to: get TeX to warn me ...)

--
Giuseppe "Oblomov" Bilotta


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

* Re: Conditional text
  2002-03-07 22:54 ` Hans Hagen
  2002-03-08 11:15   ` Re[2]: " Giuseppe Bilotta
@ 2002-03-11  0:21   ` Daniel Pittman
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Pittman @ 2002-03-11  0:21 UTC (permalink / raw)


On Thu, 07 Mar 2002, Hans Hagen wrote:
> At 07:49 PM 3/7/2002 +0100, Giuseppe Bilotta wrote:
>>Hello,
>>
>>I'd like to separate two blocks of text with some stuff which
>>depending on wether the two blocks are on the same page or not.

[...]

> \xypos{b1}\input tufte\xypos{e1}
> 
> \doifpositionsonsamepageelse{e1,b2}{yes}{no}

[...]

> Unfortunately i found out that there is a circular call in the macro
> (will send you the patch)

Since this patch doesn't seem to have made it into the 2002.3.4 beta of
ConTeXt, would you also be able to send it to me?  This xypos/doif
combination is something that I would also like to use so that I can
detect page breaks where I don't want them to be. :)

Thanks,
        Daniel

-- 
Making art is quite therapeutic, like chopping vegetables, it calms me and
keeps me off the streets. If I wasn't making photographs or films, I would be
going around slashing tires with a butcher's knife.
        -- Tracey Moffatt


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

end of thread, other threads:[~2002-03-11  0:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-07 18:49 Conditional text Giuseppe Bilotta
2002-03-07 22:54 ` Hans Hagen
2002-03-08 11:15   ` Re[2]: " Giuseppe Bilotta
2002-03-08 13:23     ` Re[3]: " Giuseppe Bilotta
2002-03-08 15:35       ` Hans Hagen
2002-03-08 16:46         ` Re[4]: " Giuseppe Bilotta
2002-03-11  0:21   ` Daniel Pittman

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