On Mon, Jul 4, 2011 at 5:02 PM, Willi Egger <w.eg...@boede.nl> wrote:
> Hi all,
>
> experimenting with context.labeltext...
>
> My question is how can I tweak the context.labeltext(text) command at the 
> lua-side to make ConTeXt to typeset  the labeltext starting with an uppercase 
> letter? e.g.  if "text" contains "january" to display "January"?
And if text is foo you want Foo ?
In char-ini.lua, among others, there is
function characters.upper(str)
    local new, n = { }, 0
    for u in utfvalues(str) do
        n = n + 1
        new[n] = ucchars[u]
    end
    return concat(new)
end
The idea is to take the first character from characters.upper(str),
and all but not first from str
and then join them using concat.

-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to