From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Florian Grammel <florian.grammel@gmail.com>
Subject: [NTG-context] Re: widows and orphans in \definestartstop?
Date: Wed, 9 Oct 2024 21:49:36 +0200 [thread overview]
Message-ID: <475ea245-f8af-4a66-3aca-ed0b719be8ee@gmail.com> (raw)
In-Reply-To: <7F5D6CFE-6994-4AE2-8EFB-D34385465F90@gmail.com>
Florian Grammel schrieb am 09.10.2024 um 13:48:
> I have defined a simple environment for verse within prose-context. Obviously I never want the first or last lines of the verses to stand as widows or orphans. I could just add \nobreak to every first and last line of verse to achieve this. But I was wondering whether I could change anything of my \definestartstop to do this automatically. Simply adding \nobreak to before= and after= doesn't work.
1. You example is missing \stopdocument at he end.
2. You can use \dorecurse to place the placeholder text.
3. Use \noindentation to prevent paragraph indentation after an
environment, \setupindenting is wrong here because it changes the
indentation settings for the whole document.
4. Add "keeptogether=paragraph" to your lines settings.
%%%% begin example
\definenarrower
[VerseIndent]
[default={left,right},
before=\blank,
after=\blank\noindentation]
\definelines
[origverse]
[before=\startVerseIndent,
after=\stopVerseIndent,
keeptogether=paragraph]
\startdocument
\dorecurse{34}{prose\par}
\startorigverse
vvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvv
vvvvvvvvvvvvvvvvvv
vvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
\stoporigverse
\dorecurse{38}{prose\par}
\startorigverse
vvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvv
vvvvvvvvvvvvvvvvvv
vvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
\stoporigverse
prose
\stopdocument
%%%% end example
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2024-10-09 19:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 11:48 [NTG-context] " Florian Grammel
2024-10-09 15:04 ` [NTG-context] " Hans Hagen via ntg-context
2024-10-09 19:49 ` Wolfgang Schuster [this message]
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=475ea245-f8af-4a66-3aca-ed0b719be8ee@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=florian.grammel@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).