ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Word wrap of 'part' titles
@ 2022-04-18 20:46 Bruce Horrocks via ntg-context
  2022-04-18 21:10 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Horrocks via ntg-context @ 2022-04-18 20:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks

In the MWE below the 'part' title is centred but on one line only and, because it is a long title, the beginning and end are lost off the sides of the page.

If it were a 'chapter' title then I could insert '\\' to cause a line break at that point. However this does not seem to work for 'part'.

Is there a way of making 'part' titles wrap the same way that 'chapter' titles do?

% ---begin---
\define[2]\placePartTitle{\midaligned{#2}}

\definehead [Part] [part]
\setuphead[Part]
  [ placehead=yes,
    style={\tfd},
    command=\placePartTitle,
  ]
  
\starttext
\startPart[title={A very long part title that needs to be wrapped manually}]
Some body text
\stopPart
\stoptext
%---end---

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Word wrap of 'part' titles
  2022-04-18 20:46 Word wrap of 'part' titles Bruce Horrocks via ntg-context
@ 2022-04-18 21:10 ` Wolfgang Schuster via ntg-context
  2022-04-18 23:19   ` Aditya Mahajan via ntg-context
  2022-04-19  0:00   ` Bruce Horrocks via ntg-context
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-04-18 21:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Wolfgang Schuster

Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:
> In the MWE below the 'part' title is centred but on one line only and, because it is a long title, the beginning and end are lost off the sides of the page.
>
> If it were a 'chapter' title then I could insert '\\' to cause a line break at that point. However this does not seem to work for 'part'.
>
> Is there a way of making 'part' titles wrap the same way that 'chapter' titles do?
>
> % ---begin---
> \define[2]\placePartTitle{\midaligned{#2}}
>
> \definehead [Part] [part]
> \setuphead[Part]
>    [ placehead=yes,
>      style={\tfd},
>      command=\placePartTitle,
>    ]

\setuphead
   [Part]
   [placehead=yes,
    style=\tfd,
    align=middle,
    number=no]

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Word wrap of 'part' titles
  2022-04-18 21:10 ` Wolfgang Schuster via ntg-context
@ 2022-04-18 23:19   ` Aditya Mahajan via ntg-context
  2022-04-19  0:00   ` Bruce Horrocks via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Aditya Mahajan via ntg-context @ 2022-04-18 23:19 UTC (permalink / raw)
  To: Wolfgang Schuster via ntg-context; +Cc: Aditya Mahajan

[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]

On Mon, 18 Apr 2022, Wolfgang Schuster via ntg-context wrote:

> Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:
> > In the MWE below the 'part' title is centred but on one line only and,
> because it is a long title, the beginning and end are lost off the sides of
> the page.
> >
> > If it were a 'chapter' title then I could insert '\\' to cause a line break
> at that point. However this does not seem to work for 'part'.
> >
> > Is there a way of making 'part' titles wrap the same way that 'chapter'
> titles do?
> >
> > % ---begin---
> > \define[2]\placePartTitle{\midaligned{#2}}
> >
> > \definehead [Part] [part]
> > \setuphead[Part]
> >    [ placehead=yes,
> >      style={\tfd},
> >      command=\placePartTitle,
> >    ]
> 
> \setuphead
>    [Part]
>    [placehead=yes,
>     style=\tfd,
>     align=middle,
>     number=no]

Or use:

align={middle,broad},

which has slightly better alignment for titles, IMHO. There is also `alternative=middle`. 

Aditya

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Word wrap of 'part' titles
  2022-04-18 21:10 ` Wolfgang Schuster via ntg-context
  2022-04-18 23:19   ` Aditya Mahajan via ntg-context
@ 2022-04-19  0:00   ` Bruce Horrocks via ntg-context
  1 sibling, 0 replies; 4+ messages in thread
From: Bruce Horrocks via ntg-context @ 2022-04-19  0:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks



> On 18 Apr 2022, at 22:10, Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Bruce Horrocks via ntg-context schrieb am 18.04.2022 um 22:46:
>> In the MWE below the 'part' title is centred but on one line only and, because it is a long title, the beginning and end are lost off the sides of the page.
>> 
>> If it were a 'chapter' title then I could insert '\\' to cause a line break at that point. However this does not seem to work for 'part'.
>> 
>> Is there a way of making 'part' titles wrap the same way that 'chapter' titles do?
>> 
>> % ---begin---
>> \define[2]\placePartTitle{\midaligned{#2}}
>> 
>> \definehead [Part] [part]
>> \setuphead[Part]
>> [ placehead=yes,
>> style={\tfd},
>> command=\placePartTitle,
>> ]
> 
> \setuphead
> [Part]
> [placehead=yes,
> style=\tfd,
> align=middle,
> number=no]

Thanks very much for the quick and helpful reply.

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-04-19  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 20:46 Word wrap of 'part' titles Bruce Horrocks via ntg-context
2022-04-18 21:10 ` Wolfgang Schuster via ntg-context
2022-04-18 23:19   ` Aditya Mahajan via ntg-context
2022-04-19  0:00   ` Bruce Horrocks via ntg-context

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