ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Centered title with numeration on the same line
Date: Wed, 05 Jun 2013 09:34:44 +0200	[thread overview]
Message-ID: <51AEEA14.3090401@wxs.nl> (raw)
In-Reply-To: <00ac01ce607b$773e0440$65ba0cc0$@tosovsky@tiscali.cz>

On 6/3/2013 6:57 PM, Jan Tosovsky wrote:
> Dear All,
>
> in MkIV when any title is centered, its numeration is placed on a separate
> line above the title itself.
>
> I'd expect inline formatting which could be overridden as described here
> http://wiki.contextgarden.net/Titles
>
> My code:
>
> \setuplabeltext[en][chapter=Chapter~]
>
> % while for chapter title this line break is handy (in my use case)
> \setuphead[chapter][
> 	alternative=middle,
> 	style=\bfc,
> 	conversion=Romannumerals,
> 	numbercommand=\groupedcommand{\cap}{\blank[0.5cm]},
> 	after={\blank[1cm]},
> 	]
>
> % for section it is inappropriate
> \setuphead[section][
> 	alternative=middle,
> 	style=\bfa,
> 	sectionsegments=section, % ignore component label
> 	]
>
> \starttext
> \chapter{Foo}
> \section{The First Section}
> Text.
> \stoptext
>
> How can I keep numeration and title together?

in strc-ren you can see exmaples of definitions; you can either define a 
macro and hook it in (old method) or use setups in which case you have 
access to more properties

commands like \veryraggedright are low level (often fast) variants of in 
this case \setupalign[middle,broad] (just use \setupalign if more 
advanced control is needed)

\defineheadalternative
   [mymiddle]
   [alternative=horizontal,
    renderingsetup=head:mymiddle]

\startsetups[head:mymiddle]
     \ruledvbox {
         \headsetupspacing
         \veryraggedcenter
         \begstrut
         \ifconditional\headshownumber
             \headnumbercontent
             \quad
         \fi
         \headtextcontent
         \endstrut
     }
\stopsetups

the struts enforce consistent spacing

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


       reply	other threads:[~2013-06-05  7:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00ac01ce607b$773e0440$65ba0cc0$@tosovsky@tiscali.cz>
2013-06-05  7:34 ` Hans Hagen [this message]
     [not found] <00b001ce607d$034030c0$09c09240$@tosovsky@email.cz>
2013-06-03 17:29 ` Marco Patzer
2013-06-03 18:07   ` honyk
     [not found]   ` <51acdb8b.2777c20a.018b.1c8dSMTPIN_ADDED_BROKEN@mx.google.com>
2013-06-03 18:28     ` luigi scarso
2013-06-03 18:59       ` Wolfgang Schuster
     [not found] <51accdb2.62dcc20a.1a1a.ffffc4f5SMTPIN_ADDED_BROKEN@mx.google.com>
2013-06-03 17:25 ` luigi scarso
2013-06-03 18:51   ` honyk
     [not found]   ` <51ace5cf.03abc20a.5b8a.3629SMTPIN_ADDED_BROKEN@mx.google.com>
2013-06-03 19:08     ` luigi scarso
2013-06-03 19:26       ` honyk
2013-06-03 17:08 honyk
  -- strict thread matches above, loose matches on Subject: below --
2013-06-03 16:57 Jan Tosovsky

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=51AEEA14.3090401@wxs.nl \
    --to=pragma@wxs.nl \
    --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).