From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31784 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Header number separator Date: Tue, 7 Nov 2006 17:22:43 -0500 (EST) Message-ID: References: <2e8813a0611071143w27eb11c0we1bae7cf4fdf612b@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1162938226 19491 80.91.229.2 (7 Nov 2006 22:23:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Nov 2006 22:23:46 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 07 23:23:34 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GhZLl-0001CO-9y for gctc-ntg-context-518@m.gmane.org; Tue, 07 Nov 2006 23:23:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 93DCE1FE6C; Tue, 7 Nov 2006 23:23:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04520-01; Tue, 7 Nov 2006 23:22:53 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7B7111FE2D; Tue, 7 Nov 2006 23:22:53 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 826721FE2F for ; Tue, 7 Nov 2006 23:22:50 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03917-04-2 for ; Tue, 7 Nov 2006 23:22:44 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by ronja.ntg.nl (Postfix) with SMTP id C74981FE27 for ; Tue, 7 Nov 2006 23:22:43 +0100 (CET) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY tombraider.mr.itd.umich.edu ID 45510732.4AA61.28772 ; 7 Nov 2006 17:22:42 -0500 Original-To: mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:31784 Archived-At: On Tue, 7 Nov 2006, Aditya Mahajan wrote: > On Tue, 7 Nov 2006, Jeff Smith wrote: > >> Hi, >> >> Some time ago I had a query on the list about roman numbering in >> headers. Once I got my answer, I asked something else relatively >> unrelated but in the same thread. It's probably bad etiquette, so I >> figure that is why it has remained unheeded. I'd like to submit my >> second query again. >> >> I have a problem with the separator in header numbers. I want to >> use a different separator between chapter and section numbers (-), than between >> section and subsection numbers (.). >> >> So, assuming I'm using roman numerals for chapters, I'd like numering >> of sections to be I-1, I-2, I-3, etc., of subsections to be I-1.1, >> I-1.2, I-2.1, I-2.2, I-2.3, etc. >> >> Is there a way to achieve what I want to do? > > Yes, as long as you do not want to refer to your sections :) The > separator seems to be broken while refering anyways. I need this functionality for a project (IEEE conference style), so here is hack to get the feature. The referencing also works. Use with caution, can break existing macros. \setupsection[section-1][separator=-] \setupsection[section-2][separator=-] \setupsection[section-3][separator=-] %section \setupsection[section-4][separator=.] %subsection \setupsection[section-5][separator=-] \setupsection[section-6][separator=-] \setupsection[section-2][bodypartconversion=Romannumerals] \unprotect \def\@@longsectionnumber#1% {\ifreversesectionnumbers \@@shortsectionnumber{#1}% \ifnum\countervalue{\??se\previoussection{#1}}>\zerocount \csname\??se#1\c!separator\endcsname%AM: was . \csname\previoussection{#1}\c!number\endcsname \fi \else \ifnum\countervalue{\??se\previoussection{#1}}>\zerocount \csname\previoussection{#1}\c!number\endcsname% \csname\??se#1\c!separator\endcsname%AM: was . \fi \@@shortsectionnumber{#1}% \fi} \protect \starttext \chapter{Test} \section[sec]{section test} \subsection[sub]{test} The separator is honored in \in Section[sec] and in \in subsection[sub]. \stoptext Basically, section numbers are built according to \??se (\setupsection, etc), while separators are specified using \??ko (\setuphead, etc), so any interaction is very difficult. I defined separators according to \setupsection, and use while generating the number. Aditya