ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Chapter endings
Date: Mon, 4 Nov 2013 01:37:29 +0100	[thread overview]
Message-ID: <1A1E9047-036B-46F3-AC80-9D2176D6CC3C@gmail.com> (raw)
In-Reply-To: <CACiybx7RdOnsi2tzDau_MSWAetAe=yF9MoxBqdPqCm_f6FGA5w@mail.gmail.com>


Am 02.11.2013 um 21:54 schrieb Francisco Gracia <fgragu023@gmail.com>:

> There is plenty of information available about how to deal with issues related to chapter openings (*headings*) in *Context* but I have not found any related to document endings.
> 
> I would like to end the chapters of a book with some small decorative element, be it text or graphics; let us call it a *Fleuron*. Just putting it in the last line of the text file to be typeset, one can take for sure that earlier or later it will end appearing as the only element of the last page of the product of some run. To avoid this undesirable outcome, it seems to me that one is forced to provide some help to *Context* via some text marks or some code, but I have not been able to conjecture what they should be.
> 
> The clearest arrangement would seem to be the inclusion at the end of the source document of some *Context* instructions equivalent to the following pseudocode:
> 
>     if *Fleuron* fits into the current page:
>         typeset *Fleuron*
> 
> But how do I formulate the condition? How do I know what is the *current page*, what is the size that *Context* has calculated for *Fleuron* and what is the amount of space remaining in the page?
> 
> One can imagine that this method could even be helpful in other situations of the typesetting operation not related to the last page.
> 
> Does someone know how to handle it?


You can use leaders to place a box with the symbols/ornament because the disappear when they are placed at the begin of a page.

\def\Fleuron
  {\par
   \leaders\vbox to \lineheight{MIDDLE OF THE PAGE}\vfil}

\setuplayout[lines=10]  

\starttext

% Method 1

\dorecurse{5}{Line \recurselevel\par}

\Fleuron

\page

\dorecurse{10}{Line \recurselevel\par}

\Fleuron

\page

\dorecurse{5}{Line \recurselevel\par}

\Fleuron

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


  reply	other threads:[~2013-11-04  0:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02 20:54 Francisco Gracia
2013-11-04  0:37 ` Wolfgang Schuster [this message]
2013-11-04 14:55   ` Hans Hagen
2013-11-04 22:48 Francisco Gracia
2013-11-10 15:07 Francisco Gracia
2013-11-10 21:21 ` Wolfgang Schuster

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=1A1E9047-036B-46F3-AC80-9D2176D6CC3C@gmail.com \
    --to=wolfgang.schuster@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).