is it possible to adjust options so as to get page numbering done in words? Eg "one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ? Or does this require some more work/code?
On Mon, 26 Mar 2007 17:39:38 +0100 cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
Or does this require some more work/code?
Hi ???, I don't think there is something like this in ConTeXt. You can try to make somthing by yourself and start with the zahl2string [1] package for LaTeX and adapt it to ConTeXt. This should be not such a big problem, you need only to replace the \newcommand defintions with \def and replace the german texts with english ones or whatever language you like. [1] http://ctan.org/tex-archive/macros/latex/contrib/sauerj/ Wolfgang
On 2007-03-26, at 19:16.0, Wolfgang Schuster wrote:
On Mon, 26 Mar 2007 17:39:38 +0100 cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words?
I don't think there is something like this in ConTeXt.
You can try to make somthing by yourself and start with the zahl2string [1] package for LaTeX and adapt it to ConTeXt. This should be not such a big problem, you need only to replace the \newcommand defintions with \def and replace the german texts with english ones or whatever language you like.
Thanks - it does look quite complicated! But this is a good start...
On Mon, 26 Mar 2007 17:39:38 +0100 cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
Or does this require some more work/code?
I converted the macro to the plain TeX format. The only thing you need to do now is to change the german text you own. Wolfgang
On 2007-03-26, at 19:40.0, Wolfgang Schuster wrote:
On Mon, 26 Mar 2007 17:39:38 +0100 cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
Or does this require some more work/code?
I converted the macro to the plain TeX format. The only thing you need to do now is to change the german text you own.
thanks - looks like it's do-able, perhaps!
On 2007-03-26, at 17:39.0, cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
I can't see how to do this in ConText. I can see that the first task - converting an integer to a string - could be done by a macro or external command, such as Wolfgang's zahl2string.... But how to do the second job - feed in a 'raw' pagenumber and output and print a converted one?
\defineconversion [numstring][\numstr]
\setuppagenumbering[conversion=numstring]
On 3/28/07, cormullion@mac.com
On 2007-03-26, at 17:39.0, cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
I can't see how to do this in ConText. I can see that the first task - converting an integer to a string - could be done by a macro or external command, such as Wolfgang's zahl2string.... But how to do the second job - feed in a 'raw' pagenumber and output and print a converted one?
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Sincerely yours, Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
2007/3/28, cormullion@mac.com
On 2007-03-26, at 17:39.0, cormullion@mac.com wrote:
is it possible to adjust options so as to get page numbering done in words? Eg
"one" "two" ..... "eighty-nine" ... "three hundred and sixty seven" ?
I can't see how to do this in ConText. I can see that the first task - converting an integer to a string - could be done by a macro or external command, such as Wolfgang's zahl2string.... But how to do the second job - feed in a 'raw' pagenumber and output and print a converted one?
Hi, the last to feed in the pagenumber is very easy. I show in next example how the print the pagenumber in the header with words rather than numbers: \usemodule[zahl2string] \starttext \setuppagenumbering[location=] \setupheadertexts[\numstr\pagenumber] Text \stoptext BTW, these are not my macros, they come from Jonathan Sauerand I convertred them only to plain TeX. Wolfgang
Thanks, Wolfgang and Zhichu. I've managed to get it working. The only problem now is to work out how to modify the original macros. Numbering is OK up to 20. Then we get onetwenty, twotwenty, threetwenty (I did find out how to remove the 'und'). So that's another project! thanks again
Hi, cormullion
I modified Wolfgang's macro as the attached file. But I'm really not a
native American, so there must be some special rules that I've ignored. Wish
you good luck.
On 3/28/07, cormullion@mac.com
Thanks, Wolfgang and Zhichu. I've managed to get it working. The only problem now is to work out how to modify the original macros. Numbering is OK up to 20. Then we get onetwenty, twotwenty, threetwenty (I did find out how to remove the 'und'). So that's another project!
thanks again
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Sincerely yours, Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ----------------------------------------------------------------
On 2007-03-28, at 16:49.0, Zhichu Chen wrote:
I modified Wolfgang's macro as the attached file. But I'm really not a native American, so there must be some special rules that I've ignored. Wish you good luck.
Yes - this works great now. Thank you for sorting out the TeX code, which is like no other language I know ;-). I've changed only one spelling (fourty -> forty) and the rest looks perfect. thanks again!
cormullion@mac.com wrote:
On 2007-03-28, at 16:49.0, Zhichu Chen wrote:
I modified Wolfgang's macro as the attached file. But I'm really not a native American, so there must be some special rules that I've ignored. Wish you good luck.
Yes - this works great now. Thank you for sorting out the TeX code, which is like no other language I know ;-). I've changed only one spelling (fourty -> forty) and the rest looks perfect.
It would be nice if someone (one of the module tutorial attendants :-) could wrap this command in a module for the contextgarden page. Cheers, Taco
Hello, I have just noticed this thread (I cannot really catch up reading all the stuff here) and remembered that I have some really old files lying somewhere on my computer. The file dates back to the time when Brooks Moses & Hans have implemented \defineconversion [sl] [a] [\sloveniancharacters] for me, so I needed to make sure that I understood the concept. I didn't review the content, I have just added a small demo at the end. On 4/16/07, Robin Kirkham wrote:
Hi all,
There are still a few problems with \numstr when you get beyond the hundreds. Perhaps this is unlikely when it is a page number, but I was interested in using this macro for contracts, where an amount of money is often written out in words.
\input numstr.tex \starttext \numstr{-1}\par \numstr{0}\par \numstr{101}\par \numstr{1001}\par \numstr{1000001}\par \numstr{1200021} \stoptext
This produces output:
null null one hundred and one one thousand one one millionone one million two hundred thousand twenty-one
I didn't follow the thread, but the problems might result from the fact that it was translated from a german counter rather than written from scratch following some rules.
which should be:
minus one zero one hundred and one one thousand and one one million and one
My example fails on this one, but I guess that it could be fixed if you tell me the rule to distinguish the two cases.
one million, two hundred thousand and twenty-one
In English, the tens/units (if not zero) should be preceded by "and" if the number exceeds 100 (so 101 is correct in the above output). This applies whether the tens/units is truly tens/units, or is a thousands or millions multiplier (120000 = "one hundred and twenty thousand").
The use of a comma after millions and sometimes thousands is helpful but not essential, and it only appears in certain cases. I'll have to think a bit more about a rule for that!
The use of a hyphen between tens and units ("twenty-one") is not incorrect but is nowadays probably regarded as a little old-fashioned (but personally, I like it).
Best,
Robin
I have used this page as a source: http://www.ego4u.com/en/cram-up/vocabulary/numbers/cardinal Mojca Note 1: If the functionality/documentation can be polished out nicely, the core or m-something might be a better place for such a module than third-party modules. But I guess that Hans would want to split this into *.mkii and *.mkiv anyway, so I would probably need to write the lua implementation for it before asking for inclusion ;) Note 2: there are some switches which would need to be implemented in a higher level user interface. Note that the German counter might be useless since I have never finished it.
participants (5)
-
cormullion@mac.com
-
Mojca Miklavec
-
Taco Hoekwater
-
Wolfgang Schuster
-
Zhichu Chen