ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Sections, cross-references and separators
Date: Tue, 01 Apr 2008 10:57:08 +0200	[thread overview]
Message-ID: <47F1F8E4.4040700@elvenkind.com> (raw)
In-Reply-To: <47F1ED0A.1010802@capdm.com>



Duncan Hothersall wrote:
> Taco wrote:
>> In this case it is easier to make the actual chapter number include
>> the 'A'. That way, you won't have to worry about "separator" at all
>> (which is good, because its use is confusing).
>>
>> Try this:
>>
>> @@ -1,4 +1,4 @@
>> -\setupheads[separator=] %<-- this can't be right
>>   \setupreferencing[state=start,chapternumber=yes,global=yes]
>> -\setupsection[section-1][conversion=Characters]
>> -\setupsection[section-2][previousnumber=yes]
>> +\def\Mychapter#1{\convertnumber{Characters}{\getvalue{@@sesection-1}}#1}
>> +\defineconversion[MyChapter][\Mychapter]
>> +\setupsection[section-2][conversion=MyChapter]
>>   
> Ah, thanks so much Taco, never thought of that approach - works like a 
> charm. (I also thought that macros with @ in their names could only be 
> used in protected mode, so that's two things I have learned for the 
> price of one.)

As far as TeX is concerned, I am not actually using the macro myself,
just mentioning its name. The \getvalue macro then constructs the actual
macro name internally. That works always, but usually macro calls look
funny when used in that way.

I just found  \rawsectionnumber, so with this change it should also work 
(and look less low-level, which is good if you want to wikify it):

   \def\Mychapter#1%
      {\convertnumber{Characters}{\rawsectionnumber{section-1}}#1}

Best wishes,
Taco
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2008-04-01  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4030.1207034365.4340.ntg-context@ntg.nl>
2008-04-01  8:06 ` Duncan Hothersall
2008-04-01  8:57   ` Taco Hoekwater [this message]
2008-03-31 17:25 Duncan Hothersall
2008-04-01  6:38 ` Taco Hoekwater

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=47F1F8E4.4040700@elvenkind.com \
    --to=taco@elvenkind.com \
    --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).