ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Centered title with numeration on the same line
       [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>
  0 siblings, 2 replies; 11+ messages in thread
From: luigi scarso @ 2013-06-03 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1662 bytes --]

On Mon, Jun 3, 2013 at 7:08 PM, honyk <j.tosovsky@email.cz> 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?
>
> Thanks,
> Jan
>
>
\setuplabeltext[en][chapter=Chapter~]

% while for chapter title this line break is handy (in my use case)
\setuphead[chapter][
        align=middle,
        style=\bfc,
        conversion=Romannumerals,
        deepnumbercommand=\cap,% \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

Maybe do you want deepnumbercommand ?
(see the links for the difference numbercommand vs deepnumbercommand)

--
luigi

[-- Attachment #1.2: Type: text/html, Size: 2429 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Centered title with numeration on the same line
  2013-06-03 17:25 ` Centered title with numeration on the same line luigi scarso
@ 2013-06-03 18:51   ` honyk
       [not found]   ` <51ace5cf.03abc20a.5b8a.3629SMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 11+ messages in thread
From: honyk @ 2013-06-03 18:51 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Dear Luigi,

> > On Mon, Jun 3, 2013 at 7:08 PM, honyk <j.tosovsky@email.cz> 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?
> > 
> > Thanks,
> > Jan
>
> \setuplabeltext[en][chapter=Chapter~]
> 
> % while for chapter title this line break is handy (in my use case)
> \setuphead[chapter][
>         align=middle,
>         style=\bfc,
>         conversion=Romannumerals,
>         deepnumbercommand=\cap,% \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
> 
> Maybe do you want deepnumbercommand ?
> (see the links for the difference numbercommand vs deepnumbercommand)

The problematic part is that section title. The chapter title formatting is Ok (but thanks for showing the way how to deal with these cases for future uses). Applying deepnumbercommand to section didn't help to me...

Regards, Jan

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


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

* Re: Centered title with numeration on the same line
       [not found]   ` <51ace5cf.03abc20a.5b8a.3629SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2013-06-03 19:08     ` luigi scarso
  2013-06-03 19:26       ` honyk
  0 siblings, 1 reply; 11+ messages in thread
From: luigi scarso @ 2013-06-03 19:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 445 bytes --]

On Mon, Jun 3, 2013 at 8:51 PM, honyk <j.tosovsky@email.cz> wrote:

> Dear Luigi,
>
> The problematic part is that section title. The chapter title formatting
> is Ok (but thanks for showing the way how to deal with these cases for
> future uses). Applying deepnumbercommand to section didn't help to me...
>
I've used align=middle
instead of
alternative=middle
in \setuphead[section]
(in the first example I've used it  for chapter)

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1023 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Centered title with numeration on the same line
  2013-06-03 19:08     ` luigi scarso
@ 2013-06-03 19:26       ` honyk
  0 siblings, 0 replies; 11+ messages in thread
From: honyk @ 2013-06-03 19:26 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Luigi,

>> The problematic part is that section title. The chapter title formatting is Ok (but thanks 
>> for showing the way how to deal with these cases for future uses). 
>> Applying deepnumbercommand to section didn't help to me...

> I've used align=middle instead of alternative=middle
> in \setuphead[section] (in the first example I've used it  for chapter)

sorry for that, I overlooked this change completely. Your solution works as well and it is even much simpler.

Thanks, Jan


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


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

* Re: Centered title with numeration on the same line
       [not found] <00ac01ce607b$773e0440$65ba0cc0$@tosovsky@tiscali.cz>
@ 2013-06-05  7:34 ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2013-06-05  7:34 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


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

* Re: Centered title with numeration on the same line
  2013-06-03 18:28     ` luigi scarso
@ 2013-06-03 18:59       ` Wolfgang Schuster
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfgang Schuster @ 2013-06-03 18:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.06.2013 um 20:28 schrieb luigi scarso <luigi.scarso@gmail.com>:

>         numbercommand=\groupedcommand{\cap}{\blank[0.5cm]},
> 
> But again, are you sure about the \cap command ?
> It also sets the CHAPTER as small caps .

Formatting numbers as smallcaps/fake caps doesn’t make much sense :)

What I find questionable is the \blank command at the end of the numbercommand.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Centered title with numeration on the same line
       [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
  0 siblings, 1 reply; 11+ messages in thread
From: luigi scarso @ 2013-06-03 18:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 843 bytes --]

On Mon, Jun 3, 2013 at 8:07 PM, honyk <j.tosovsky@email.cz> wrote:

> Marco,
>
> thanks a lot, it gives me exactly what I wanted!
>
> But to be honest, I expected a single option for this :-)
>
>
\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][
        align=middle,
        style=\bfa,
        sectionsegments=section, % ignore component label
        ]

\starttext
\chapter{Foo}
\section{The First Section}
Text.
\stoptext

But again, are you sure about the \cap command ?
It also sets the CHAPTER as small caps .

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1477 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Centered title with numeration on the same line
  2013-06-03 17:29 ` Marco Patzer
@ 2013-06-03 18:07   ` honyk
       [not found]   ` <51acdb8b.2777c20a.018b.1c8dSMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 11+ messages in thread
From: honyk @ 2013-06-03 18:07 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

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

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

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

* Re: Centered title with numeration on the same line
       [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>
  0 siblings, 2 replies; 11+ messages in thread
From: Marco Patzer @ 2013-06-03 17:29 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 877 bytes --]

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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Centered title with numeration on the same line
@ 2013-06-03 17:08 honyk
  0 siblings, 0 replies; 11+ messages in thread
From: honyk @ 2013-06-03 17:08 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

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?

Thanks,
Jan

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


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

* Centered title with numeration on the same line
@ 2013-06-03 16:57 Jan Tosovsky
  0 siblings, 0 replies; 11+ messages in thread
From: Jan Tosovsky @ 2013-06-03 16:57 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

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?

Thanks,
Jan

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


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

end of thread, other threads:[~2013-06-05  7:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <51accdb2.62dcc20a.1a1a.ffffc4f5SMTPIN_ADDED_BROKEN@mx.google.com>
2013-06-03 17:25 ` Centered title with numeration on the same line 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
     [not found] <00ac01ce607b$773e0440$65ba0cc0$@tosovsky@tiscali.cz>
2013-06-05  7:34 ` Hans Hagen
     [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
2013-06-03 17:08 honyk
  -- strict thread matches above, loose matches on Subject: below --
2013-06-03 16:57 Jan Tosovsky

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