ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* output file name query
@ 2020-05-22 12:33 Alan Bowen
  2020-05-22 13:09 ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Bowen @ 2020-05-22 12:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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.

Alan

[-- Attachment #1.2: Type: text/html, Size: 1076 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-22 12:33 output file name query Alan Bowen
@ 2020-05-22 13:09 ` Wolfgang Schuster
  2020-05-22 15:39   ` Henning Hraban Ramm
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2020-05-22 13:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Alan Bowen

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.

2. Use the result option on the command line, e.g. "context 
--result=myfilename prd_filename.tex".

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

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-22 13:09 ` Wolfgang Schuster
@ 2020-05-22 15:39   ` Henning Hraban Ramm
  2020-05-22 20:08     ` Rik Kabel
  2020-05-23 12:43     ` Wolfgang Schuster
  0 siblings, 2 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2020-05-22 15:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster <wolfgang.schuster.lists@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.

> 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).

> 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.

Best, Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-22 15:39   ` Henning Hraban Ramm
@ 2020-05-22 20:08     ` Rik Kabel
  2020-05-23 12:43     ` Wolfgang Schuster
  1 sibling, 0 replies; 8+ messages in thread
From: Rik Kabel @ 2020-05-22 20:08 UTC (permalink / raw)
  To: ntg-context


On 5/22/2020 11:39, Henning Hraban Ramm wrote:
>> Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster <wolfgang.schuster.lists@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.
>
>> 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).
>
>> 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.
>
> Best, Hraban
> ___________________________________________________________________________________
> 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
> _________________________________________________________________________________


Why not simply wrap it in a script or use make? (I set up a makefile for 
each project, but scripts are fine for smaller stuff that has fewer 
dependencies. Make is available on Windows, so that is not an impediment.)

-- 
Rik

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-22 15:39   ` Henning Hraban Ramm
  2020-05-22 20:08     ` Rik Kabel
@ 2020-05-23 12:43     ` Wolfgang Schuster
  2020-05-23 13:46       ` Gerben Wierda
  2020-05-23 21:52       ` Henning Hraban Ramm
  1 sibling, 2 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2020-05-23 12:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

Henning Hraban Ramm schrieb am 22.05.2020 um 17:39:
>> Am 22.05.2020 um 15:09 schrieb Wolfgang Schuster <wolfgang.schuster.lists@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.

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-23 12:43     ` Wolfgang Schuster
@ 2020-05-23 13:46       ` Gerben Wierda
  2020-05-23 19:46         ` Wolfgang Schuster
  2020-05-23 21:52       ` Henning Hraban Ramm
  1 sibling, 1 reply; 8+ messages in thread
From: Gerben Wierda @ 2020-05-23 13:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 23 May 2020, at 14:46, Wolfgang Schuster <wolfgang.schuster.lists@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@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.

Gerben

> Wolfgang
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-23 13:46       ` Gerben Wierda
@ 2020-05-23 19:46         ` Wolfgang Schuster
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2020-05-23 19:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Gerben Wierda

Gerben Wierda schrieb am 23.05.2020 um 15:46:
> 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?

\starttext is only a artificial border at the begin of the document and 
there is nothing which prevents you to put text before it. ConTeXt 
delays (or resets) a few settings (e.g. loading the default fonts) until 
this point but the document begins on the first line of the input file.

\setupbodyfont[modern-designsize]

Page \pagenumber.

\page

\starttext

Page \pagenumber.

\stoptext


> 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.

Setting the value of result on the first line is simple because ConTeXt 
already checks it.

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: output file name query
  2020-05-23 12:43     ` Wolfgang Schuster
  2020-05-23 13:46       ` Gerben Wierda
@ 2020-05-23 21:52       ` Henning Hraban Ramm
  1 sibling, 0 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2020-05-23 21:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 23.05.2020 um 14:43 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
> 
>>> 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.

Usually my project and environment have the same name, but different prefix (in my weird nomenclature).

>>> 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.

Of course. But in most of my projects I have several products (e.g. magazine issues, books of a series), and with a prefix I can keep all the products together and list them like `ls prd_*.tex`.
Not only my contextproject.py but also my call scripts relay on my naming scheme. And since I use it in my main projects, I use it everywhere (if I use the project structure at all).

>> 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.

You don’t need to know the name before ConTeXt creates the PDF, because it uses the original filename and only renames the files (pdf, tuc, log) afterwards. Or misunderstood I something?

Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-23 21:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 12:33 output file name query Alan Bowen
2020-05-22 13:09 ` Wolfgang Schuster
2020-05-22 15:39   ` Henning Hraban Ramm
2020-05-22 20:08     ` Rik Kabel
2020-05-23 12:43     ` Wolfgang Schuster
2020-05-23 13:46       ` Gerben Wierda
2020-05-23 19:46         ` Wolfgang Schuster
2020-05-23 21:52       ` Henning Hraban Ramm

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).