Re: [NTG-context] Centered title with numeration on the same line
![](https://secure.gravatar.com/avatar/d39338246f50cca667c8256c313d7cfd.jpg?s=120&d=mm&r=g)
On 2013–06–03 honyk wrote:
How can I keep numeration and title together?
You can create a custom head alternative. The following code is copied from the source, I only replace the \par with \kern\headnumberdistance. Have a look at strc-ren.mkiv for other layouts. \setuphead [section] [alternative=middle_nolinebreak] \defineheadalternative [middle_nolinebreak] [alternative=vertical, renderingsetup=headrenderings:middle_nolinebreak] \startsetups[headrenderings:middle_nolinebreak] \vbox { \headsetupspacing \veryraggedcenter \let\\\endgraf \let\crlf\endgraf \ifconditional\headshownumber \strut \headnumbercontent \kern\headnumberdistance \fi \begstrut \headtextcontent \endstrut } \stopsetups \starttext \section{The First Section} \stoptext Marco
![](https://secure.gravatar.com/avatar/b725c6396317bce49729e7787da89aef.jpg?s=120&d=mm&r=g)
Marco, thanks a lot, it gives me exactly what I wanted! But to be honest, I expected a single option for this :-) Jan
On 2013–06–03 honyk wrote:
How can I keep numeration and title together?
You can create a custom head alternative. The following code is copied from the source, I only replace the \par with \kern\headnumberdistance. Have a look at strc-ren.mkiv for other layouts.
\setuphead [section] [alternative=middle_nolinebreak]
\defineheadalternative [middle_nolinebreak] [alternative=vertical, renderingsetup=headrenderings:middle_nolinebreak]
\startsetups[headrenderings:middle_nolinebreak] \vbox { \headsetupspacing \veryraggedcenter \let\\\endgraf \let\crlf\endgraf \ifconditional\headshownumber \strut \headnumbercontent \kern\headnumberdistance \fi \begstrut \headtextcontent \endstrut } \stopsetups
\starttext \section{The First Section} \stoptext
Marco
participants (2)
-
honyk
-
Marco Patzer