ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Numbering sections
@ 2013-09-02 13:21 "H. Özoguz"
  2013-09-02 13:28 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: "H. Özoguz" @ 2013-09-02 13:21 UTC (permalink / raw)
  To: ntg-context

> You can the section number with \getmarking[sectionnumber], the chapter number with \getmarking[chapternumber] etc.

Thanks Wolfgang!

And another question about numbering: How can I let start the numbering 
of chapters with the number n (not 1, as default)? E.g. with n=0 or n=2?

Thanks.
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] 5+ messages in thread

* Re: Numbering sections
  2013-09-02 13:21 Numbering sections "H. Özoguz"
@ 2013-09-02 13:28 ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2013-09-02 13:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 02.09.2013 um 15:21 schrieb "H. Özoguz" <h.oezoguz@mmnetz.de>:

>> You can the section number with \getmarking[sectionnumber], the chapter number with \getmarking[chapternumber] etc.
> 
> Thanks Wolfgang!
> 
> And another question about numbering: How can I let start the numbering of chapters with the number n (not 1, as default)? E.g. with n=0 or n=2?

To start chapters with a larger number you have to add \setupheadnumber[chapter][<n-1>] to your document,
when the first chapter should start with 0 you need a conversion which prints always 1 less than the real number.

\defineexpandable[1]\Previousnumber
  {\number\numexpr#1-1\relax}

\defineconversion[previousnumber][\Previousnumber]

\setuphead[chapter][conversion=previousnumber]

\starttext
\dorecurse{5}{\chapter{Chapter #1}}
\stoptext

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

* Re: Numbering sections
@ 2013-09-02 13:55 "H. Özoguz"
  0 siblings, 0 replies; 5+ messages in thread
From: "H. Özoguz" @ 2013-09-02 13:55 UTC (permalink / raw)
  To: ntg-context

Thanks Wolfgang, nearly perfect, what I wanted.

The problem left is here:

\defineexpandable[1]\Previousnumber
   {\number\numexpr#1-1\relax}
\defineconversion[previousnumber][\Previousnumber]
\setuphead[section][conversion=previousnumber]
\starttext
\dorecurse{5}{\chapter{Chapter #1}
\section{Section #1}
\section{Section #1}
\section{Section #1}
\section{Section #1}
}
\stoptext

Now I want the section-numbers in each chapter to start with x.1 (never 
x.0). But I had to subtract from all section numbers 1, to let the 
section numbers begin with 1 in the second chapter (my first chapter is 
without numbering and without sections, there this question comes from).

So in the above example everything is fine, besides this "x.0", the 
second numbers (indicating the section) should always begin with "1". Is 
that possible?

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

* Re: Numbering sections
  2013-09-02 12:45 "H. Özoguz"
@ 2013-09-02 12:54 ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2013-09-02 12:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 02.09.2013 um 14:45 schrieb "H. Özoguz" <h.oezoguz@mmnetz.de>:

> I have activated numbering sections by \setuphead[section][number=yes], and now the numbers are in the toc, too, as they should. How to show the numbers in the header, too? 
> 
> The header is: \setupheadertexts [][{\grau{\tfx\getmarking[section]}}][{\definedfont[name:myriadprosemibold at 10pt]\grau\getmarking[chapter]}][]
> 
> But the numbers of the sections are not shown in the header, only the titles.

You can the section number with \getmarking[sectionnumber], the chapter number with \getmarking[chapternumber] etc.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1209 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] 5+ messages in thread

* Numbering sections
@ 2013-09-02 12:45 "H. Özoguz"
  2013-09-02 12:54 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: "H. Özoguz" @ 2013-09-02 12:45 UTC (permalink / raw)
  To: ntg-context


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

I have activated numbering sections by 
*\setuphead[section][number=yes]*, and now the numbers are in the toc, 
too, as they should. How to show the numbers in the header, too?

The header is: *\setupheadertexts 
[][{\grau{\tfx\getmarking[section]}}][{\definedfont[name:myriadprosemibold 
at 10pt]\grau\getmarking[chapter]}][]*

But the numbers of the sections are not shown in the header, only the 
titles.

Thanks!
Huseyin



[-- Attachment #1.2: Type: text/html, Size: 702 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] 5+ messages in thread

end of thread, other threads:[~2013-09-02 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 13:21 Numbering sections "H. Özoguz"
2013-09-02 13:28 ` Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2013-09-02 13:55 "H. Özoguz"
2013-09-02 12:45 "H. Özoguz"
2013-09-02 12:54 ` Wolfgang Schuster

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