* Indenting number in TOC, particular numbering scheme, and other questions
@ 2019-12-02 8:43 Daniel Haid
2019-12-03 15:24 ` Hans Hagen
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Haid @ 2019-12-02 8:43 UTC (permalink / raw)
To: ntg-context
Hello everyone,
I just started to experiment with ConTeXt. I have a few issues with my
first document structure. I need a very particular numbering scheme,
which I have tried to implement. I have appended the document below.
1. Why is there no indenting in the TOC starting with (what I call)
level 7? This could have to something with the fact that the levels
starting from 7 are defined in the subsub module?
2. Why are the numbers in the headings inside the main text not printed
for levels 8 and 9? Interestingly, they *are* printed for level 7, which
is defined in the subsub module. I have looked into m-subsub.mkiv and
saw no difference at all between the different levels defined there.
3. Is it possible to indent not only the section name but also the
number in the TOC? Moreover, I would like to have a dot after the first
three levels, but not the other ones (in the TOC and in the text), like
this:
A. First Level .................. 1
I. Second Level ............. 2
1. Third Level .......... 3
a) Fourth Level ..... 4
...
4. I use the conversions A, I, 1 (without dot), and then defined my own
ones "a)", "aa)", etc. *with* the ")". I think this is correct, since
the way a section has to be referenced in the text is like this (for
example):
B.IV.5.c).aa).(4)
Is there a way to get this? Moreover, is it possible to have a relative
referencing command, for example, if section B.IV.5.d) is quoted from
inside section B.IV.6.f) the command should only print 5.d) since the
B.IV is implied.
5. How can I get rid of the additional vertical space before the second
entry "B. Another first level" (chapter)?
6. I wanted to define aliases for the \subsub...subsection commands,
since they are difficult to read, and I used \def as you can see below.
Is this the right way to do it or would you recommend something else?
Any help would be greatly appreciated.
D.
----------
\usemodule[subsub]
\usetypescript[termes]
\setupbodyfont[termes,12pt]
\def\arconv#1{\alphabeticnumerals{#1})}
\defineconversion[ar][\arconv]
\def\aarconv#1{\alphabeticnumerals{#1}\alphabeticnumerals{#1})}
\defineconversion[aar][\aarconv]
\def\lnrconv#1{(\numbers{#1})}
\defineconversion[lnr][\lnrconv]
\def\larconv#1{(\alphabeticnumerals{#1})}
\defineconversion[lar][\larconv]
\def\laarconv#1{(\alphabeticnumerals{#1}\alphabeticnumerals{#1})}
\defineconversion[laar][\laarconv]
\def\alpharconv#1{\greeknumerals{#1})}
\defineconversion[alphar][\alpharconv]
\definestructureconversionset[myconvset][,A,I,n,ar,aar,lnr,lar,laar,alphar]
\setupheads[part,
chapter,
section,
subsection,
subsubsection,
subsubsubsection,
subsubsubsubsection,
subsubsubsubsubsection,
subsubsubsubsubsubsection,
subsubsubsubsubsubsubsection][sectionconversionset=myconvset]
\setuphead[chapter][sectionsegments=chapter]
\setuphead[section][sectionsegments=section]
\setuphead[subsection][sectionsegments=subsection]
\setuphead[subsubsection][sectionsegments=subsubsection]
\setuphead[subsubsubsection][sectionsegments=subsubsubsection]
\setuphead[subsubsubsubsection][sectionsegments=subsubsubsubsection]
\setuphead[subsubsubsubsubsection][sectionsegments=subsubsubsubsubsection]
\setuphead[subsubsubsubsubsubsection][sectionsegments=subsubsubsubsubsubsection]
\setuphead[subsubsubsubsubsubsubsection][sectionsegments=subsubsubsubsubsubsubsection]
\def\startA{\startchapter}
\def\stopA{\stopchapter}
\def\startI{\startsection}
\def\stopI{\stopsection}
\def\startS{\startsubsection}
\def\stopS{\stopsubsection}
\def\startSS{\startsubsubsection}
\def\stopSS{\stopsubsubsection}
\def\startSSS{\startsubsubsubsection}
\def\stopSSS{\stopsubsubsubsection}
\def\startX{\startsubsubsubsubsection}
\def\stopX{\stopsubsubsubsubsection}
\def\startXX{\startsubsubsubsubsubsection}
\def\stopXX{\stopsubsubsubsubsubsection}
\def\startXXX{\startsubsubsubsubsubsubsection}
\def\stopXXX{\stopsubsubsubsubsubsubsection}
\def\startXXXX{\startsubsubsubsubsubsubsubsection}
\def\stopXXXX{\stopsubsubsubsubsubsubsubsection}
\setupcombinedlist[content][list={chapter,
section,
subsection,
subsubsection,
subsubsubsection,
subsubsubsubsection,
subsubsubsubsubsection,
subsubsubsubsubsubsection,
subsubsubsubsubsubsubsection},alternative=c]
\starttext
\placecontent
\startA[title={First level}]
\startI[title={Second level}]
\startS[title={Third level}]
\startSS[title={Fourth level}]
\startSSS[title={Fifth level}]
\startX[title={Sixth level}]
\startXX[title={Seventh level}]
\startXXX[title={Eighth level}]
\startXXXX[title={Ninth level}]
\stopXXXX
\stopXXX
\stopXX
\stopX
\stopSSS
\stopSS
\stopS
\stopI
\stopA
\startA[title={Another first level}]
\stopA
\stoptext
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Indenting number in TOC, particular numbering scheme, and other questions
2019-12-02 8:43 Indenting number in TOC, particular numbering scheme, and other questions Daniel Haid
@ 2019-12-03 15:24 ` Hans Hagen
2019-12-04 17:55 ` Daniel Haid
0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2019-12-03 15:24 UTC (permalink / raw)
To: mailing list for ConTeXt users, Daniel Haid
On 12/2/2019 9:43 AM, Daniel Haid wrote:
> Hello everyone,
>
> I just started to experiment with ConTeXt. I have a few issues with my
> first document structure. I need a very particular numbering scheme,
> which I have tried to implement. I have appended the document below.
>
> 1. Why is there no indenting in the TOC starting with (what I call)
> level 7? This could have to something with the fact that the levels
> starting from 7 are defined in the subsub module?
because these lists don't inherit (ancient downward compatibility) btui
i'll at leat at these to strc-def.mkiv:
\setuplist [\v!subsubsubsubsubsection] [\c!width=8\emwidth]
\setuplist [\v!subsubsubsubsubsubsection] [\c!width=9\emwidth]
\setuplist [\v!subsubsubsubsubsubsubsection] [\c!width=10\emwidth]
\setuplist [\v!subsubsubsubsubsubsubsubsection] [\c!width=11\emwidth]
\setuplist [\v!subsubsubsubsubsubsubsubsubsection] [\c!width=12\emwidth]
> 2. Why are the numbers in the headings inside the main text not printed
> for levels 8 and 9? Interestingly, they *are* printed for level 7, which
> is defined in the subsub module. I have looked into m-subsub.mkiv and
> saw no difference at all between the different levels defined there.
which version
> 3. Is it possible to indent not only the section name but also the
> number in the TOC? Moreover, I would like to have a dot after the first
> three levels, but not the other ones (in the TOC and in the text), like
> this:
>
> A. First Level .................. 1
> I. Second Level ............. 2
> 1. Third Level .......... 3
> a) Fourth Level ..... 4
> ...
\setuplist[subsection] [margin=4em,width=fit,distance=1em]
\setuplist[subsubsection][margin=5em,width=fit,distance=1em]
ect
> 4. I use the conversions A, I, 1 (without dot), and then defined my own
> ones "a)", "aa)", etc. *with* the ")". I think this is correct, since
> the way a section has to be referenced in the text is like this (for
> example):
>
> B.IV.5.c).aa).(4)
>
> Is there a way to get this? Moreover, is it possible to have a relative
> referencing command, for example, if section B.IV.5.d) is quoted from
> inside section B.IV.6.f) the command should only print 5.d) since the
> B.IV is implied.
the "stopper" parameter can be used, and one can define at the head and
list level (i think that there are some examples in the test suite)
> 5. How can I get rid of the additional vertical space before the second
> entry "B. Another first level" (chapter)?
\setuplist[chapter][before=,after=]
> 6. I wanted to define aliases for the \subsub...subsection commands,
> since they are difficult to read, and I used \def as you can see below.
> Is this the right way to do it or would you recommend something else?
\definehead[A][chapter]
and add A to the combined list
> Any help would be greatly appreciated.
>
> D.
>
> ----------
>
> \usemodule[subsub]
>
> \usetypescript[termes]
> \setupbodyfont[termes,12pt]
>
> \def\arconv#1{\alphabeticnumerals{#1})}
> \defineconversion[ar][\arconv]
>
> \def\aarconv#1{\alphabeticnumerals{#1}\alphabeticnumerals{#1})}
> \defineconversion[aar][\aarconv]
>
> \def\lnrconv#1{(\numbers{#1})}
> \defineconversion[lnr][\lnrconv]
>
> \def\larconv#1{(\alphabeticnumerals{#1})}
> \defineconversion[lar][\larconv]
>
> \def\laarconv#1{(\alphabeticnumerals{#1}\alphabeticnumerals{#1})}
> \defineconversion[laar][\laarconv]
>
> \def\alpharconv#1{\greeknumerals{#1})}
> \defineconversion[alphar][\alpharconv]
>
> \definestructureconversionset[myconvset][,A,I,n,ar,aar,lnr,lar,laar,alphar]
>
> \setupheads[part,
> chapter,
> section,
> subsection,
> subsubsection,
> subsubsubsection,
> subsubsubsubsection,
> subsubsubsubsubsection,
> subsubsubsubsubsubsection,
> subsubsubsubsubsubsubsection][sectionconversionset=myconvset]
>
> \setuphead[chapter][sectionsegments=chapter]
> \setuphead[section][sectionsegments=section]
> \setuphead[subsection][sectionsegments=subsection]
> \setuphead[subsubsection][sectionsegments=subsubsection]
> \setuphead[subsubsubsection][sectionsegments=subsubsubsection]
> \setuphead[subsubsubsubsection][sectionsegments=subsubsubsubsection]
> \setuphead[subsubsubsubsubsection][sectionsegments=subsubsubsubsubsection]
> \setuphead[subsubsubsubsubsubsection][sectionsegments=subsubsubsubsubsubsection]
>
> \setuphead[subsubsubsubsubsubsubsection][sectionsegments=subsubsubsubsubsubsubsection]
>
>
> \def\startA{\startchapter}
> \def\stopA{\stopchapter}
> \def\startI{\startsection}
> \def\stopI{\stopsection}
> \def\startS{\startsubsection}
> \def\stopS{\stopsubsection}
> \def\startSS{\startsubsubsection}
> \def\stopSS{\stopsubsubsection}
> \def\startSSS{\startsubsubsubsection}
> \def\stopSSS{\stopsubsubsubsection}
> \def\startX{\startsubsubsubsubsection}
> \def\stopX{\stopsubsubsubsubsection}
> \def\startXX{\startsubsubsubsubsubsection}
> \def\stopXX{\stopsubsubsubsubsubsection}
> \def\startXXX{\startsubsubsubsubsubsubsection}
> \def\stopXXX{\stopsubsubsubsubsubsubsection}
> \def\startXXXX{\startsubsubsubsubsubsubsubsection}
> \def\stopXXXX{\stopsubsubsubsubsubsubsubsection}
>
> \setupcombinedlist[content][list={chapter,
> section,
> subsection,
> subsubsection,
> subsubsubsection,
> subsubsubsubsection,
> subsubsubsubsubsection,
> subsubsubsubsubsubsection,
> subsubsubsubsubsubsubsection},alternative=c]
>
> \starttext
>
> \placecontent
>
> \startA[title={First level}]
> \startI[title={Second level}]
> \startS[title={Third level}]
> \startSS[title={Fourth level}]
> \startSSS[title={Fifth level}]
> \startX[title={Sixth level}]
> \startXX[title={Seventh level}]
> \startXXX[title={Eighth level}]
> \startXXXX[title={Ninth level}]
> \stopXXXX
> \stopXXX
> \stopXX
> \stopX
> \stopSSS
> \stopSS
> \stopS
> \stopI
> \stopA
>
> \startA[title={Another first level}]
> \stopA
>
> \stoptext
> ___________________________________________________________________________________
>
> 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
> ___________________________________________________________________________________
>
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 5+ messages in thread
* Re: Indenting number in TOC, particular numbering scheme, and other questions
2019-12-03 15:24 ` Hans Hagen
@ 2019-12-04 17:55 ` Daniel Haid
2019-12-04 18:02 ` Wolfgang Schuster
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Haid @ 2019-12-04 17:55 UTC (permalink / raw)
To: Hans Hagen, mailing list for ConTeXt users
On 12/3/19 4:24 PM, Hans Hagen wrote:
> which version
I just found out that it is too old (2016.05.17 19:20), I will update.
With the one from https://live.contextgarden.net/ it works!
Thank you. With the help of your answers I have been able to implement
everything except for the references.
To clarify what I want to achieve I have written a smaller example that
gives the correct output (manually). I use
\setupreferencestructureprefix[default][prefixsegments=x:y]\in[foo].
everywhere to get the proper levels x:y.
1) Is there a quicker way to get this instead of writing
setupreferencestructureprefix everywhere? Something like \in[x:y][foo].
2) Can this somehow be automated? Something like \in[auto][foo] should
automatically choose y as the level of foo and x as the first level
where foo and the current section differ.
Best wishes,
D.
----------
\usemodule[subsub]
\usetypescript[termes]
\setupbodyfont[termes,12pt]
\def\arconv#1{\alphabeticnumerals{#1})}
\defineconversion[ar][\arconv]
\def\aarconv#1{\alphabeticnumerals{#1}\alphabeticnumerals{#1})}
\defineconversion[aar][\aarconv]
\definestructureconversionset[myconvset][,A,I,n,ar,aar]
\setupheads[part,
chapter,
section,
subsection,
subsubsection,
subsubsubsection][sectionconversionset=myconvset]
\setuphead[chapter][sectionsegments=chapter,style=bold,
after={\blank[small]},before={\blank[big]},sectionstopper=.]
\setuphead[section][sectionsegments=section,style=bold,
after={\blank[small]},before={\blank[big]},sectionstopper=.]
\setuphead[subsection][sectionsegments=subsection]
\setuphead[subsubsection][sectionsegments=subsubsection,sectionstopper=]
\setuphead[subsubsubsection][sectionsegments=subsubsubsection]
\starttext
\startchapter[title={Chapter}]
\startsection[title={Section}]
\startsubsection[title={Subsection}]
\startsubsubsection[title={First Subsubsection}]
\startsubsubsubsection[title={Foo}, reference=foo]
\stopsubsubsubsection
\startsubsubsection[title={Second subsubsection}]
\startsubsubsubsection[title={Bar}, reference=bar]
\stopsubsubsubsection
\stopsubsubsection
\startsubsubsubsection[title={Baz}, reference=bar]
Foo is in the current subsection, but a different
subsubsection, so we refer to it as
\setupreferencestructureprefix[default][prefixsegments=5:6]\in[foo].
Bar is in the current subsubsection, so we refer to it as
\setupreferencestructureprefix[default][prefixsegments=6:6]\in[bar].
Of course, we can always also have a full reference like
\setupreferencestructureprefix[default][prefixsegments=2:6]\in[bar].
\stopsubsubsubsection
\stopsubsection
\stopsection
\stopchapter
\stoptext
___________________________________________________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2019-12-04 19:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 8:43 Indenting number in TOC, particular numbering scheme, and other questions Daniel Haid
2019-12-03 15:24 ` Hans Hagen
2019-12-04 17:55 ` Daniel Haid
2019-12-04 18:02 ` Wolfgang Schuster
2019-12-04 19:08 ` Daniel Haid
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).