From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67346 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: Use date of the tex file in the document Date: Thu, 24 Mar 2011 18:29:36 +0100 Message-ID: <20110324172929.GA4137@orcus.urz.uni-heidelberg.de> References: <20110324102202.GD3626@orcus> <20110324120017.78d5e9b9@glyph> <579A9EA3-A9B1-44A6-ABC8-36F733161523@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0875364602==" X-Trace: dough.gmane.org 1300987806 8584 80.91.229.12 (24 Mar 2011 17:30:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 17:30:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 24 18:30:00 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2oM8-0005av-1a for gctc-ntg-context-518@m.gmane.org; Thu, 24 Mar 2011 18:29:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 17F5BCAB44; Thu, 24 Mar 2011 18:29:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TGJolCHOfsPx; Thu, 24 Mar 2011 18:29:38 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7EB85CAB36; Thu, 24 Mar 2011 18:29:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 27785CAB36 for ; Thu, 24 Mar 2011 18:29:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cj9gAjlLUTlM for ; Thu, 24 Mar 2011 18:29:25 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 636BACAB31 for ; Thu, 24 Mar 2011 18:29:25 +0100 (CET) Original-Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2OHTcal016372 for ; Thu, 24 Mar 2011 18:29:39 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p2OHTbJi011544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Mar 2011 18:29:38 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p2OHTbNA005362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Mar 2011 18:29:37 +0100 Original-Received: from localhost (vpn193a.rzuser.uni-heidelberg.de [129.206.196.193]) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id p2OHTaBp015020 for ; Thu, 24 Mar 2011 18:29:37 +0100 In-Reply-To: X-Operating-System: Linux orcus 2.6.37-ARCH User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.210.211; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08En5tDBq - 8785df742c27 - 20110324 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:67346 Archived-At: --===============0875364602== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MW5yreqqjyrRcusr" Content-Disposition: inline --MW5yreqqjyrRcusr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-03-24 <18:15:31>, Cecil Westerhof wrote: > 2011/3/24 Wolfgang Schuster >=20 > > > > Am 24.03.2011 um 17:29 schrieb Cecil Westerhof: > > > > > \def\getdate% > > > {\dosinglegroupempty\dogetdate} > > > > > > \def\dogetdate#1% > > > {context{modification_date("\jobname.tex", "#1")}} > > > > \def\getdate > > {\dosingleempty\dogetdate} > > > > \def\dogetdate[#1]% > > {\ctalua{context(modification_date("\jobname.tex", "#1"))}} > > >=20 > I have: > \startluacode > function modification_date(file, format) > local f =3D file > local attr =3D lfs.attributes(f) >=20 > assert (type(attr) =3D=3D "table") > if attr.mode ~=3D "directory" then > if format =3D=3D "long" then > return os.date("%Y-%m-%d %H:%M",attr.modification) > else > return os.date("%Y-%m-%d",attr.modification) > end > end > end > \stopluacode >=20 > \def\getdate > {\dosingleempty\dogetdate} >=20 > \def\dogetdate[#1]% > {\ctalua{context(modification_date("\jobname.tex", "#1"))}} ^ s/\\ctalua/\\ctxlua/ Regards, Philipp >=20 > \starttext >=20 > \getdate >=20 > \stoptext >=20 > This gives: > \dogetdate [#1]->\ctalua > {context(modification_date("\jobname .tex", "#1"= ))} > l.29 \getdate[] >=20 > ? >=20 > I tried with \getdate, \getdate{} and \getdate[]. >=20 > --=20 > Cecil Westerhof > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ --MW5yreqqjyrRcusr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk2Lf4AACgkQ02lYlJYWs9KeVgCfZIiQu5KIZzYafMOg1KCukmcu OkUAn1slj2RbKdcmXKXG5SNneeddN5lW =Zn19 -----END PGP SIGNATURE----- --MW5yreqqjyrRcusr-- --===============0875364602== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0875364602==--