ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger <context@boede.nl>
To: NTG-Context ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Placing a section ending depending on odd/even sectionnumber
Date: Wed, 5 Aug 2020 13:39:08 +0200	[thread overview]
Message-ID: <1428D932-FBD5-424E-950E-151CEF8A8164@boede.nl> (raw)
In-Reply-To: <c2a9140c-4089-f6a7-13ff-106909ed5608@gmail.com>

Wolfgang, thank you so much for your help!

Hm, when reading your explanation I start to understand my short cut in thinking about solving the problem.

I will build it into my project…

Thanks and kind regards
Willi

> On 4 Aug 2020, at 19:46, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
> Willi Egger schrieb am 04.08.2020 um 18:56:
>> Hi,
>> now I have another hurdle to be taken :-) — Depending on the odd or even number of the section I have to place an ornament at the end of the section.
>> I have sofar the following setup:
>> [...]
>> However the the evaluation of the sectionnumber results always in “false”, having therefore always odd as a sectionending.
> 
> You have two problem:
> 
> 1. To get the current value for \currentheadnumber you have use \determineheadnumber[section] before you use it but the example below shows a better method.
> 
> 2. What you do with \doifelse{...}{even} is to compare the numeric value of the section with the string "even" which is always false. To check whether the value is odd or even you have to use the \ifodd command.
> 
>> What to change in order to get the desired result?
> 
> %%%% begin example
> \startsetups [section:odd]
> \vfill
> \bold {End of odd numbered section}
> \stopsetups
> 
> \startsetups [section:even]
> \vfill
> \bold {End of even numbered section}
> \stopsetups
> 
> \startsetups [section:end]
> \ifodd\namedheadnumber{section}
>  \directsetup{section:odd}
> \else
>  \directsetup{section:even}
> \fi
> \stopsetups
> 
> \setuphead
> [section]
> [aftersection=\directsetup{section:end}]
> 
> \starttext
> 
> \startsection[title=Ward]
> \input ward
> \stopsection
> 
> \page
> 
> \startsection[title=Knuth]
> \input knuth
> \stopsection
> 
> \stoptext
> %%%% end example
> 
> 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
> ___________________________________________________________________________________

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

      reply	other threads:[~2020-08-05 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 16:56 Willi Egger
2020-08-04 17:46 ` Wolfgang Schuster
2020-08-05 11:39   ` Willi Egger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428D932-FBD5-424E-950E-151CEF8A8164@boede.nl \
    --to=context@boede.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).