ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Question on how to simple numbered sections or other headings
@ 2015-10-25 16:08 josephcanedo
  2015-10-25 16:32 ` Thomas A. Schmitz
  0 siblings, 1 reply; 6+ messages in thread
From: josephcanedo @ 2015-10-25 16:08 UTC (permalink / raw)
  To: ntg-context


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

Hello all,


I have an another newbie ConTeXt user question (very powerful but the learning curve is a bit steep at least for me 😊). Sorry if this is documented in the Wiki but could not find an example to do this. 


I would like to have text splitted in chapters (or sections) with some title, which I can do fine and have these divided in sections (or subsections) whose title is just for example: Chapitre 1, Chapitre 2, … ie a simple label + a counter after it.


How can I do this please ? I tried using \setupheads[number=no] to not print the number at left side of title but this makes \structurenumber or \headnumber[section] empty.


Basically what is a way to have (for example): 


Chapitre 1


instead of


1 Chapitre


Many thanks


Best regards


Joseph Canedo

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

* Re: Question on how to simple numbered sections or other headings
  2015-10-25 16:08 Question on how to simple numbered sections or other headings josephcanedo
@ 2015-10-25 16:32 ` Thomas A. Schmitz
  2015-10-25 17:00   ` Alan BRASLAU
  2015-10-25 19:02   ` josephcanedo
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas A. Schmitz @ 2015-10-25 16:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Is that what you're looking for?


