ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerben Wierda <gerben.wierda@rna.nl>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Using command line values in a TeX document; writing a script?
Date: Wed, 15 Apr 2020 14:13:35 +0200	[thread overview]
Message-ID: <8FADCC5E-830B-4442-BA00-967A86257890@rna.nl> (raw)
In-Reply-To: <ed457049-de67-05a1-2dd8-dba45397c0f3@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1954 bytes --]



> 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’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 ’script’ somewhere?) reads the XML, extracts a name (e.g. ‘foo’) from it, creates a .tex file (e.g. ‘foo.tex’), produces a .pdf file from that .tex file (e.g. ‘foo.pdf').
>>> When processing XML, I normally use
>>> 
>>>   context —environment=whatever.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 “foo”
>> 	there is no .tex file
>> 
>> Command:
>> 	produces foo.tex (gets the name from the XML) and “foo.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 ‘bar’ is text in foo.xml

G

> 
> Wolfgang
> 


[-- Attachment #1.2: Type: text/html, Size: 3770 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-04-15 12:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13  8:29 Gerben Wierda
2020-04-14  7:16 ` Taco Hoekwater
2020-04-14  9:25   ` Gerben Wierda
2020-04-14  9:52     ` Taco Hoekwater
2020-04-15 10:19       ` Gerben Wierda
2020-04-15 11:54         ` Wolfgang Schuster
2020-04-15 12:13           ` Gerben Wierda [this message]
2020-04-15 12:43             ` r.ermers
2020-04-14 10:05     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8FADCC5E-830B-4442-BA00-967A86257890@rna.nl \
    --to=gerben.wierda@rna.nl \
    --cc=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).