ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Get Current Section Number
@ 2022-01-09 16:25 Michael Urban via ntg-context
  2022-01-09 18:15 ` Pablo Rodriguez via ntg-context
  2022-01-09 18:40 ` Wolfgang Schuster via ntg-context
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Urban via ntg-context @ 2022-01-09 16:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Michael Urban

I want to put a book title above the Chapter title for the first chapter of a book.  I suppose that this can be accomplished with a 'before=' clause that checks to see if it is the first chapter... but how do I look at the chapter number in order to set up the conditional?

	Mike

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Get Current Section Number
  2022-01-09 16:25 Get Current Section Number Michael Urban via ntg-context
@ 2022-01-09 18:15 ` Pablo Rodriguez via ntg-context
  2022-01-09 18:40 ` Wolfgang Schuster via ntg-context
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-01-09 18:15 UTC (permalink / raw)
  To: Michael Urban via ntg-context; +Cc: Pablo Rodriguez

On 1/9/22 5:25 PM, Michael Urban via ntg-context wrote:
> I want to put a book title above the Chapter title for the first
> chapter of a book.  I suppose that this can be accomplished with a
> 'before=' clause that checks to see if it is the first chapter... but
> how do I look at the chapter number in order to set up the
> conditional?

Hi MIchael,

this might do the trick:

  \starttext
  \dorecurse{5}
   {\chapter{Chapter \structurenumber}
    \dorecurse{5}
     {\section{Section \structurenumber}
      \doifelse{\somenamedheadnumber{chapter}{current}}{1}
       {This is the first chapter.}
       {This is not the first chapter.}
  }}
  \stoptext

Just in case it might help,

Pablo



___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Get Current Section Number
  2022-01-09 16:25 Get Current Section Number Michael Urban via ntg-context
  2022-01-09 18:15 ` Pablo Rodriguez via ntg-context
@ 2022-01-09 18:40 ` Wolfgang Schuster via ntg-context
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-01-09 18:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Michael Urban via ntg-context
  Cc: Wolfgang Schuster, Michael Urban

Michael Urban via ntg-context schrieb am 09.01.2022 um 17:25:
> I want to put a book title above the Chapter title for the first chapter of a book.  I suppose that this can be accomplished with a 'before=' clause that checks to see if it is the first chapter... but how do I look at the chapter number in order to set up the conditional?

Can you show a example of your document, maybe there is a better way to 
produce the desired result.

\startsetups [document:start]
     \startalignment[middle]
         {\ssd\documentparameter{title}}
     \stopalignment
\stopsetups

\setuphead [chapter] [page=no]

\startdocument [title={Dummy title}]

\dorecurse{5}
   {\startchapter[title={Chapter \convertnumber{word}{#1}}]
    \samplefile{lorem}
    \stopchapter}

\stopdocument

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-01-09 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09 16:25 Get Current Section Number Michael Urban via ntg-context
2022-01-09 18:15 ` Pablo Rodriguez via ntg-context
2022-01-09 18:40 ` Wolfgang Schuster via ntg-context

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