From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106866 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: Re: Using command line values in a TeX document; writing a script? Date: Wed, 15 Apr 2020 14:13:35 +0200 Message-ID: <8FADCC5E-830B-4442-BA00-967A86257890@rna.nl> References: <21EE30E7-D8C9-4797-8526-0BBC23AB68E2@rna.nl> <593CDD5F-DBA7-4A5F-8236-09BEC3B5F356@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="===============2446341459434993340==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="111473"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 15 14:14:00 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOgvX-000SsP-O3 for gctc-ntg-context-518@m.gmane-mx.org; Wed, 15 Apr 2020 14:13:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 396501807EF; Wed, 15 Apr 2020 14:13:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tOCvE2ekkX01; Wed, 15 Apr 2020 14:13:38 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8DB57180845; Wed, 15 Apr 2020 14:13:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 38127180845 for ; Wed, 15 Apr 2020 14:13:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eS0Hel3wH5EZ for ; Wed, 15 Apr 2020 14:13:37 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 86E841807EF for ; Wed, 15 Apr 2020 14:13:37 +0200 (CEST) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id AAA3D3D4FF76; Wed, 15 Apr 2020 14:13:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1586952815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cFNpr5+YX+K9g374P1wvapyG+lgwZqIhcFHy0ZsacJs=; b=JviD0qDPdG6f1vfOdNhRN9aqNH/d5aO7oGxJVyJA3+IoOz7lcISCQyYb9qOX+4HCaxzS+r NpieBP8GwqaOC8LMq3Fhhky/yAHHwr/BdQoUzTERC46oiL/bfof2dsM6beinnK9176gvjW 32Rpc2Y0tqpLYjxhbf50TTZvvCbTFXSO7A8WiblyrXqa5pK8eAeS13jN4WTON3b7qTo4mT PTrJTJzE+bZVrzT8SA7REtJt18RwISYQKPhCpm08vv1OkefkG3f4YarCKYD9rKKaIC9tF1 Y//vaUy+wc1JI94WCIsjC9LickzZqkCqTm9F0DJNdc8hSUEgjkNQ2oQpCsOqqQ== In-Reply-To: X-Mailer: Apple Mail (2.3445.104.14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:106866 Archived-At: --===============2446341459434993340== Content-Type: multipart/alternative; boundary="Apple-Mail=_AD70BF2F-90E8-43AF-A40B-2180B256EB62" --Apple-Mail=_AD70BF2F-90E8-43AF-A40B-2180B256EB62 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 15 Apr 2020, at 13:54, Wolfgang Schuster = wrote: >=20 > Gerben Wierda schrieb am 15.04.2020 um 12:19: >>> On 14 Apr 2020, at 11:52, Taco Hoekwater wrote: >>>> On 14 Apr 2020, at 11:25, Gerben Wierda = wrote: >>>>=20 >>>> This helps for adding information to my processing. >>>>=20 >>>> What I was also looking for is that I don=E2=80=99t have a test.tex = anymore, just the XML file I am parsing and a command line action. >>>>=20 >>>> So, I use mtxrun, give it the name of an XML. lua code (using a = =E2=80=99script=E2=80=99 somewhere?) reads the XML, extracts a name = (e.g. =E2=80=98foo=E2=80=99) from it, creates a .tex file (e.g. = =E2=80=98foo.tex=E2=80=99), produces a .pdf file from that .tex file = (e.g. =E2=80=98foo.pdf'). >>> When processing XML, I normally use >>>=20 >>> context =E2=80=94environment=3Dwhatever.tex file.xml >>>=20 >>> with whatever.tex being a mix of tex and lua to setup and process = the XML directly, >>> perhaps including other XML files as needed. >> But this means that the whatever.tex file needs to exist beforehand = and the result is whatever.pdf >>=20 >> I want the actual PDF to be produced have a name that comes from the = XML I am processing and thus the whatever.tex file be created by lua. = There is no whatever.tex file before I run the command. >>=20 >> Pre-command: >> XML: >> contains file name =E2=80=9Cfoo=E2=80=9D >> there is no .tex file >>=20 >> Command: >> produces foo.tex (gets the name from the XML) and =E2=80=9Cfoo.pdf= " >=20 > The TeX file in Tacos example contains the xmlsetup entries which are = used > to map the XML tags to ConTeXt commands and environment, the resulting > PDF file has the same name as the XML file. That is different from the resulting PDF file has the name of an entry/field in the = XML file. So, what I am looking for is: command foo.xml which results in=20 bar.pdf where =E2=80=98bar=E2=80=99 is text in foo.xml G >=20 > Wolfgang >=20 --Apple-Mail=_AD70BF2F-90E8-43AF-A40B-2180B256EB62 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 15 Apr 2020, at 13:54, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:

Gerben= Wierda schrieb am 15.04.2020 um 12:19:
On 14 Apr = 2020, at 11:52, Taco Hoekwater <taco@elvenkind.com> wrote:
On 14 Apr 2020, at 11:25, Gerben Wierda <gerben.wierda@rna.nl> wrote:

This helps for adding information to my processing.

What I was also looking for is that I don=E2=80=99= t have a test.tex anymore, just the XML file I am parsing and a command = line action.

So, I use mtxrun, give it the = name of an XML. lua code (using a =E2=80=99script=E2=80=99 somewhere?) = reads the XML, extracts a name (e.g. =E2=80=98foo=E2=80=99) from it, = creates a .tex file (e.g. =E2=80=98foo.tex=E2=80=99), produces a .pdf = file from that .tex file (e.g. =E2=80=98foo.pdf').
When processing XML, I normally use

  context = =E2=80=94environment=3Dwhatever.tex file.xml

with whatever.tex being a mix of tex and lua to setup and = process the XML directly,
perhaps including other XML = files as needed.
But this means that the = whatever.tex file needs to exist beforehand and the result is = whatever.pdf

I want the actual PDF to be = produced have a name that comes from the XML I am processing and thus = the whatever.tex file be created by lua. There is no whatever.tex file = before I run the command.

Pre-command:
= XML:
contains file name =E2=80=9Cfoo=E2=80= =9D
there is no .tex file

Command:
produces = foo.tex (gets the name from the XML) and =E2=80=9Cfoo.pdf"

The TeX file in Tacos example = contains the xmlsetup entries which are used
to map the = XML tags to ConTeXt commands and environment, the resulting
PDF file has the same name as the XML file.

That = is different from

 the = resulting PDF file has the name of an entry/field in = the XML file.

So, what I am looking = for is:

command foo.xml

which results in 

bar.pdf

where =E2=80=98bar=E2=80=99 is text in = foo.xml

G


Wolfgang


= --Apple-Mail=_AD70BF2F-90E8-43AF-A40B-2180B256EB62-- --===============2446341459434993340== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2446341459434993340==--