Re: [NTG-context] Create an enumeration style

2021-08-27 Thread Rudolf Bahr via ntg-context
On Fri, Aug 27, 2021 at 11:26:47AM +0200, Vincent Hennebert via ntg-context 
wrote:
> On Wed, 2021-08-11 at 10:23 +0200, Hans Hagen via ntg-context wrote:
> > On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote:
> > > 
> > > 
> > > > On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context  > > > cont...@ntg.nl> wrote:
> > > > (…)
> > > > core-con.lua (line 1155):
> > > > 
> > > > local ordinals = {
> > > >  [...]
> > > >  french = function(n)
> > > >  if n == 1 then
> > > >  return "er"
> > > > +   else
> > > > +   return "e"
> > > >  end
> > > >  end,
> > > > }
> > > 
> > > Hi Wolfgang,
> > > 
> > > Thanks for the example and the fix, but I would rather think that the
> > > « french » part of ordinals should be
> > > 
> > > french = function(n)
> > > if n == 1 then
> > > return « er"
> > > else
> > >  return « ème"
> > > end
> > > end,
> > > 
> > > Now if this were not accepted as a fix in core-con.lua, is there a
> > > way for a user to change the default to the above choice in his
> > > document ?
> > 
> > it is no problem to fix if you all can agree on what/how to fix ...
> 
> The purpose of abbreviations is, well, to abbreviate. Even though ‘ème’
> is seen a lot, it’s wrong because it’s too long. Source (pretty
> official):
> https://www.academie-francaise.fr/abreviations-des-adjectifs-numeraux
> 
> So for numbers starting from 3 the proper abbreviation is ‘e’.
> 
> For 1 and 2 it’s more complicated, however, as it depends on the
> gender. For 1:
> * masculine: 1er
> * feminine: 1re
> 
> In addition for 2, and when the enumeration contains only 2 elements,
> there is the option to use the older word ‘second(e)’:
> * masculine: 2d
> * feminine: 2de
> 
> For 3 elements and above, we always use the newer word ‘deuxième’,
> which is abbreviated in the form of the generic ‘e’.
> 
> While that rule is optional, people who use tools like ConTeXt are
> likely to pay attention to that kind of details and will probably want
> to use it.
> 
> Finally, we have to add an ‘s’ to all the abbreviations if the plural
> is needed (the 1st (1ers) elements, the 2nd (2ds or 2es) elements,
> etc., vs the 1st (1er) element, 2nd (2d or 2e) element…).
> 
> Now, can all those subtleties be coded in a function? :)
> 
> Vincent

Bravo! Comme un professeur!

Best wishes, Rudolf

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


Re: [NTG-context] Create an enumeration style

2021-08-27 Thread Vincent Hennebert via ntg-context
On Wed, 2021-08-11 at 10:23 +0200, Hans Hagen via ntg-context wrote:
> On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote:
> > 
> > 
> > > On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context  > > cont...@ntg.nl> wrote:
> > > (…)
> > > core-con.lua (line 1155):
> > > 
> > > local ordinals = {
> > >  [...]
> > >  french = function(n)
> > >  if n == 1 then
> > >  return "er"
> > > +   else
> > > +   return "e"
> > >  end
> > >  end,
> > > }
> > 
> > Hi Wolfgang,
> > 
> > Thanks for the example and the fix, but I would rather think that the
> > « french » part of ordinals should be
> > 
> > french = function(n)
> > if n == 1 then
> > return « er"
> > else
> >  return « ème"
> > end
> > end,
> > 
> > Now if this were not accepted as a fix in core-con.lua, is there a
> > way for a user to change the default to the above choice in his
> > document ?
> 
> it is no problem to fix if you all can agree on what/how to fix ...

The purpose of abbreviations is, well, to abbreviate. Even though ‘ème’
is seen a lot, it’s wrong because it’s too long. Source (pretty
official):
https://www.academie-francaise.fr/abreviations-des-adjectifs-numeraux

So for numbers starting from 3 the proper abbreviation is ‘e’.

For 1 and 2 it’s more complicated, however, as it depends on the
gender. For 1:
* masculine: 1er
* feminine: 1re

