From: Willi Egger <w.egger@boede.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: context.labeltext(...)
Date: Mon, 4 Jul 2011 18:00:58 +0200 [thread overview]
Message-ID: <B1DB395E-8D9A-463D-AE07-2F3B55BD8C29@boede.nl> (raw)
In-Reply-To: <8260169C-86E6-4DFA-BB4F-D353632FEE8F@googlemail.com>
Hello Wolfgang,
thanks for your reply.
I see that I was not quite clear with my explanation.
The situation is the following:
in a function which runs over the months of the year at a certain moment I need to insert at the ConTeXt side the monthname. However the monthname returned by the following statement is all lowercase, which is ok for the translation of the labeltext. In the document however I need the labeltext in with a starting uppercase letter. The question is therefor how to achieve this uppercase first letter
\startluacode
function monthtable(month)
local direct = true
local nofdays = converters.nofdays(os.date("%Y"),month,direct)
direct = false
local d = os.date("%B",os.time({year=os.date("%Y"),month= month,day=1}))
context.bTABLE({setups="table:month"})
context.bTR({align="middle"})
context.bTD()
context.labeltext(d)
-- context.labeltext("%s",interfaces.variables.january)
context.eTD()
context.eTR()
for i = 1, 31 do
context.bTR()
context.bTD()
if i < nofdays +1 then
context(i)
else
context()
end
context.eTD()
context.eTR()
end
context.eTABLE()
end
\stopluacode
\def\maandtabel#1{\ctxlua{monthtable(#1)}}
\starttext
\maandtabel{2)
\stoptext
Kind regards
Willi
On 4 Jul 2011, at 17:41, Wolfgang Schuster wrote:
> context.labeltext("%s",interfaces.variables.january)
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-07-04 16:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 15:02 context.labeltext(...) Willi Egger
2011-07-04 15:41 ` context.labeltext(...) Wolfgang Schuster
2011-07-04 16:00 ` Willi Egger [this message]
2011-07-04 16:12 ` context.labeltext(...) Wolfgang Schuster
2011-07-04 15:54 ` context.labeltext(...) luigi scarso
2011-07-04 16:05 ` context.labeltext(...) Willi Egger
2011-07-04 16:14 ` context.labeltext(...) Wolfgang Schuster
2011-07-04 16:20 ` context.labeltext(...) luigi scarso
2011-07-04 16:53 ` context.labeltext(...) Khaled Hosny
2011-07-04 17:02 ` context.labeltext(...) Wolfgang Schuster
2011-07-05 7:22 ` context.labeltext(...) Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B1DB395E-8D9A-463D-AE07-2F3B55BD8C29@boede.nl \
--to=w.egger@boede.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).