ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: Conditional text
Date: Thu, 07 Mar 2002 23:54:20 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20020307235203.04208490@server-1> (raw)
In-Reply-To: <44844809.20020307194904@bigfoot.com>

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


  reply	other threads:[~2002-03-07 22:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-07 18:49 Giuseppe Bilotta
2002-03-07 22:54 ` Hans Hagen [this message]
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
2003-01-19  0:06 Conditional Text Lazycode
2003-01-19  0:12 ` Patrick Gundlach
2003-01-19 22:11 ` John Culleton
2003-01-20  9:07 ` Hans Hagen
2003-01-24 22:24   ` Johannes Hüsing
2003-01-24 22:24     ` 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=5.1.0.14.1.20020307235203.04208490@server-1 \
    --to=pragma@wxs.nl \
    --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).