From: Aditya Mahajan <adityam@umich.edu>
Subject: Re: Header number separator
Date: Tue, 7 Nov 2006 17:22:43 -0500 (EST) [thread overview]
Message-ID: <Pine.WNT.4.63.0611071716170.4048@nqvgln> (raw)
In-Reply-To: <Pine.WNT.4.63.0611071640560.4048@nqvgln>
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
next prev parent reply other threads:[~2006-11-07 22:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-07 19:43 Jeff Smith
2006-11-07 21:42 ` Aditya Mahajan
2006-11-07 22:22 ` Aditya Mahajan [this message]
2006-11-09 16:54 ` Jeff Smith
2006-11-09 18:39 ` Aditya Mahajan
2006-11-14 11:33 ` Hans Hagen
2006-11-14 16:53 ` Aditya Mahajan
2006-11-14 16:57 ` Hans Hagen
2006-11-15 15:38 ` Hans Hagen
2006-11-16 1:14 ` Aditya Mahajan
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=Pine.WNT.4.63.0611071716170.4048@nqvgln \
--to=adityam@umich.edu \
--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).