Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

So I tried to hack the macro given in the ConTeXt wiki to write pagenumbering in words in spanish, my native language. Things were great until I had to reach the 100th page. ConTeXt claims when compiling, but I don't know how to fix the macro so it can write hundred-numbers.

'Cien' is 100 for spanish. 'Ciento uno' for 101, 'ciento dos' for 102 and so (You can see a more detailed example here). So basically I need to prepend the word 'cien' for each word number from 1 to 99 to write the one-hundreds, 'doscientos' for the two-hundreds... Here is my dirty hacked version of the macro (you may save it as 'numstr.tex' for compiling), and a minimal example as follows:

\input numstr
\defineconversion[numstring][\numstr]
\setupuserpagenumber[numberconversion=numstring]
\starttext
\dorecurse{100}{\recurselevel\page}
\stoptext

I'm such a noob with TeX and I cannot figure out how to do this. Could you TeX/ConTeXt masters give me a clue? Thank you so much!

share|improve this question
1  
Are you using MkIV? In that case, you can simply adapt the verbose.english function from core-con.lua to Spanish (The function is written in Lua, so it should be easy to modify it). If you send the resultant code to the context mailing list, then it will be added to the core as well. –  Aditya Nov 16 '12 at 3:44
    
Yeah, actually I'm using MkIV. But I don't know anything about Lua (seems pretty easy but I don't know how to test any modification... running lua core-con.lua from my shell?). I guess I should start translating the words array... Can you give me a clue? I need this ASAP. Thanks! –  acidrums4 Nov 17 '12 at 13:27
1  
It will be best to send the email to the context mailing list asking to extend thr words conversion to Spanish. –  Aditya Nov 17 '12 at 15:51

1 Answer 1

ConTeXt provides a conversion words (and Words) for converting numbers to words. This converts the number into words in the current language (currently one English and Spanish are supported).

For example:

\starttext

\startitemize[words,fit,board]
  \item One 
  \item Two 
  \item Three
\stopitemize

\mainlanguage[es]
\startitemize[words,fit,board]
  \item One 
  \item Two 
  \item Three
\stopitemize

\stoptext

gives

enter image description here

See core-con.lua on how to add support for other languages.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.