ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] chronological TOC
@ 2024-01-26 22:46 jbf
  2024-01-27  9:05 ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2024-01-26 22:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 967 bytes --]

I wonder if someone can point me in the right direction for a separate 
TOC which needs to be in chronological order at the back of the book 
(i.e. not in page number order, although I need the page numbers to show 
up in the TOC. There is the normal TOC at the front of the book, 
according to chapter titles.

I have succeeded in defining a separate TOC to place at the back, but 
have not succeeded in the chronological order! Here is what I have done:

\definelist[chron][criterium=all,alternative=c]

At the back of the book:

\placelist[chron][criterium=all]

Then at an appropriate point after each \startchapter I have placed (as 
an example):

\writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}

This gives me my list, but in page number order. How do I get the date 
(e.g. 29 April 2017) to be the ordering factor in the list. I assume it 
will be something to do with criterium, but am clueless at the moment on 
how to indicate this.

Julian

[-- Attachment #1.2: Type: text/html, Size: 1809 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-26 22:46 [NTG-context] chronological TOC jbf
@ 2024-01-27  9:05 ` Henning Hraban Ramm
  2024-01-29 19:15   ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-01-27  9:05 UTC (permalink / raw)
  To: ntg-context

Am 26.01.24 um 23:46 schrieb jbf:
> I wonder if someone can point me in the right direction for a separate 
> TOC which needs to be in chronological order at the back of the book 
> (i.e. not in page number order, although I need the page numbers to show 
> up in the TOC. There is the normal TOC at the front of the book, 
> according to chapter titles.
> 
> I have succeeded in defining a separate TOC to place at the back, but 
> have not succeeded in the chronological order! Here is what I have done:
> 
> \definelist[chron][criterium=all,alternative=c]
> 
> At the back of the book:
> 
> \placelist[chron][criterium=all]
> 
> Then at an appropriate point after each \startchapter I have placed (as 
> an example):
> 
> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
> 
> This gives me my list, but in page number order. How do I get the date 
> (e.g. 29 April 2017) to be the ordering factor in the list. I assume it 
> will be something to do with criterium, but am clueless at the moment on 
> how to indicate this.

I don’t know if it works this way (the wizards will know a way), but for 
special needs I’m (ab)using indexes:
just add something like \index[2017-04-29]{Speech, Panama City} to your 
chapter command and setup the index at will.

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-27  9:05 ` [NTG-context] " Henning Hraban Ramm
@ 2024-01-29 19:15   ` Wolfgang Schuster
  2024-01-29 20:12     ` Bruce Horrocks
  2024-01-29 20:45     ` jbf
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2024-01-29 19:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
> Am 26.01.24 um 23:46 schrieb jbf:
>> I wonder if someone can point me in the right direction for a separate 
>> TOC which needs to be in chronological order at the back of the book 
>> (i.e. not in page number order, although I need the page numbers to 
>> show up in the TOC. There is the normal TOC at the front of the book, 
>> according to chapter titles.
>>
>> I have succeeded in defining a separate TOC to place at the back, but 
>> have not succeeded in the chronological order! Here is what I have done:
>>
>> \definelist[chron][criterium=all,alternative=c]
>>
>> At the back of the book:
>>
>> \placelist[chron][criterium=all]
>>
>> Then at an appropriate point after each \startchapter I have placed 
>> (as an example):
>>
>> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
>>
>> This gives me my list, but in page number order. How do I get the date 
>> (e.g. 29 April 2017) to be the ordering factor in the list. I assume 
>> it will be something to do with criterium, but am clueless at the 
>> moment on how to indicate this.
> 
> I don’t know if it works this way (the wizards will know a way), but for 
> special needs I’m (ab)using indexes:
> just add something like \index[2017-04-29]{Speech, Panama City} to your 
> chapter command and setup the index at will.

Lists have a sort option but this is no use here because you can't use 
the title to have a chronological sorted list.

\starttext

\placelist[section][order=title]

\section{Hans}

\section{Peter}

\section{Anton}

\stoptext

Using the register mechanism as you suggest seems to be the best option 
in this case.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-29 19:15   ` Wolfgang Schuster
@ 2024-01-29 20:12     ` Bruce Horrocks
  2024-01-29 20:45     ` jbf
  1 sibling, 0 replies; 7+ messages in thread
From: Bruce Horrocks @ 2024-01-29 20:12 UTC (permalink / raw)
  To: ntg-context mailing list

On 29 Jan 2024, at 19:15, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
> Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
>> Am 26.01.24 um 23:46 schrieb jbf:
>>> I wonder if someone can point me in the right direction for a separate TOC which needs to be in chronological order at the back of the book (i.e. not in page number order, although I need the page numbers to show up in the TOC. There is the normal TOC at the front of the book, according to chapter titles.
>>> 
>>> I have succeeded in defining a separate TOC to place at the back, but have not succeeded in the chronological order! Here is what I have done:
>>> 
>>> \definelist[chron][criterium=all,alternative=c]
>>> 
>>> At the back of the book:
>>> 
>>> \placelist[chron][criterium=all]
>>> 
>>> Then at an appropriate point after each \startchapter I have placed (as an example):
>>> 
>>> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
>>> 
>>> This gives me my list, but in page number order. How do I get the date (e.g. 29 April 2017) to be the ordering factor in the list. I assume it will be something to do with criterium, but am clueless at the moment on how to indicate this.
>> I don’t know if it works this way (the wizards will know a way), but for special needs I’m (ab)using indexes:
>> just add something like \index[2017-04-29]{Speech, Panama City} to your chapter command and setup the index at will.
> 
> Lists have a sort option but this is no use here because you can't use the title to have a chronological sorted list.
> 
> \starttext
> 
> \placelist[section][order=title]
> 
> \section{Hans}
> 
> \section{Peter}
> 
> \section{Anton}
> 
> \stoptext
> 
> Using the register mechanism as you suggest seems to be the best option in this case.

The order= mechanism doesn't seem to work for \definelist lists as opposed to the built-in ones, viz:

\definelist[chron]
\starttext

\placelist[section][order=title]

\section{Hans}
\writetolist[chron]{}{Hans}

\section{Peter}
\writetolist[chron]{}{Peter}

\section{Anton}
\writetolist[chron]{}{Anton}

\placelist[chron][criterium=all,order=title]
\stoptext


—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-29 19:15   ` Wolfgang Schuster
  2024-01-29 20:12     ` Bruce Horrocks
@ 2024-01-29 20:45     ` jbf
  2024-01-30  8:05       ` Henning Hraban Ramm
  1 sibling, 1 reply; 7+ messages in thread
From: jbf @ 2024-01-29 20:45 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

And indeed this is the best solution I could find, though it obviously 
meant that something like '29 April 2017' was no good for sorting on... 
it has to be the US date format YY-MM-DD

Julian

On 30/1/24 06:15, Wolfgang Schuster wrote:
> Henning Hraban Ramm schrieb am 27.01.2024 um 10:05:
>> Am 26.01.24 um 23:46 schrieb jbf:
>>> I wonder if someone can point me in the right direction for a 
>>> separate TOC which needs to be in chronological order at the back of 
>>> the book (i.e. not in page number order, although I need the page 
>>> numbers to show up in the TOC. There is the normal TOC at the front 
>>> of the book, according to chapter titles.
>>>
>>> I have succeeded in defining a separate TOC to place at the back, 
>>> but have not succeeded in the chronological order! Here is what I 
>>> have done:
>>>
>>> \definelist[chron][criterium=all,alternative=c]
>>>
>>> At the back of the book:
>>>
>>> \placelist[chron][criterium=all]
>>>
>>> Then at an appropriate point after each \startchapter I have placed 
>>> (as an example):
>>>
>>> \writetolist[chron]{}{{\bf 29 April 2017,} Speech, Panama City}
>>>
>>> This gives me my list, but in page number order. How do I get the 
>>> date (e.g. 29 April 2017) to be the ordering factor in the list. I 
>>> assume it will be something to do with criterium, but am clueless at 
>>> the moment on how to indicate this.
>>
>> I don’t know if it works this way (the wizards will know a way), but 
>> for special needs I’m (ab)using indexes:
>> just add something like \index[2017-04-29]{Speech, Panama City} to 
>> your chapter command and setup the index at will.
>
> Lists have a sort option but this is no use here because you can't use 
> the title to have a chronological sorted list.
>
> \starttext
>
> \placelist[section][order=title]
>
> \section{Hans}
>
> \section{Peter}
>
> \section{Anton}
>
> \stoptext
>
> Using the register mechanism as you suggest seems to be the best 
> option in this case.
>
> Wolfgang
> ___________________________________________________________________________________ 
>
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
> (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________ 
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-29 20:45     ` jbf
@ 2024-01-30  8:05       ` Henning Hraban Ramm
  2024-01-30 12:08         ` BPJ
  0 siblings, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-01-30  8:05 UTC (permalink / raw)
  To: ntg-context

Am 29.01.24 um 21:45 schrieb jbf:
> And indeed this is the best solution I could find, though it obviously 
> meant that something like '29 April 2017' was no good for sorting on... 
> it has to be the US date format YY-MM-DD

How did you expect a simple sorting algorithm to sort by verbose dates?
BTW, YYYY-MM-DD is ISO 8601.

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [NTG-context] Re: chronological TOC
  2024-01-30  8:05       ` Henning Hraban Ramm
@ 2024-01-30 12:08         ` BPJ
  0 siblings, 0 replies; 7+ messages in thread
From: BPJ @ 2024-01-30 12:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1476 bytes --]

Den tis 30 jan. 2024 09:06Henning Hraban Ramm <texml@fiee.net> skrev:

> Am 29.01.24 um 21:45 schrieb jbf:
> > And indeed this is the best solution I could find, though it obviously
> > meant that something like '29 April 2017' was no good for sorting on...
> > it has to be the US date format YY-MM-DD
>
> How did you expect a simple sorting algorithm to sort by verbose dates?
> BTW, YYYY-MM-DD is ISO 8601.
>

Just out of curiosity from an occasional user: is it possible in indices to
specify a separate sort key and displayed term as you can with makeindex? I
remember back in the nineties I used numeric sort keys for a Sanskrit index
where the letters were Latin (with lots of diacritics) but the sort order
was Indic (a, ā, i, ī, ... k, kh, g, gh, ...). I assigned a two-digit
"number" (01, 02, 03, ...) to each grapheme and the sort key consisted of
hyphen-separated such numbers.


> Hraban
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 2583 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-30 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 22:46 [NTG-context] chronological TOC jbf
2024-01-27  9:05 ` [NTG-context] " Henning Hraban Ramm
2024-01-29 19:15   ` Wolfgang Schuster
2024-01-29 20:12     ` Bruce Horrocks
2024-01-29 20:45     ` jbf
2024-01-30  8:05       ` Henning Hraban Ramm
2024-01-30 12:08         ` BPJ

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).