Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id q6HIZJCo022139 for ; Tue, 17 Jul 2012 20:35:21 +0200 Received: (qmail 22279 invoked by alias); 17 Jul 2012 18:35:14 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 17 Jul 2012 18:35:14 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx044) with SMTP; 17 Jul 2012 20:35:14 +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 q6HISUCY029052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jul 2012 20:28:30 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id q6HGEB72000878; Tue, 17 Jul 2012 20:28:30 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 2034997 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 17 Jul 2012 20:28:29 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id q6HIST4c031094 for ; Tue, 17 Jul 2012 20:28:29 +0200 Received: from smtp.demon.co.uk (mdfmta004.mxout.tch.inty.net [91.221.169.45]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q6HIRLt6028473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Jul 2012 20:28:18 +0200 Received: from mdfmta004.tch.inty.net (unknown [127.0.0.1]) by mdfmta004.tch.inty.net (Postfix) with ESMTP id 53BE5AC406D for ; Tue, 17 Jul 2012 19:27:21 +0100 (BST) Received: from mdfmta004.tch.inty.net (unknown [127.0.0.1]) by mdfmta004.tch.inty.net (Postfix) with ESMTP id 26D4BAC406C for ; Tue, 17 Jul 2012 19:27:21 +0100 (BST) Received: from palladium.local (unknown [80.176.134.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta004.tch.inty.net (Postfix) with ESMTP for ; Tue, 17 Jul 2012 19:27:20 +0100 (BST) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 References: X-Enigmail-Version: 1.4.2 Content-Type: multipart/mixed; boundary="------------070405020704030709060909" X-MDF-HostID: 17 Message-ID: <5005AE88.9060108@morningstar2.co.uk> Date: Tue, 17 Jul 2012 19:27:20 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: model l3 dtx file To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Sender is in whitelist: joseph.wright@MORNINGSTAR2.CO.UK); Detail=5D7Q89H36p4L00VTXC6D4q0N+AH0PUCnBi0P5cROEGjO+pG7NAH/K+tf9SrVFtpLrKONl 2T9EL4W4U4jgzLbnCcGpk1z/zwmKT/K1fv3lD0=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 7084 This is a multi-part message in MIME format. --------------070405020704030709060909 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 17/07/2012 18:38, Joel C. Salomon wrote: > I've been playing with some expl3 code on TeX.SX, and I'm trying to > turn some of that code into a package. Since I'm using expl3, I > figured I'd also experiment with l3doc. (Yes, I know it's labeled > "experimental"; I want to experiment.) > > I started with Joseph Wright's model dtx file from > , but I'm having some > trouble adapting it to l3doc. Does anyone have some boilerplate code I > can build off of? > > I'm reading expl3 documentation code, but that's rather large. Also, > there seems to be some magic involved with code like > \ProvidesExplClass > {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} > that I'm unable to figure out. > > BTW, should I also be using l3docstrip? > > —Joel There are a few approaches to building a .dtx file, as you can see if you look at the selection on CTAN. You will find 'traditional' .dtx files, which need an .ins file to be extracted, and 'all-in-one' .dtx files, which include their own .ins internally. My model .dtx file is of the latter type. In the case of the team's .dtx files which form the core of LaTeX3, there are other considerations. Version information is included from the SVN Id stings, which are picked up by \GetIdInfo and then turned into \ExplFileName, etc. At the same time, the files have to be set up to extract both in LaTeX2e package and IniTeX 'format' mode, and have somewhat complex load-order requirements. They also need to build into a single PDF file. This makes them less than ideal as a model for most packages. I've attached a template for creating a 'self extracting' .dtx file using l3doc, based on the approach I use in notes2bib and siunitx. I've kept only the basics, and removed some code I use for including demos: look at "LaTeXdemo" in my .dtx files to see this. In the demo, I've stuck with hard-coding in the version, so the \ProvidesExplClass is less complex than the one you've mentioned. Although this does not pick up data directly from commits to a version control system, I think it works better over all. (Certainly if you use Git or Mercurial.) -- Joseph Wright --------------070405020704030709060909 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="demo.dtx" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="demo.dtx" JSBcaWZmYWxzZSBtZXRhLWNvbW1lbnQKJTwqaW50ZXJuYWw+ClxpZmZhbHNlCiU8L2ludGVy bmFsPgolPCpyZWFkbWU+Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQo8cGtnPiAtLS0gPHRhZyBsaW5lPgpNYWludGFp bmVkIGJ5IDxuYW1lPgpFLW1haWw6IDx1c2VyPkA8ZG9tYWluPgpSZWxlYXNlZCB1bmRlciB0 aGUgTGFUZVggUHJ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vbntJbXBsZW1lbnRhdGlvbn0KJQolICAg IFxiZWdpbnttYWNyb2NvZGV9CiU8KnBhY2thZ2U+CiUgICAgXGVuZHttYWNyb2NvZGV9CiUg ICAgCiUgICAgXGJlZ2lue21hY3JvY29kZX0KJTxAQD08cHJlZml4Pj4KJSAgICBcZW5ke21h Y3JvY29kZX0KJQolICAgIFxiZWdpbnttYWNyb2NvZGV9ClxQcm92aWRlc0V4cGxQYWNrYWdl CiAgezxwa2c+fSB7PGRhdGVlfSB7PHZlcnNpb24+fQogIHs8dGFnIGxpbmU+fQolICAgIFxl bmR7bWFjcm9jb2RlfSAKJSAgICAKJSAgICBcYmVnaW57bWFjcm9jb2RlfQolPC9wYWNrYWdl PgolICAgIFxlbmR7bWFjcm9jb2RlfQolCiUgXGVuZHtpbXBsZW1lbnRhdGlvbn0KJQolIFxQ cmludENoYW5nZXMKJQolIFxQcmludEluZGV4 --------------070405020704030709060909--