[NTG-context] output file name query

Gerben Wierda gerben.wierda at rna.nl
Sat May 23 15:46:49 CEST 2020

> On 23 May 2020, at 14:46, Wolfgang Schuster <wolfgang.schuster.lists at gmail.com> wrote:
> Henning Hraban Ramm schrieb am 22.05.2020 um 17:39:
>>>> Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster <wolfgang.schuster.lists at gmail.com>:
>>> Alan Bowen schrieb am 22.05.2020 um 14:33:
>>>> In my project, I process a single product file by enabling various modes. What I would like to do is to vary the name of the output PDF file in each instance.
>>>> So, in processing a file, how does one go directly from prd_filename.tex to myfilename.pdf rather than to prd_filename.pdf—assuming that it is possible?
>>>> Any tips or pointers to what I should be reading will be greatly appreciated.
>>> 1. Drop the weird (sorry Hraban) naming system and use myfilename for your product.
>> I force nobody to use that.
> No and everybody has to find a system which fits best for him, prefixes can be useful (e.g. to avoid component and style files with the same name) but aren't necessary.
>>> 2. Use the result option on the command line, e.g. "context --result=myfilename prd_filename.tex".
>> But that still produces a "prd_filename.*" first and then renames it, making it impossible to keep a "prd_filename.pdf". Or did that change recently?
>> My workflows are adapted to that behaviour: "prd_*.pdf" is just the temporary version, none of those leaves my computer, but only nicely named PDFs (usually MyProductName_yyyy-mm-dd.pdf).
> Having a simple name doesn't mean it's the final name of the document.
>>> 3. Ask Hans to add the result option to the first line of the document which is read by the context script before it creates the PDF.
>>> % result="myfilename"
>>> \starttext
>>> ...
>>> \stoptext
>> That contradicts the mode approach. It would be nice if we could set (or can we?) the result from within the product, depending on a mode – since the product is renamed only later anyway, that could be viable.
> This addition is easy because already reads the first line of the document for special setting (e.g. the engine) but anything which is set in the document requires more work because you don't know the new name *before* LuaTeX or LuaMetaTeX create the PDF.

Just curious: wouldn’t it theoretically be possible to delay opening the output file until the first \stattext? Or is there already stuff going out before that, such as preliminaries that go into the PDF?

I think being able to name the output file in the preliminaries in the TeX file would come in handy and prevent more complex workarounds with scripts. But it is not essential as workarounds are possible.


> Wolfgang
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> maillist : ntg-context at 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
> ___________________________________________________________________________________

More information about the ntg-context mailing list