![](https://secure.gravatar.com/avatar/3ad3aaa29a79e80c3f257933514f080d.jpg?s=120&d=mm&r=g)
Hi, I am trying to format a chapter heading so that there is a linebreak between the number and the name. The only way I managed to do this is this: \setuphead[ chapter][command=\ChapTitle] \def\ChapTitle#1#2% {\framed[height=2cm,width=broad]{#1\\#2} } But this limits me to a fixed height for the frame. This doesn't work if I don't set a fixed height, which would be a problem with longer chapter names that need linebreaks. What is the correct way to do this? Thank you, Marc Trius.
![](https://secure.gravatar.com/avatar/fb484099da4fdb6a62c12cb083d6659a.jpg?s=120&d=mm&r=g)
On Feb 26, 2012, at 7:13 PM, Marc Trius wrote: Hi, I am trying to format a chapter heading so that there is a linebreak between the number and the name. The only way I managed to do this is this: \setuphead[ chapter][command=\ChapTitle] \def\ChapTitle#1#2% {\framed[height=2cm,width=broad]{#1\\#2} } This worked for me: \def\ChapTitle#1#2{\framed{\vbox{\startalignment[center]#1\par#2\stopalignment}}} I don't know if \vbox's are frowned on in ConTeXt, but my fix doesn't work if you remove it. I've just started migrating from Plain Tex to ConTeXt, so please excuse a naive response. ________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments).
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 27.02.2012 um 02:47 schrieb Rogers, Michael K:
On Feb 26, 2012, at 7:13 PM, Marc Trius wrote:
Hi, I am trying to format a chapter heading so that there is a linebreak between the number and the name. The only way I managed to do this is this:
\setuphead[ chapter][command=\ChapTitle] \def\ChapTitle#1#2% {\framed[height=2cm,width=broad]{#1\\#2} }
This worked for me:
\def\ChapTitle#1#2{\framed{\vbox{\startalignment[center]#1\par#2\stopalignment}}}
\define[2]\ChapTitle {\framed[width=broad,align=middle]{#1\\#2}}
I don't know if \vbox's are frowned on in ConTeXt, but my fix doesn't work if you remove it. I've just started migrating from Plain Tex to ConTeXt, so please excuse a naive response.
Special layouts for the headings requires sometimes \vbox and \hbox but in this case you don’t need it. Wolfgang
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Mon, 27 Feb 2012, Wolfgang Schuster wrote:
Am 27.02.2012 um 02:47 schrieb Rogers, Michael K:
On Feb 26, 2012, at 7:13 PM, Marc Trius wrote:
I am trying to format a chapter heading so that there is a linebreak between the number and the name. The only way I managed to do this is this:
\setuphead[ chapter][command=\ChapTitle] \def\ChapTitle#1#2% {\framed[height=2cm,width=broad]{#1\\#2} }
This worked for me:
\def\ChapTitle#1#2{\framed{\vbox{\startalignment[center]#1\par#2\stopalignment}}}
\define[2]\ChapTitle {\framed[width=broad,align=middle]{#1\\#2}}
I don't know if \vbox's are frowned on in ConTeXt, but my fix doesn't work if you remove it. I've just started migrating from Plain Tex to ConTeXt, so please excuse a naive response.
Special layouts for the headings requires sometimes \vbox and \hbox but in this case you don’t need it.
Well, \framed[...,align=middle,...] is a \vbox. Aditya
participants (4)
-
Aditya Mahajan
-
Marc Trius
-
Rogers, Michael K
-
Wolfgang Schuster