ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Different counters for titles
@ 2013-09-03  8:24 "H. Özoguz"
  0 siblings, 0 replies; 3+ messages in thread
From: "H. Özoguz" @ 2013-09-03  8:24 UTC (permalink / raw)
  To: ntg-context

> \startchapter[ownnumber=1,title=chap 1]

This cheat gives the chapter his own number, but the counter still 
counts. So for my minexample it does not work:

\definehead[mychapter][chapter]
\setuphead[mychapter][number=no]

\setupcombinedlist
  [content]
  [list={mychapter, chapter, section}]

\starttext
\completecontent
\startmychapter[ownnumber=0,title=Vorwort]
\chapter{First Chapter}
\section{Some section in the first chapter}
\chapter{Second chapter}
\section{Some section in the second chapter}
\stoptext

Still "first chapter" has the number 2 etc. Of course I could change all 
chapter numbers by my own with this cheat "ownnumber", but that would be 
inappropriate, I have many of them in my currect project, and maybe 
things change and then I have to change and correct all of them again 
and again ...

Maybe this way would work too: To define a new title (same styled like 
chapter, but not a clone), which has no counter and to add this title 
"Vorwort" into the toc. Then the first "real" chapter would 
automatically begin with "1"?! Would that work, and if yes, how to do that?

Huseyin
___________________________________________________________________________________
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] 3+ messages in thread

* Re: Different counters for titles
  2013-09-03  6:14 "H. Özoguz"
@ 2013-09-03  7:36 ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2013-09-03  7:36 UTC (permalink / raw)
  To: ntg-context

On 9/3/2013 8:14 AM, "H. Özoguz" wrote:
> To solve my last asked question, I chose a somewhat easiert way and
> defined an own chapter-title, which is unnumbered.
>
> Here is my Minexample:
>
> \definehead[mychapter][chapter]
> \setuphead[mychapter][number=no]
> \setupcombinedlist[content]
> [list={mychapter, chapter, section}]
>
> \starttext
> \completecontent
> \mychapter{Vorwort}
> \chapter{First Chapter}
> \section{Some section in the first chapter}
> \chapter{Second chapter}
> \section{Some section in the second chapter}
> \stoptext
>
> The problem is now: Obviously the counter of mychapter and chapter is
> the same. Because "first chapter" begins with number 2, but should with
> 1 – that was the intention of this new chapter style, which is nothing
> but a unnumbered copy of the default chapter. Was that idea wrong? How
> to give chapter and mychapter their own counters, to achieve this result
> – or any other way to let "first chapter" begin with 1 (but not subtract
> 1 from the numbers, because that ends up in the first section "1.0". The
> first section of the first chapter should be numbered with "1.1", as
> usual).

Indeed they are clones and the main reason is that you can use different 
rendering. In fact the topmost levels are :

\definesection[section-1] % part
\definesection[section-2] % chapter
\definesection[section-3] % section
\definesection[section-4] % subsection
\definesection[section-5] % subsubsection
\definesection[section-6] % subsubsubsection
\definesection[section-7] % subsubsubsubsection

There's a lot going on with section heading so having a copy of the same 
is non trivial as one should decide what gets copied (think of all kind 
of references).

Here's a cheat:

\starttext
     \placelist[chapter][criterium=all]

     \startchapter[ownnumber=1,title=chap 1] \startsection[title=sec 
1]\input ward \stopsection \stopchapter
     \startchapter[ownnumber=1,title=chap 1] \startsection[title=sec 
1]\input ward \stopsection \stopchapter
\stoptext


-----------------------------------------------------------------
                                           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] 3+ messages in thread

* Different counters for titles
@ 2013-09-03  6:14 "H. Özoguz"
  2013-09-03  7:36 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: "H. Özoguz" @ 2013-09-03  6:14 UTC (permalink / raw)
  To: ntg-context

To solve my last asked question, I chose a somewhat easiert way and 
defined an own chapter-title, which is unnumbered.

Here is my Minexample:

\definehead[mychapter][chapter]
\setuphead[mychapter][number=no]
\setupcombinedlist[content]
[list={mychapter, chapter, section}]

\starttext
\completecontent
\mychapter{Vorwort}
\chapter{First Chapter}
\section{Some section in the first chapter}
\chapter{Second chapter}
\section{Some section in the second chapter}
\stoptext

The problem is now: Obviously the counter of mychapter and chapter is 
the same. Because "first chapter" begins with number 2, but should with 
1 – that was the intention of this new chapter style, which is nothing 
but a unnumbered copy of the default chapter. Was that idea wrong? How 
to give chapter and mychapter their own counters, to achieve this result 
– or any other way to let "first chapter" begin with 1 (but not subtract 
1 from the numbers, because that ends up in the first section "1.0". The 
first section of the first chapter should be numbered with "1.1", as usual).

Huseyin


___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2013-09-03  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03  8:24 Different counters for titles "H. Özoguz"
  -- strict thread matches above, loose matches on Subject: below --
2013-09-03  6:14 "H. Özoguz"
2013-09-03  7:36 ` Hans Hagen

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