Re: [NTG-context] Can ConTeXt write its pdf to a different directory?
On 5/27/2023 11:51 AM, Denis Maier via ntg-context wrote: I usually use a makefile for this. There I have build rule that first cds into the target directory, then calls context from there. That is indeed the solution (also because the --path option will then fetch from the source). The more lua hackery the more danger of interference. The problem here is that a rename won't work in all scenarios (different drives on windows for instance, or from local disk to network drive). Anyway, one can also give --runpath=sometargetpath which i actually use to run for instance manuals, but there it is driven in the file itself: % language=us runpath=texruns:manuals/musings in combination with TEXRUNS=c:\data\temporary\texruns so that I don't overwrite a stable manual in the source path. Over the decades that context evolved there have been plenty such tricks added. I could probably add a move option to the job ticket mechanism but that has not changed in ages so ... workflows demands are too different. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Can ConTeXt write its pdf to a different directory?
I usually use a makefile for this. There I have build rule that first cds into the target directory, then calls context from there. Best Denis Von: ntg-context im Auftrag von peter.hopcroft--- via ntg-context Gesendet: Samstag, 27. Mai 2023 03:52:42 An: ntg-context@ntg.nl Cc: peter.hopcr...@icloud.com Betreff: [NTG-context] Can ConTeXt write its pdf to a different directory? My .tex file is in a directory within my working directory. I would like ConTeXt to write its output in the same directory as my .tex file. But it writes to the working directory. This was asked 10 years ago: `tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command` The answer given then was to use: `context filename --result=output-directory/filename` But this doesn't work now. When I compile my .tex file, I get a message: `results are to be on the running path, not on 'output-directory', ignoring --result` I've looked in the wiki: `https://wiki.contextgarden.net/Context` Thank you, Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Can ConTeXt write its pdf to a different directory?
Max, that answer seems like magic to me, in the sense of an advanced technology. Thank you. It's not quite working for me yet. I'll explore more tomorrow and learn about lua. Peter > On 27/05/2023, at 3:53 PM, Max Chernoff via ntg-context > wrote: > > Hi Peter, > >> My .tex file is in a directory within my working directory. I would like >> ConTeXt to write its output in the same directory as my .tex file. But it >> writes to the working directory. >> >> This was asked 10 years ago: >> `tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command` >> >> The answer given then was to use: >> `context filename --result=output-directory/filename` >> >> But this doesn't work now. When I compile my .tex file, I get a message: >> `results are to be on the running path, not on 'output-directory', ignoring >> --result` > > This seems to work, although I'm not sure that I would call it a "good" > solution: > > \startluacode > local function absolute(path) > return file.collapsepath(dir.expandname(path)) > end > > local texfile = absolute(environment.filename) > local pdffile = file.addsuffix( > absolute(environment.inputfilebarename), > "pdf" > ) > > luatex.wrapup(function() > os.rename(pdffile, file.replacesuffix(texfile, "pdf")) > end) > \stopluacode > > \starttext > Hello! > \stoptext > > -- Max > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Can ConTeXt write its pdf to a different directory?
Hi Peter, > My .tex file is in a directory within my working directory. I would like > ConTeXt to write its output in the same directory as my .tex file. But it > writes to the working directory. > > This was asked 10 years ago: > `tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command` > > The answer given then was to use: > `context filename --result=output-directory/filename` > > But this doesn't work now. When I compile my .tex file, I get a message: > `results are to be on the running path, not on 'output-directory', ignoring > --result` This seems to work, although I'm not sure that I would call it a "good" solution: \startluacode local function absolute(path) return file.collapsepath(dir.expandname(path)) end local texfile = absolute(environment.filename) local pdffile = file.addsuffix( absolute(environment.inputfilebarename), "pdf" ) luatex.wrapup(function() os.rename(pdffile, file.replacesuffix(texfile, "pdf")) end) \stopluacode \starttext Hello! \stoptext -- Max ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Can ConTeXt write its pdf to a different directory?
My .tex file is in a directory within my working directory. I would like ConTeXt to write its output in the same directory as my .tex file. But it writes to the working directory. This was asked 10 years ago: `tex.stackexchange.com/questions/67928/how-to-set-output-directory-in-context-command` The answer given then was to use: `context filename --result=output-directory/filename` But this doesn't work now. When I compile my .tex file, I get a message: `results are to be on the running path, not on 'output-directory', ignoring --result` I've looked in the wiki: `https://wiki.contextgarden.net/Context` Thank you, Peter ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___