ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] widows and orphans in \definestartstop?
@ 2024-10-09 11:48 Florian Grammel
  2024-10-09 15:04 ` [NTG-context] " Hans Hagen via ntg-context
  2024-10-09 19:49 ` Wolfgang Schuster
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Grammel @ 2024-10-09 11:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.


Thank you all for your time!
Best,
Florian.



\definestartstop	[origverse]
			[before={\startnarrower[left,right]\startlines},
			after={\stoplines\stopnarrower
%			\setupindenting[next] %\indenting is deprecated!
			\blank}]




\startdocument

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

\startorigverse
vvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvv
vvvvvvvvvvvvvvvvvv
vvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
\stoporigverse

prose again

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

prose

\startorigverse
vvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvv
vvvvvvvvvvvvvvvvvv
vvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
\stoporigverse

prose again


____________________________________________

Florian Grammel

Copenhagen, Denmark

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

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

* [NTG-context] Re: widows and orphans in \definestartstop?
  2024-10-09 11:48 [NTG-context] widows and orphans in \definestartstop? Florian Grammel
@ 2024-10-09 15:04 ` Hans Hagen via ntg-context
  2024-10-09 19:49 ` Wolfgang Schuster
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2024-10-09 15:04 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 10/9/2024 1:48 PM, Florian Grammel wrote:
> 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.

\widowpenalty10000
\clubpenalty 10000

The next upload actually has \setupalign[lesswidows,lessclubs] and such 
as part of more (also local) control over the par builder.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* [NTG-context] Re: widows and orphans in \definestartstop?
  2024-10-09 11:48 [NTG-context] widows and orphans in \definestartstop? Florian Grammel
  2024-10-09 15:04 ` [NTG-context] " Hans Hagen via ntg-context
@ 2024-10-09 19:49 ` Wolfgang Schuster
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2024-10-09 19:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Florian Grammel

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
___________________________________________________________________________________

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

end of thread, other threads:[~2024-10-09 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-09 11:48 [NTG-context] widows and orphans in \definestartstop? Florian Grammel
2024-10-09 15:04 ` [NTG-context] " Hans Hagen via ntg-context
2024-10-09 19:49 ` Wolfgang Schuster

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