Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id s7KH8UEs014675 for ; Wed, 20 Aug 2014 19:08:31 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx109) with ESMTPS (Nemesis) id 0LsfKP-1WMrr71tfd-012Fda for ; Wed, 20 Aug 2014 19:08:24 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7KH5ZNe018956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Aug 2014 19:05:35 +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 s7KF3edx027399; Wed, 20 Aug 2014 19:05:35 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11347162 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 20 Aug 2014 19:05:34 +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 s7KH5YgV008233 for ; Wed, 20 Aug 2014 19:05:34 +0200 Received: from mail-in-09.arcor-online.net (mail-in-09.arcor-online.net [151.189.21.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s7KH5R0G018890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 20 Aug 2014 19:05:27 +0200 Received: from mail-in-18-z2.arcor-online.net (mail-in-18-z2.arcor-online.net [151.189.8.35]) by mx.arcor.de (Postfix) with ESMTP id 2F0711975E8 for ; Wed, 20 Aug 2014 19:05:27 +0200 (CEST) Received: from mail-in-02.arcor-online.net (mail-in-02.arcor-online.net [151.189.21.42]) by mail-in-18-z2.arcor-online.net (Postfix) with ESMTP id 22A1A33A478 for ; Wed, 20 Aug 2014 19:05:27 +0200 (CEST) X-Greylist: Passed host: 92.78.247.158 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-02.arcor-online.net E781A3041D Received: from [192.168.2.125] (dslb-092-078-247-158.092.078.pools.vodafone-ip.de [92.78.247.158]) (Authenticated sender: mailing_list@arcor.de) by mail-in-02.arcor-online.net (Postfix) with ESMTPA id E781A3041D for ; Wed, 20 Aug 2014 19:05:26 +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> <53F3C0AB.2060407@arcor.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <53F4D555.5060306@arcor.de> Date: Wed, 20 Aug 2014 19:05:25 +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:Tm6X6Hctw0Y=:VP2iEzVJ4I8EXRo7qD/RLbGh3q 1DKqsgUblgM0nwGcl+VYXNeoantNFXZjMCZU7y0h42uraT6/s74jRMaANv94+g7D9w9Y8d+ro YBTKELlC8OIHDArSbx6miI9wB0Zr44LRmeJPj+dHYbQlI/bRhsX6uhNEBkCU9tAISatwjT4l1 lG6gorm569W6SlfXqYpTMOy5AHh/NYXMHHt1ko5NciY3Snn4+P4mKycXl4QxfIulxtkQuJoQD gttA32+xEvGPhf/oim4lckjniN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ard/jCv493Kz0FyJaAGeslVB7d3yp2Cs6oQHHIO2iNfALhP0PlCzN43e79ZH2 iqOpMFvZdTlEg9ehmfJGhp9i6P4GCqKTw4PS1w/Q2YVw0nOQNQ11BF0ut6InqDyyf5/aeTbrz f49gXa7YceCd1qkS7YtTPL4ncY9NRssPk7H1JXbjj7XTqt5rRCppkMbgMuKahRLaKcDilIBA= = X-UI-Loop:V01:3QwdVCwq+/Y=:GVigj00VK6mvEMbqRuPpv/TXZST/9SVqNBwiRO8F2XA= X-UI-Out-Filterresults: notjunk:1; Status: R X-Status: X-Keywords: X-UID: 7568 Am 20.08.2014 um 00:11 schrieb Michal Hoftich: > I was solving the same problem and only solution I've found was to > parse `language.dat` file, see (some example is at the bottom of the > file): > > https://github.com/michal-h21/luavlna/blob/master/langno.lua > > note that this method doesn't work universally, some formats exists > which doesn't use `language.dat` (csplain is the one I know about), > but if you want to support only LaTeX, this method should be fine. > also note that there is file `language.dat.lua`, which contains lua > table with language names and properties, but unfortunately, language > numbers aren't recorded here and language names are used as table > keys, so this table isn't useful for querying language numbers. I have considered something like that, but the approach has some drawbacks: 1. What is the correct way to get language numbers from language identifiers? As far as I see, you're reading the file in Lua, assuming LaTeX reads records from language.dat simply increasing indices (language numbers). I wouldn't rely on that assumption. That is, I'd rather read language.dat in LaTeX doing the conversion there, then pass the result to Lua for every language encountered. Certainly an interesting exercise to get more into LaTeX3 (at least for me). 2. Does language.dat really contain Babel language identifiers or rather pattern identifiers that are bound to a language identifier somewhere else (.ldf files perhaps?)? Reading language.dat (or language.dat.lua) in LaTeX, one could at least convert a certain set of pattern/language identifiers into their corresponding language number in a reliable way. Then users would have to declare languages manually on the LaTeX side only where this approach failed to find the correct language identifier. > If someone knows about less hackish solution, I would be happy to use > it instead. Yes, reading and parsing an already loaded file language.* isn't desirable. Is there a way to iterate over all command sequences starting with a known string ('l@') in LaTeX? Best regards, Stephan Hennig