Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Tue, 11 Aug 2009 17:49:35 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n7BFnWgw019332 for ; Tue, 11 Aug 2009 17:49:32 +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 n7BFjYh1031043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Aug 2009 17:45:34 +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 n7BCdJB9028140; Tue, 11 Aug 2009 17:45:32 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 292448 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 11 Aug 2009 17:45:31 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n7BFjVVd015813 for ; Tue, 11 Aug 2009 17:45:31 +0200 Received: from ueamailgate02.uea.ac.uk (ueamailgate02.uea.ac.uk [139.222.131.185]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n7BFjJuj005214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 11 Aug 2009 17:45:24 +0200 Received: from ueams02.uea.ac.uk (ueams02.uea.ac.uk [139.222.131.131]) by ueamailgate02.uea.ac.uk (8.13.1/8.13.1) with ESMTP id n7BFjJp3022116 for ; Tue, 11 Aug 2009 16:45:19 +0100 Received: from [139.222.200.201] by ueams02.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1MatXJ-00066r-27 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 11 Aug 2009 16:45:17 +0100 User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 References: <4A7921CF.5020803@morningstar2.co.uk> <4A7AD930.2090106@residenset.net> <8516B615-51AA-4D90-BB7D-A9E122AA0335@gmail.com> <4A804317.6050909@morningstar2.co.uk> <4A80469B.5040305@morningstar2.co.uk> <4A804ED7.4040305@morningstar2.co.uk> <4A812A23.2000808@morningstar2.co.uk> <30090124-F668-4FB3-8F03-5CB615F80D6F@gmail.com> <4A813CE2.7080402@morningstar2.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Canit-CHI2: 0.00 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, outgoing) X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 27989135 - c5da41dd6e94 X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.185 Message-ID: <4A819214.1080207@morningstar2.co.uk> Date: Tue, 11 Aug 2009 16:45:24 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: xparse To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 11 Aug 2009 15:49:35.0914 (UTC) FILETIME=[53A648A0:01CA1A9B] Status: R X-Status: X-Keywords: X-UID: 5887 J.Fine wrote: > Joseph Wright wrote: > >> J.Fine wrote: >>> I want documents that can be readily converted to XML. This is a future >> requirement for me. TeX macros is not. >> >> There are two things going on here: >> >> 1) How LaTeX3 default input syntax might look. The current LaTeX2e model >> is bad for this as it is not that structured. So there is a question of >> trying to make things more structured, which in part means better >> separation of content from appearance. >> >> 2) How LaTeX3 then typesets input. >> >> On (1), then a separate tool may well be the best approach, as you >> suggest. However, I think that relates more to LaTeX3 input syntax (as >> yet undecided). xparse is more about (2) (although I see that there is >> quite a lot of overlap to worry about). >> >> In some ways, I wonder if this issue is related to something that is >> explored in xparse. The "real" version has the experimental concept: >> >> \DeclareDocumentCommandInterface >> \DeclareDocumentCommandImplementation >> >> with the idea that the ...Interface function sets up the user syntax, >> while the ...Implementation one actually contains the code: >> >> \DeclareDocumentCommandInterface \foo { s o m } { foo-implementation } >> \DeclareDocumentCommandImplementation { foo-implementation } 3 {} >> >> So to translate to XML (or whatever) the \foo part does not change, but >> only the foo-implementation part does. In that way, the awkward nature >> of the LaTeX user interface (optional arguments, stars, ...) is still >> handled by the same code even if the result (in foo-implementaion) is >> very different. >> >> So you could imagine \DeclareDocumentCommand doing these for every >> function: >> >> \cs_new:Npn \DeclareDocumentCommand #1#2#3 { >> \DeclareDocumentCommandInterface #1 {#2} >> { \token_to_set:N #1 -impementation} >> \DeclareDocumentCommandImplementation >> { \token_to_set:N #1 -impementation} >> { \xparse_get_arg_num:n {#2} } % or some such thing! >> {#3} >> } >> >> Writing XML is then a case of changing each implementation, without >> changing the input at all. Would this go in the right direction? > > This is a wonderful example of the point I'm making. One starts with TeX macros, adds more features, satisfies more requirements. Whatever method you use to program, you have somewhere to add features to satisfy requirements :-) > And then one suggests programming TeX macros that write XML output. And you find yourself programming a LaTeX-like input syntax to XML translator in TeX macros. This is not something I want to be part of, nor something I'd like to use (even though TeX is Turing complete). Somewhere in a LaTeX to XML conversion some code has to read LaTeX and output XML. > It seems that LaTeX3 project will use only TeX macros to solve its problems. This restricts the problems it can solve. I think this restriction prevents the creation of LaTeX3. I take it you see a work-flow something like: 1) Write document in LaTeX3 document syntax (broadly, LaTeX2e syntax but with some changes, and only the document part). 2) Process this with whatever language decided on to convert from LaTeX input syntax to an intermediate form (perhaps LaTeX input -> XML -> LaTeX typesetting). 3) If necessary, process the intermediate form to produce final output. For example, the most likely approach (at present) would be to typeset the intermediate form using TeX. Am I understanding you correctly? If so, I assume your broadly supportive of doing TeX programming for (3) to make the typesetting work as well as possible, but imagine (2) done with something else (I've suggested Lua for obvious reasons, but the principal does not depend on the programming language used). This strikes me as rather similar to what the ConTeXt programmers are doing, using Lua for the programming as I suggest above (although I don't think they are taking quite such a separated out approach: anyone familiar enough with Mk IV to comment?). -- Joseph Wright