In addition for 2, and when the enumeration contains only 2 elements,
there is the option to use the older word ‘second(e)’:
* masculine: 2d
* feminine: 2de

For 3 elements and above, we always use the newer word ‘deuxième’,
which is abbreviated in the form of the generic ‘e’.

While that rule is optional, people who use tools like ConTeXt are
likely to pay attention to that kind of details and will probably want
to use it.

Finally, we have to add an ‘s’ to all the abbreviations if the plural
is needed (the 1st (1ers) elements, the 2nd (2ds or 2es) elements,
etc., vs the 1st (1er) element, 2nd (2d or 2e) element…).

Now, can all those subtleties be coded in a function? :)

Vincent


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


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


Re: [NTG-context] Create an enumeration style

2021-08-13 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 11.08.2021 um 12:57:

I forgot this : how to reduce the font size for the exponents "er", "e" ?


The exponents are placed with \high and you can change the style with

    \setuphigh[style=...]

but this affects all texts which use \high.

Wolfgang

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


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Otared Kavian via ntg-context
> On 11 Aug 2021, at 10:19, Thomas A. Schmitz via ntg-context 
>  wrote:
> 
> 
>> On 11. Aug 2021, at 10:09, Otared Kavian via ntg-context 
>>  wrote:
>> 
>> Thanks for the example and the fix, but I would rather think that the « 
>> french » part of ordinals should be
>> 
>>  french = function(n)
>>  if n == 1 then
>>  return « er"
>>  else
>>   return « ème"
>>  end
>>  end,
> 
> Except if you have something like “1ère image”… Ah, languages are so messy 
> (no pun with recent events in Paris intended).
> 
> Thomas

Sure… But then maybe it is possible to define one’s own « ordinals.french » for 
messy cases :-) 
___
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
___


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Fabrice Couvreur via ntg-context
I forgot this : how to reduce the font size for the exponents "er", "e" ?
Thanks
Fabrice

Le mer. 11 août 2021 à 12:41, Fabrice Couvreur 
a écrit :

> Hi Wolfgang,
> Many thanks
> Fabrice
>
> Le mer. 11 août 2021 à 10:23, Hans Hagen via ntg-context <
> ntg-context@ntg.nl> a écrit :
>
>> On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote:
>> >
>> >
>> >> On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context <
>> ntg-context@ntg.nl> wrote:
>> >> (…)
>> >> core-con.lua (line 1155):
>> >>
>> >> local ordinals = {
>> >>  [...]
>> >>  french = function(n)
>> >>  if n == 1 then
>> >>  return "er"
>> >> +   else
>> >> +   return "e"
>> >>  end
>> >>  end,
>> >> }
>> >
>> > Hi Wolfgang,
>> >
>> > Thanks for the example and the fix, but I would rather think that the «
>> french » part of ordinals should be
>> >
>> >   french = function(n)
>> >   if n == 1 then
>> >   return « er"
>> >   else
>> >return « ème"
>> >   end
>> >   end,
>> >
>> > Now if this were not accepted as a fix in core-con.lua, is there a way
>> for a user to change the default to the above choice in his document ?
>>
>> it is no problem to fix if you all can agree on what/how to fix ...
>>
>> Hans
>>
>>
>> -
>>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
>>
>> ___
>>
>
___
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
___


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Fabrice Couvreur via ntg-context
Hi Wolfgang,
Many thanks
Fabrice

Le mer. 11 août 2021 à 10:23, Hans Hagen via ntg-context 
a écrit :

> On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote:
> >
> >
> >> On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context <
> ntg-context@ntg.nl> wrote:
> >> (…)
> >> core-con.lua (line 1155):
> >>
> >> local ordinals = {
> >>  [...]
> >>  french = function(n)
> >>  if n == 1 then
> >>  return "er"
> >> +   else
> >> +   return "e"
> >>  end
> >>  end,
> >> }
> >
> > Hi Wolfgang,
> >
> > Thanks for the example and the fix, but I would rather think that the «
> french » part of ordinals should be
> >
> >   french = function(n)
> >   if n == 1 then
> >   return « er"
> >   else
> >return « ème"
> >   end
> >   end,
> >
> > Now if this were not accepted as a fix in core-con.lua, is there a way
> for a user to change the default to the above choice in his document ?
>
> it is no problem to fix if you all can agree on what/how to fix ...
>
> Hans
>
>
> -
>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
>
> ___
>
___
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
___


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Hans Hagen via ntg-context