\define[2]\MyChapterTitle%
{#2: #1}

\setuphead[chapter]
	  [command=\MyChapterTitle]

\starttext

\startchapter [title=Some Title]

Some text.

\stoptext

When you define a command, #1 is your chapter/section/whatever number, 
#2 is your title.

(For future reference: please make minimal examples when asking a question.)

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

* Re: Question on how to simple numbered sections or other headings
  2015-10-25 16:32 ` Thomas A. Schmitz
@ 2015-10-25 17:00   ` Alan BRASLAU
  2015-10-25 19:04     ` josephcanedo
  2015-10-25 19:02   ` josephcanedo
  1 sibling, 1 reply; 6+ messages in thread
From: Alan BRASLAU @ 2015-10-25 17:00 UTC (permalink / raw)
  To: josephcanedo; +Cc: mailing list for ConTeXt users

Easier:

\setuplabeltext [chapter=Chapitre ] % with trailing space; blank by default
\starttext

 \startchapter
   Some text.
 \stopchapter

 \startchapter
   Some more text.
 \stopchapter

\stoptext


Alan


On Sun, 25 Oct 2015 17:32:30 +0100
"Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de> wrote:

> Is that what you're looking for?
> 
> 
> \define[2]\MyChapterTitle%
> {#2: #1}
> 
> \setuphead[chapter]
> 	  [command=\MyChapterTitle]
> 
> \starttext
> 
> \startchapter [title=Some Title]
> 
> Some text.
> 
> \stoptext
> 
> When you define a command, #1 is your chapter/section/whatever
> number, #2 is your title.
> 
> (For future reference: please make minimal examples when asking a
> question.)
> 
> Thomas
___________________________________________________________________________________
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] 6+ messages in thread

* Re:  Question on how to simple numbered sections or other headings
  2015-10-25 16:32 ` Thomas A. Schmitz
  2015-10-25 17:00   ` Alan BRASLAU
@ 2015-10-25 19:02   ` josephcanedo
  1 sibling, 0 replies; 6+ messages in thread
From: josephcanedo @ 2015-10-25 19:02 UTC (permalink / raw)
  To: ntg-context


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

Yes, that’s correct. I guess command= attribute kind of replaces the “default” processing for the head ? Because when I use it the “align = center” does not seem to be taken in account.

Thanks a lot


Joseph






Sent from Windows Mail





From: Thomas A. Schmitz
Sent: ‎Sunday‎, ‎October‎ ‎25‎, ‎2015 ‎5‎:‎32‎ ‎PM
To: ntg-context@ntg.nl





Is that what you're looking for?


\define[2]\MyChapterTitle%
{#2: #1}

\setuphead[chapter]
   [command=\MyChapterTitle]

\starttext

\startchapter [title=Some Title]

Some text.

\stoptext

When you define a command, #1 is your chapter/section/whatever number, 
#2 is your title.

(For future reference: please make minimal examples when asking a question.)

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

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

* Re:  Question on how to simple numbered sections or other headings
  2015-10-25 17:00   ` Alan BRASLAU
@ 2015-10-25 19:04     ` josephcanedo
  2015-10-26  0:10       ` Alan BRASLAU
  0 siblings, 1 reply; 6+ messages in thread
From: josephcanedo @ 2015-10-25 19:04 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: ntg-context


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

Thanks a lot, very concise. I was wondering if the \stopchapter (or more generally \stop<head>) were needed ? In my document I write in some instances:


\startsubsection 


Bla bla 


\startsubsection 


etc ….


and it seems to work fine (but perhaps pure luck or is the \startsubsection implictly ends the previous one).


Best regards

Joseph






Sent from Windows Mail





From: Alan BRASLAU
Sent: ‎Sunday‎, ‎October‎ ‎25‎, ‎2015 ‎6‎:‎00‎ ‎PM
To: josephcanedo@gmail.com
Cc: ntg-context@ntg.nl





Easier:

\setuplabeltext [chapter=Chapitre ] % with trailing space; blank by default
\starttext

 \startchapter
   Some text.
 \stopchapter

 \startchapter
   Some more text.
 \stopchapter

\stoptext


Alan


On Sun, 25 Oct 2015 17:32:30 +0100
"Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de> wrote:

> Is that what you're looking for?
> 
> 
> \define[2]\MyChapterTitle%
> {#2: #1}
> 
> \setuphead[chapter]
>    [command=\MyChapterTitle]
> 
> \starttext
> 
> \startchapter [title=Some Title]
> 
> Some text.
> 
> \stoptext
> 
> When you define a command, #1 is your chapter/section/whatever
> number, #2 is your title.
> 
> (For future reference: please make minimal examples when asking a
> question.)
> 
> Thomas

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

* Re: Question on how to simple numbered sections or other headings
  2015-10-25 19:04     ` josephcanedo
@ 2015-10-26  0:10       ` Alan BRASLAU
  0 siblings, 0 replies; 6+ messages in thread
From: Alan BRASLAU @ 2015-10-26  0:10 UTC (permalink / raw)
  To: josephcanedo; +Cc: ntg-context

This works only because ConTeXt has some sanity checks, so a new
\startsubsection will implicitly stop an un-stopped subsection. But
it is bad practice to count on this, for I am sure that there are some
situations where something might fail.

The \startXXX ... \stopXXX syntax is generally better than using
simple, traditional (LaTeX) \chapter commands as this exports much
better or more cleanly to xml/xhtml, for example, and produces much
cleaner tagged PDF output as well.

Alan

On Sun, 25 Oct 2015 19:04:01 +0000
<josephcanedo@gmail.com> wrote:

> I was wondering if the \stopchapter (or
> more generally \stop<head>) were needed ? In my document I write in
> some instances:
> 
> \startsubsection
> 
> Bla bla
> 
> \startsubsection
> 
> etc ….
> 
> and it seems to work fine (but perhaps pure luck or is the
> \startsubsection implictly ends the previous one).


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

end of thread, other threads:[~2015-10-26  0:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 16:08 Question on how to simple numbered sections or other headings josephcanedo
2015-10-25 16:32 ` Thomas A. Schmitz
2015-10-25 17:00   ` Alan BRASLAU
2015-10-25 19:04     ` josephcanedo
2015-10-26  0:10       ` Alan BRASLAU
2015-10-25 19:02   ` josephcanedo

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