Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s7JLT0vL008427 for ; Tue, 19 Aug 2014 23:29:01 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx101) with ESMTPS (Nemesis) id 0M3QxY-1WSqla2PUe-00qz2V for ; Tue, 19 Aug 2014 23:28:54 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s7JLP7tr024387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Aug 2014 23:25:07 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JKQXa3017732; Tue, 19 Aug 2014 23:25:06 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11312943 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 19 Aug 2014 23:25:06 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JLP6Dj024953 for ; Tue, 19 Aug 2014 23:25:06 +0200 Received: from mail-in-10.arcor-online.net (mail-in-10.arcor-online.net [151.189.21.50]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7JLP05u014881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 19 Aug 2014 23:25:00 +0200 Received: from mail-in-05-z2.arcor-online.net (mail-in-05-z2.arcor-online.net [151.189.8.17]) by mx.arcor.de (Postfix) with ESMTP id 01B512D6A96 for ; Tue, 19 Aug 2014 23:25:00 +0200 (CEST) Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by mail-in-05-z2.arcor-online.net (Postfix) with ESMTP id F3B1E116029 for ; Tue, 19 Aug 2014 23:24:59 +0200 (CEST) X-Greylist: Passed host: 92.78.242.190 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-11.arcor-online.net C3C8935A761 Received: from [192.168.2.125] (dslb-092-078-242-190.092.078.pools.vodafone-ip.de [92.78.242.190]) (Authenticated sender: mailing_list@arcor.de) by mail-in-11.arcor-online.net (Postfix) with ESMTPA id C3C8935A761 for ; Tue, 19 Aug 2014 23:24:59 +0200 (CEST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 References: <53F382C3.30901@arcor.de> <53F3877C.2070304@googlemail.com> <53F3931A.4080203@arcor.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <53F3C0AB.2060407@arcor.de> Date: Tue, 19 Aug 2014 23:24:59 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Stephan Hennig Subject: Re: \directlua in LaTeX3 To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:cBt1WjC8DdI=:r1/eaMrNBNNz4aSVYV27ioHJGI rRLnxNsmSdWbcBMin8fSLE4BtrHRb49qFvjm1ZtR+0wThGh1o99HCqoNIZcshmVMBx05gYHdU DgpVR2GNyA20m23zFIEcf2SVIxAnB+1RSNyrOu+r/NO7zK/qFLY5N4pxjZ/Eu6ltZi0ApoiqN qEgllJWSnKCPICjIDDr4CPCTIdAbiuRBYbJZATiwakFX/Fd/gVCZgztbSFxUySZ2Iwt5W+LaO WRw3e21+kT0cEBa4TimJsF2lPDvZN4i8Nt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Cr9k5iiLzrzJtEYIx7nPvvHHbdjFsucGc9OCuS552d0yHfS7DzFJJLI6buGM 6sMcXfIRJ0+M881uwMTUnC4I/IdnNqkVVdPq7IYVSLMBW2VKfm6uLeTMf5KFvhJHs7+vRe4BW tj3N5ZxIR64HxZ6NUEUD6B0zBhezY4dqBt40MgWw3u/a8FfvoJrOPEDiau9BxDxdtnNtnMvA= = X-UI-Loop:V01:XZpuXmrgDWc=:+oZhy60gjWLzi3mUt+tJUVbW4XoN/CYxnkXToXHQSmU= X-UI-Out-Filterresults: notjunk:1; Status: R X-Status: X-Keywords: X-UID: 7564 Am 19.08.2014 um 21:58 schrieb Bruno Le Floch: > On 8/19/14, Stephan Hennig wrote: >> >> It's actually a language string that I'm evaluating to a number via >> >> \int_use:N\cs:w l@#1\cs_end: in LaTeX3 > > Avoid using \cs:w ... \cs_end: constructions. It is much better to > use a c-type argument, so for your case, \int_use:c { l@#1 }. Didn't notice that. Great, thank you! While we're at it, this code does the language identifier to number conversion in LaTeX and passes the result to Lua. Anybody know of a way to do the conversion in Lua? Given a Lua string, say, 'UKenglish', how do you get the corresponding language number that is referred to in, e.g., glyph nodes? A solution to that problem would save users of my code from having to specify language identifiers on the LaTeX side in addition to the Lua side. Looking at the Babel package, I infer that \l@ is actually a \chardef definition (whatever that is ...). The LuaTeX manual contains in sec. 4.14.4 "Attribute, count, dimension, skip and token registers" a statement TeX's attributes (\attribute), counters (\count), dimensions (\dimen), skips (\skip) and token (\toks) registers can be accessed and written to using two times five virtual sub-tables of the tex table: tex.attribute tex.dimen tex.toks tex.count tex.skip It is possible to use the names of relevant \attributedef, \countdef, \dimendef, \skipdef, or \toksdef control sequences as indices to these tables: tex.count.scratchcounter = 0 enormous = tex.dimen['maxdimen'] In this case, LuaTeX looks up the value for you on the fly. You have to use a valid \countdef (or \attributedef, or \dimendef, or \skipdef, or \toksdef), anything else will generate an error (the intent is to eventually also allow and even macros that expand into a number). Does that mean I have to wait until LuaTeX provides access to \chardefs on the Lua side? Or is there any other way to get the language number in Lua? Best regards, Stephan Hennig