On 8/11/2021 10:09 AM, Otared Kavian via ntg-context wrote:




On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context  
wrote:
(…)
core-con.lua (line 1155):

local ordinals = {
 [...]
 french = function(n)
 if n == 1 then
 return "er"
+   else
+   return "e"
 end
 end,
}


Hi Wolfgang,

Thanks for the example and the fix, but I would rather think that the « french 
» part of ordinals should be

french = function(n)
if n == 1 then
return « er"
else
 return « ème"
end
end,

Now if this were not accepted as a fix in core-con.lua, is there a way for a 
user to change the default to the above choice in his document ?


it is no problem to fix if you all can agree on what/how to fix ...

Hans


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


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Thomas A. Schmitz via ntg-context

> On 11. Aug 2021, at 10:09, Otared Kavian via ntg-context  
> wrote:
> 
> Thanks for the example and the fix, but I would rather think that the « 
> french » part of ordinals should be
> 
>   french = function(n)
>   if n == 1 then
>   return « er"
>   else
>return « ème"
>   end
>   end,

Except if you have something like “1ère image”… Ah, languages are so messy (no 
pun with recent events in Paris intended).

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


Re: [NTG-context] Create an enumeration style

2021-08-11 Thread Otared Kavian via ntg-context


> On 9 Aug 2021, at 18:10, Wolfgang Schuster via ntg-context 
>  wrote:
> (…)
> core-con.lua (line 1155):
> 
> local ordinals = {
> [...]
> french = function(n)
> if n == 1 then
> return "er"
> +   else
> +   return "e"
> end
> end,
> }

Hi Wolfgang,

Thanks for the example and the fix, but I would rather think that the « french 
» part of ordinals should be

french = function(n)
if n == 1 then
return « er"
else
 return « ème"
end
end,

Now if this were not accepted as a fix in core-con.lua, is there a way for a 
user to change the default to the above choice in his document ?

Best regards: Otared
___
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
___


Re: [NTG-context] Create an enumeration style

2021-08-09 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur schrieb am 09.08.2021 um 14:16:

Hi Wolfgang,
Thank you for your suggestion.
I tested the code and the result is not what I expected from the 
second item : "2 exemple" instead of "2^{e} exemple", "3 exemple" 
instead of "3^{e} exemple" ...


core-con.lua (line 1155):

local ordinals = {
    [...]
    french = function(n)
    if n == 1 then
    return "er"
+   else
+   return "e"
    end
    end,
}



Then I tried to use the key alternative = serried but without success.


This works for me:

\defineenumeration
  [test]
  [text=,
   alternative=serried,
   width=fit,
   distance=.5em,
   numbercommand=\groupedcommand{}{~exemple},
   numberconversion=ordinal]

\mainlanguage [fr]

\starttext

\starttest
\input knuth
\stoptest

\starttest
\input knuth
\stoptest

\stoptext

Wolfgang

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


Re: [NTG-context] Create an enumeration style

2021-08-08 Thread Wolfgang Schuster via ntg-context

Fabrice Couvreur via ntg-context schrieb am 08.08.2021 um 17:47:

Hello,
Is it possible to create an enumeration style to get this :
1 ^ {er} exemple
2 ^ {e} exemple
3 ^ {e} exemple


The conversion needs a fix but this is how you can do it.

\defineenumeration
  [test]
  [text=,
   numbercommand=\groupedcommand{}{~exemple},
   numberconversion=ordinal]

\mainlanguage [fr]

\starttext

\starttest
\input knuth
\stoptest

\starttest
\input knuth
\stoptest

\stoptext

Wolfgang

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


[NTG-context] Create an enumeration style

2021-08-08 Thread Fabrice Couvreur via ntg-context
Hello,
Is it possible to create an enumeration style to get this :
1 ^ {er} exemple
2 ^ {e}  exemple
3 ^ {e} exemple 
Thanks
Fabrice
___
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
___