ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Twenty One versus Twenty-one
@ 2021-02-11  1:20 jbf
  2021-02-11  7:44 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2021-02-11  1:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am currently dealing with a book that has twenty-one chapters, and the 
author (who is visually impaired) follows a range of visually impaired 
principles when writing and wanting things published. That's the 
background to my question!

MWE

\setuphead[chapter][
     header=empty,
     alternative=middle,
     style={\ssd},
     number=yes,
     conversion=Word,
     command=\MyChapterCommand,
     after={\blank[1cm]},
     ]

Problem is, when we get to chapter Twenty-one (which is the correct way 
to write it in English) it gives me 'Twenty One'. Is there a way, in my 
setup, that I can force it to give me 'Twenty-one'? (note the hyphen and 
the lower case for 'one').

I don't think MyChapterCommand is relevant here, but just in case, this 
is it:

\define[2]\MyChapterCommand%
{\framed[frame=on,bottomframe=on,leftframe=off,rightframe=off,topframe=off,align=middle]
      {\vbox{\headtext{chapter} #1\blank#2}}}

Julian

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

* Re: Twenty One versus Twenty-one
  2021-02-11  1:20 Twenty One versus Twenty-one jbf
@ 2021-02-11  7:44 ` Hans Hagen
  2021-02-11  8:20   ` jbf
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2021-02-11  7:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users, jbf

On 2/11/2021 2:20 AM, jbf wrote:
> Am currently dealing with a book that has twenty-one chapters, and the 
> author (who is visually impaired) follows a range of visually impaired 
> principles when writing and wanting things published. That's the 
> background to my question!
> 
> MWE
> 
> \setuphead[chapter][
>      header=empty,
>      alternative=middle,
>      style={\ssd},
>      number=yes,
>      conversion=Word,
>      command=\MyChapterCommand,
>      after={\blank[1cm]},
>      ]
> 
> Problem is, when we get to chapter Twenty-one (which is the correct way 
> to write it in English) it gives me 'Twenty One'. Is there a way, in my 
> setup, that I can force it to give me 'Twenty-one'? (note the hyphen and 
> the lower case for 'one').
> 
> I don't think MyChapterCommand is relevant here, but just in case, this 
> is it:
> 
> \define[2]\MyChapterCommand%
> {\framed[frame=on,bottomframe=on,leftframe=off,rightframe=off,topframe=off,align=middle] 
> 
>       {\vbox{\headtext{chapter} #1\blank#2}}}
I'll add this:

\def\verbosenumberconnector{--}

so you can define your own connectors. This is not interfaced via 
setuphead or setuplangauge or because the converter is not configured 
that way (maybe some day but I need to discuss it with Wolfgang because 
then we want to solve that for all commands and make the right choice 
for keys and so).

Up to you to wikify it.

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
___________________________________________________________________________________

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

* Re: Twenty One versus Twenty-one
  2021-02-11  7:44 ` Hans Hagen
@ 2021-02-11  8:20   ` jbf
  2021-02-11  9:03     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2021-02-11  8:20 UTC (permalink / raw)
  To: Hans Hagen; +Cc: ntg >> mailing list for ConTeXt users


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

I appreciate the response.

However, you are light years ahead of me in understanding ConTeXt, so I 
don't quite know what to do with the info you have given me! I have 
difficulty understanding your comment 'This is not interfaced via 
setuphead *or* setuplangauge *or* because the converter is not 
configured that way'. The 'or' throws me out, I'm afraid. Were you going 
to suggest somewhere else?

I assumed that I would need to add \def\verbosenumberconnector{--} as a 
definition in the preamble (and have), but where do I call it in? Not in 
\setuphead[chapter] that is for sure, but I need to call on it 
somewhere. Where?

Julian



On 11/2/21 6:44 pm, Hans Hagen wrote:
> On 2/11/2021 2:20 AM, jbf wrote:
>> Am currently dealing with a book that has twenty-one chapters, and 
>> the author (who is visually impaired) follows a range of visually 
>> impaired principles when writing and wanting things published. That's 
>> the background to my question!
>>
>> MWE
>>
>> \setuphead[chapter][
>>      header=empty,
>>      alternative=middle,
>>      style={\ssd},
>>      number=yes,
>>      conversion=Word,
>>      command=\MyChapterCommand,
>>      after={\blank[1cm]},
>>      ]
>>
>> Problem is, when we get to chapter Twenty-one (which is the correct 
>> way to write it in English) it gives me 'Twenty One'. Is there a way, 
>> in my setup, that I can force it to give me 'Twenty-one'? (note the 
>> hyphen and the lower case for 'one').
>>
>> I don't think MyChapterCommand is relevant here, but just in case, 
>> this is it:
>>
>> \define[2]\MyChapterCommand%
>> {\framed[frame=on,bottomframe=on,leftframe=off,rightframe=off,topframe=off,align=middle] 
>>
>>       {\vbox{\headtext{chapter} #1\blank#2}}}
> I'll add this:
>
> \def\verbosenumberconnector{--}
>
> so you can define your own connectors. This is not interfaced via 
> setuphead or setuplangauge or because the converter is not configured 
> that way (maybe some day but I need to discuss it with Wolfgang 
> because then we want to solve that for all commands and make the right 
> choice for keys and so).
>
> Up to you to wikify it.
>
> 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
> -----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 3761 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] 7+ messages in thread

* Re: Twenty One versus Twenty-one
  2021-02-11  8:20   ` jbf
@ 2021-02-11  9:03     ` Hans Hagen
  2021-02-11  9:07       ` jbf
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2021-02-11  9:03 UTC (permalink / raw)
  To: jbf; +Cc: ntg >> mailing list for ConTeXt users

On 2/11/2021 9:20 AM, jbf wrote:
> I appreciate the response.
> 
> However, you are light years ahead of me in understanding ConTeXt, so I 
> don't quite know what to do with the info you have given me! I have 
> difficulty understanding your comment 'This is not interfaced via 
> setuphead *or* setuplangauge *or* because the converter is not 
> configured that way'. The 'or' throws me out, I'm afraid. Were you going 
> to suggest somewhere else?
> 
> I assumed that I would need to add \def\verbosenumberconnector{--} as a 
> definition in the preamble (and have), but where do I call it in? Not in 
> \setuphead[chapter] that is for sure, but I need to call on it 
> somewhere. Where?
You don't call it, just define it (so no [setuphead=somekeyword={-}]):

\def\verbosenumberconnector{-}

\setuphead
   [chapter]
   [conversion=Word]

\starttext
     \dorecurse{25}{\chapter{or number #1}}
\stoptext

But you need to wait for the update,

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
___________________________________________________________________________________

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

* Re: Twenty One versus Twenty-one
  2021-02-11  9:03     ` Hans Hagen
@ 2021-02-11  9:07       ` jbf
  2021-02-11  9:38         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2021-02-11  9:07 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Okay, that's clear, and what is also clear is that I cannot achieve this 
with my current version of Mk IV (nearly a year old now). The entire 
work is complete but for this small item, so I might need to do some 
'fiddling' outside ConTeXt to achieve a result that the publisher wants 
in his hands tomorrow... Unless I can delay him. I will try!

Many thanks,

Julian

On 11/2/21 8:03 pm, Hans Hagen wrote:
> On 2/11/2021 9:20 AM, jbf wrote:
>> I appreciate the response.
>>
>> However, you are light years ahead of me in understanding ConTeXt, so 
>> I don't quite know what to do with the info you have given me! I have 
>> difficulty understanding your comment 'This is not interfaced via 
>> setuphead *or* setuplangauge *or* because the converter is not 
>> configured that way'. The 'or' throws me out, I'm afraid. Were you 
>> going to suggest somewhere else?
>>
>> I assumed that I would need to add \def\verbosenumberconnector{--} as 
>> a definition in the preamble (and have), but where do I call it in? 
>> Not in \setuphead[chapter] that is for sure, but I need to call on it 
>> somewhere. Where?
> You don't call it, just define it (so no [setuphead=somekeyword={-}]):
>
> \def\verbosenumberconnector{-}
>
> \setuphead
>   [chapter]
>   [conversion=Word]
>
> \starttext
>     \dorecurse{25}{\chapter{or number #1}}
> \stoptext
>
> But you need to wait for the update,
>
> 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
___________________________________________________________________________________

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

* Re: Twenty One versus Twenty-one
  2021-02-11  9:07       ` jbf
@ 2021-02-11  9:38         ` Hans Hagen
  2021-02-11 10:38           ` jbf
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2021-02-11  9:38 UTC (permalink / raw)
  To: jbf; +Cc: mailing list for ConTeXt users

On 2/11/2021 10:07 AM, jbf wrote:
> Okay, that's clear, and what is also clear is that I cannot achieve this 
> with my current version of Mk IV (nearly a year old now). The entire 
> work is complete but for this small item, so I might need to do some 
> 'fiddling' outside ConTeXt to achieve a result that the publisher wants 
> in his hands tomorrow... Unless I can delay him. I will try!
in core-con.lua search for (the first one is for english)

     return #t > 0 and concat(t," ") or tostring(n)

(in function translate) and change " " into "-"

then run

    context --make

and you should be ok for now

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
___________________________________________________________________________________

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

* Re: Twenty One versus Twenty-one
  2021-02-11  9:38         ` Hans Hagen
@ 2021-02-11 10:38           ` jbf
  0 siblings, 0 replies; 7+ messages in thread
From: jbf @ 2021-02-11 10:38 UTC (permalink / raw)
  To: Hans Hagen; +Cc: ntg >> mailing list for ConTeXt users

Perfect. Done. Many thanks.

Julian

On 11/2/21 8:38 pm, Hans Hagen wrote:
return #t > 0 and concat(t," ") or tostring(n)
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2021-02-11 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  1:20 Twenty One versus Twenty-one jbf
2021-02-11  7:44 ` Hans Hagen
2021-02-11  8:20   ` jbf
2021-02-11  9:03     ` Hans Hagen
2021-02-11  9:07       ` jbf
2021-02-11  9:38         ` Hans Hagen
2021-02-11 10:38           ` jbf

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