Incorrect sorting in \completelistofabbreviations for numbers
Hi everyone, I think I've found a sorting bug in \completelistofabbreviations in the latest LMTX (and probably also MKIV). When using this minimal example \abbreviation[OTT]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X} \starttext \completelistofabbreviations[criterium=all] \stoptext I get ABC A, B, and C 123 One, Two, and Three ZYX Z, Y, and X Numbers should go before letters. Do you know any workaround/fix for that? Best, Markus
On Thu, Jun 10, 2021 at 11:08 AM Markus Brandt < markus.brandt@sit.tu-darmstadt.de> wrote:
Hi everyone,
I think I've found a sorting bug in \completelistofabbreviations in the latest LMTX (and probably also MKIV). When using this minimal example
\abbreviation[OTT]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X}
\starttext \completelistofabbreviations[criterium=all] \stoptext
I get
ABC A, B, and C 123 One, Two, and Three ZYX Z, Y, and X
Numbers should go before letters. Do you know any workaround/fix for that?
aren't they sorted by the tag ? By default the synonim is the tag; only the first one has an explicit tag (OTT) so the order is ABC, OTT, ZXY, which looks ok. -- luigi
yes, seems like they are sorted by tag. But that’s not useful, since you cannot use numbers in a tag. This tag is just the workaround for abbreviations that include numbers.
From: ntg-context
On Thu, Jun 10, 2021 at 11:39 AM Markus Brandt < markus.brandt@sit.tu-darmstadt.de> wrote:
yes, seems like they are sorted by tag. But that’s not useful, since you cannot use numbers in a tag. This tag is just the workaround for abbreviations that include numbers.
\abbreviation[0123]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X} \starttext \csname 0123\endcsname \completelistofabbreviations[criterium=all] \stoptext -- luigi
On 2021-06-10 11:52, luigi scarso wrote:
On Thu, Jun 10, 2021 at 11:39 AM Markus Brandt
wrote: yes, seems like they are sorted by tag. But that’s not useful, since you cannot use numbers in a tag. This tag is just the workaround for abbreviations that include numbers.
\abbreviation[0123]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X}
\starttext \csname 0123\endcsname \completelistofabbreviations[criterium=all] \stoptext -- luigi ___________________________________________________________________________________ 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 ___________________________________________________________________________________
That works kind of. Now the numbers are at the button.
On 6/10/2021 12:02 PM, Markus Brandt wrote:
On 2021-06-10 11:52, luigi scarso wrote:
On Thu, Jun 10, 2021 at 11:39 AM Markus Brandt
wrote: yes, seems like they are sorted by tag. But that’s not useful, since you cannot use numbers in a tag. This tag is just the workaround for abbreviations that include numbers.
\abbreviation[0123]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X}
\starttext \csname 0123\endcsname \completelistofabbreviations[criterium=all] \stoptext -- luigi
That works kind of. Now the numbers are at the button.
\completelistofabbreviations[criterium=all,method=first] I'll add a sortkey as option assuming that you will wikify it: \abbreviation[OTT]{123}{One, Two, and Three} \abbreviation[TTO][321]{321}{Three, Two, One} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X} \definesynonym[yes][abbreviation][ZZZ]{PQR}{P, Q or R} \starttext \completelistofabbreviations[criterium=all,method=first] \stoptext 321 Three, Two, One ABC A, B, and C 123 One, Two, and Three ZYX Z, Y, and X PQR P, Q or R ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 2021-06-10 13:36, Hans Hagen wrote:
On 6/10/2021 12:02 PM, Markus Brandt wrote:
On 2021-06-10 11:52, luigi scarso wrote:
On Thu, Jun 10, 2021 at 11:39 AM Markus Brandt
wrote: yes, seems like they are sorted by tag. But that’s not useful, since you cannot use numbers in a tag. This tag is just the workaround for abbreviations that include numbers.
\abbreviation[0123]{123}{One, Two, and Three} \abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X}
\starttext \csname 0123\endcsname \completelistofabbreviations[criterium=all] \stoptext -- luigi
That works kind of. Now the numbers are at the button.
\completelistofabbreviations[criterium=all,method=first]
I'll add a sortkey as option assuming that you will wikify it:
\abbreviation[OTT]{123}{One, Two, and Three}
\abbreviation[TTO][321]{321}{Three, Two, One}
\abbreviation{ABC}{A, B, and C} \abbreviation{ZYX}{Z, Y, and X}
\definesynonym[yes][abbreviation][ZZZ]{PQR}{P, Q or R}
\starttext
\completelistofabbreviations[criterium=all,method=first]
\stoptext
321 Three, Two, One ABC A, B, and C 123 One, Two, and Three ZYX Z, Y, and X PQR P, Q or R
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hi, Thanks. 'method' is missing in the Wiki. It works fine when using it in combination with \csname to use the abbreviation. I guess the change you propose would affect \synonym in generell, right? This change would make code with the sortkey option incompatible with older versions. Wouldn't adding a sortkey to completelistofsynonyms/setupsynonyms be a better option? Something like sortkey = name|text|content. Just asking out of curiosity. Best, Markus
On 6/10/2021 2:10 PM, Markus Brandt wrote:
Thanks. 'method' is missing in the Wiki. It works fine when using it in combination with \csname to use the abbreviation.
I guess the change you propose would affect \synonym in generell, right? This change would make code with the sortkey option incompatible with older versions. Wouldn't adding a sortkey to completelistofsynonyms/setupsynonyms be a better option? Something like sortkey = name|text|content. Just asking out of curiosity. it's per defined synonym (optional extra argument) ... such additions never result in incompatibilities
it's as with indices where we have sortkeys ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
luigi scarso
-
Markus Brandt