From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: massifr@fastwebnet.it,
mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: page breaks before titles
Date: Sat, 7 Mar 2015 11:05:06 +0100 [thread overview]
Message-ID: <A1B4EC94-BEFF-446E-93B5-656FBAE566B2@gmail.com> (raw)
In-Reply-To: <1425685606.6223.34.camel@fastwebnet.it>
> Am 07.03.2015 um 00:46 schrieb mf <massifr@fastwebnet.it>:
>
> Hello,
> I'm trying to typeset a book made of letters with ConTeXt.
> Every letter has a title a subtitle and a date, before it
> starts with "Dear ..."
> Like this:
> ---------------------------------
> Title
> subtitle
> where, when
> Dear ...,
> the rest of the letter
> ...
> ---------------------------------
>
> The letters are very different in length -- some are long,
> some are made of a couple of lines --, so I'd like to
> typeset them continuously, without skipping to a new page
> every new letter (\setuphead[LetterTitle][page=no]).
>
> This way a letter could finish beyond the half of a page,
> and the next one could have no space left to get the part
> from Title to the first lines of the body on the same page.
>
> That's why I disabled page breaks from Title to the first
> paragraph after "Dear ...": it would be ugly having only
> the title in one page and the rest in the next ones.
>
> But there's a side effect: the title of the new letter
> "pulls" the last two lines (the penalties are set to avoid
> one-line widows) of the previous letter to the new page,
> even when there's room for them on the previous page.
> In this case I would like ConTeXt to break the page at
> the end of the previous letter, before the next letter title.
> That's why I've set
> before={\blank[2*line]\page[preference]}
> in LetterTitle. But it does not work.
> Example:
> --------------------- ---------------------
> text of the previous text of the previous
> letter with room to be letter with room to be
> all typeset here all typeset here
> page 11 last two lines of the
> [room for >2 lines] the previous letter
>
> page break------------------- ==> -------------------
> last two lines of the Title
> the previous letter subtitle
> ...
> page 12 Title
> subtitle
> ...
>
> -------------------- --------------------
>
> Is there a way to know the vertical location where the
> previous letter ends, to decide whether to skip to a new
> page?
You can use the \testpage command where you can set how many
lines should remain on the page before a page breaks happens.
\setuphead[LetterTitle][before={\testpage[8]\blank[2*line]}]
If this doesn’t help you should make a *working* minimal example.
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
___________________________________________________________________________________
next prev parent reply other threads:[~2015-03-07 10:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 23:46 mf
2015-03-07 10:05 ` Wolfgang Schuster [this message]
2015-03-07 12:28 ` mf
2015-03-07 11:24 ` Pablo Rodriguez
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=A1B4EC94-BEFF-446E-93B5-656FBAE566B2@gmail.com \
--to=schuster.wolfgang@gmail.com \
--cc=massifr@fastwebnet.it \
--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).