ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Incorrect sorting in \completelistofabbreviations for numbers
@ 2021-06-10  8:59 Markus Brandt
  2021-06-10  9:32 ` luigi scarso
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Brandt @ 2021-06-10  8:59 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10  8:59 Incorrect sorting in \completelistofabbreviations for numbers Markus Brandt
@ 2021-06-10  9:32 ` luigi scarso
  2021-06-10  9:39   ` Markus Brandt
  0 siblings, 1 reply; 8+ messages in thread
From: luigi scarso @ 2021-06-10  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

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

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

___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10  9:32 ` luigi scarso
@ 2021-06-10  9:39   ` Markus Brandt
  2021-06-10  9:52     ` luigi scarso
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Brandt @ 2021-06-10  9:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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 <ntg-context-bounces@ntg.nl> on behalf of luigi scarso <luigi.scarso@gmail.com>
Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Date: Thursday, June 10, 2021 at 11:35
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: [NTG-context] Incorrect sorting in completelistofabbreviations for numbers

 

 

 

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

___________________________________________________________________________________ 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 ___________________________________________________________________________________ 


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

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

___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10  9:39   ` Markus Brandt
@ 2021-06-10  9:52     ` luigi scarso
  2021-06-10 10:02       ` Markus Brandt
  0 siblings, 1 reply; 8+ messages in thread
From: luigi scarso @ 2021-06-10  9:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

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

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

___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10  9:52     ` luigi scarso
@ 2021-06-10 10:02       ` Markus Brandt
  2021-06-10 11:36         ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Brandt @ 2021-06-10 10:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 2021-06-10 11:52, luigi scarso wrote:
> 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
> ___________________________________________________________________________________
> 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.
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10 10:02       ` Markus Brandt
@ 2021-06-10 11:36         ` Hans Hagen
  2021-06-10 12:10           ` Markus Brandt
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2021-06-10 11:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Markus Brandt

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

> 
> 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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10 11:36         ` Hans Hagen
@ 2021-06-10 12:10           ` Markus Brandt
  2021-06-10 12:37             ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Brandt @ 2021-06-10 12:10 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

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
>>> <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
> 
>> 
>> 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
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Incorrect sorting in \completelistofabbreviations for numbers
  2021-06-10 12:10           ` Markus Brandt
@ 2021-06-10 12:37             ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2021-06-10 12:37 UTC (permalink / raw)
  To: Markus Brandt; +Cc: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2021-06-10 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  8:59 Incorrect sorting in \completelistofabbreviations for numbers Markus Brandt
2021-06-10  9:32 ` luigi scarso
2021-06-10  9:39   ` Markus Brandt
2021-06-10  9:52     ` luigi scarso
2021-06-10 10:02       ` Markus Brandt
2021-06-10 11:36         ` Hans Hagen
2021-06-10 12:10           ` Markus Brandt
2021-06-10 12:37             ` Hans Hagen

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