ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Compiling context files in command line
@ 2022-06-04  5:21 Jaroslav Hajtmar via ntg-context
  2022-06-04  5:38 ` Denis Maier via ntg-context
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jaroslav Hajtmar via ntg-context @ 2022-06-04  5:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jaroslav Hajtmar

Hello ConTeXist.
After a long time, I turn to the conference for help.
I use command line to batch process of many ConTeXt files. Is it possible at the end off compile proces to move the created PDF to another directory (subdirectory of current directory) using the command line commands? Somehow I can't do it or maybe I'm making a mistake somewhere. 

Renaming works but moving into subdirectory I can't do it for some reason. What could be the problem? Is it even possible do it? I work with OS X in bash.

Simple example of my use:
context —mode=mymode  --result=subdir/mypdffilename.pdf processedfile.tex

My nontrivial using (content of my bash file) 
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_identifikacni_udaje,k=1,pk=1,ppk=1,t=,s=14" —result="pdfresult/svp_identifikacni_udaje.pdf" _identifikacni_udaje
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_skoly,k=2,pk=1,ppk=1,t=,s=15" --result="pdfresult/svp_charakteristika_skoly.pdf" _charakteristika_skoly
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_svp,k=3,pk=1,ppk=1,t=,s=19" --result="pdfresult/svp_charakteristika_svp.pdf" _charakteristika_svp
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_zacleneni_prurezovych_temat,k=3,pk=1,ppk=1,t=,s=30" --result="pdfresult/svp_zacleneni_prurezovych_temat.pdf" _zacleneni_prurezovych_temat
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_ucebni_plan,k=4,pk=1,ppk=1,t=,s=36" --result="pdfresult/svp_ucebni_plan.pdf" _ucebni_plan


In fact, it is used to create separate PDF files from one large complex document, where individual chapters are cut out of the overall document in pdf form.
This creates a large number of PDF files that I do not want to be placed in the current directory. Parameters are used to pass chapter numbers and page numbers to ConTeXt, to  correct numbering in pdf files.

Can you please advise?

Thanx Jaroslav
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Compiling context files in command line
  2022-06-04  5:21 Compiling context files in command line Jaroslav Hajtmar via ntg-context
@ 2022-06-04  5:38 ` Denis Maier via ntg-context
  2022-06-04 18:53 ` Bruce Horrocks via ntg-context
  2022-06-04 21:54 ` Max Chernoff via ntg-context
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Maier via ntg-context @ 2022-06-04  5:38 UTC (permalink / raw)
  To: ntg-context; +Cc: denis.maier

You cannot use the result command line option for that. Instead, switch to the target directory and run context from there.

Denis



________________________________________
Von: ntg-context <ntg-context-bounces@ntg.nl> im Auftrag von Jaroslav Hajtmar via ntg-context <ntg-context@ntg.nl>
Gesendet: Samstag, 4. Juni 2022 07:21:04
An: mailing list for ConTeXt users
Cc: Jaroslav Hajtmar
Betreff: [NTG-context] Compiling context files in command line

Hello ConTeXist.
After a long time, I turn to the conference for help.
I use command line to batch process of many ConTeXt files. Is it possible at the end off compile proces to move the created PDF to another directory (subdirectory of current directory) using the command line commands? Somehow I can't do it or maybe I'm making a mistake somewhere.

Renaming works but moving into subdirectory I can't do it for some reason. What could be the problem? Is it even possible do it? I work with OS X in bash.

Simple example of my use:
context —mode=mymode  --result=subdir/mypdffilename.pdf processedfile.tex

My nontrivial using (content of my bash file)
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_identifikacni_udaje,k=1,pk=1,ppk=1,t=,s=14" —result="pdfresult/svp_identifikacni_udaje.pdf" _identifikacni_udaje
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_skoly,k=2,pk=1,ppk=1,t=,s=15" --result="pdfresult/svp_charakteristika_skoly.pdf" _charakteristika_skoly
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_svp,k=3,pk=1,ppk=1,t=,s=19" --result="pdfresult/svp_charakteristika_svp.pdf" _charakteristika_svp
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_zacleneni_prurezovych_temat,k=3,pk=1,ppk=1,t=,s=30" --result="pdfresult/svp_zacleneni_prurezovych_temat.pdf" _zacleneni_prurezovych_temat
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_ucebni_plan,k=4,pk=1,ppk=1,t=,s=36" --result="pdfresult/svp_ucebni_plan.pdf" _ucebni_plan


In fact, it is used to create separate PDF files from one large complex document, where individual chapters are cut out of the overall document in pdf form.
This creates a large number of PDF files that I do not want to be placed in the current directory. Parameters are used to pass chapter numbers and page numbers to ConTeXt, to  correct numbering in pdf files.

Can you please advise?

Thanx Jaroslav
___________________________________________________________________________________
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] 4+ messages in thread

* Re: Compiling context files in command line
  2022-06-04  5:21 Compiling context files in command line Jaroslav Hajtmar via ntg-context
  2022-06-04  5:38 ` Denis Maier via ntg-context
@ 2022-06-04 18:53 ` Bruce Horrocks via ntg-context
  2022-06-04 21:54 ` Max Chernoff via ntg-context
  2 siblings, 0 replies; 4+ messages in thread
From: Bruce Horrocks via ntg-context @ 2022-06-04 18:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks



> On 4 Jun 2022, at 06:21, Jaroslav Hajtmar via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Hello ConTeXist.
> After a long time, I turn to the conference for help.
> I use command line to batch process of many ConTeXt files. Is it possible at the end off compile proces to move the created PDF to another directory (subdirectory of current directory) using the command line commands? Somehow I can't do it or maybe I'm making a mistake somewhere. 
> 
> Renaming works but moving into subdirectory I can't do it for some reason. What could be the problem? Is it even possible do it? I work with OS X in bash.
> 
> Simple example of my use:
> context —mode=mymode  --result=subdir/mypdffilename.pdf processedfile.tex
> 
> My nontrivial using (content of my bash file) 
> context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_identifikacni_udaje,k=1,pk=1,ppk=1,t=,s=14" —result="pdfresult/svp_identifikacni_udaje.pdf" _identifikacni_udaje
> context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_skoly,k=2,pk=1,ppk=1,t=,s=15" --result="pdfresult/svp_charakteristika_skoly.pdf" _charakteristika_skoly
> context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_charakteristika_svp,k=3,pk=1,ppk=1,t=,s=19" --result="pdfresult/svp_charakteristika_svp.pdf" _charakteristika_svp
> context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_zacleneni_prurezovych_temat,k=3,pk=1,ppk=1,t=,s=30" --result="pdfresult/svp_zacleneni_prurezovych_temat.pdf" _zacleneni_prurezovych_temat
> context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_ucebni_plan,k=4,pk=1,ppk=1,t=,s=36" --result="pdfresult/svp_ucebni_plan.pdf" _ucebni_plan
> 
> 
> In fact, it is used to create separate PDF files from one large complex document, where individual chapters are cut out of the overall document in pdf form.
> This creates a large number of PDF files that I do not want to be placed in the current directory. Parameters are used to pass chapter numbers and page numbers to ConTeXt, to  correct numbering in pdf files.
> 
> Can you please advise?

You could put the move command into the Bash script.
e.g.
context --purgeall --mode=THISSECTIONONLYHARD --arguments="o=_identifikacni_udaje,k=1,pk=1,ppk=1,t=,s=14" —result="svp_identifikacni_udaje.pdf" _identifikacni_udaje
mv "svp_identifikacni_udaje.pdf" "pdfresult"

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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] 4+ messages in thread

* Re: Compiling context files in command line
  2022-06-04  5:21 Compiling context files in command line Jaroslav Hajtmar via ntg-context
  2022-06-04  5:38 ` Denis Maier via ntg-context
  2022-06-04 18:53 ` Bruce Horrocks via ntg-context
@ 2022-06-04 21:54 ` Max Chernoff via ntg-context
  2 siblings, 0 replies; 4+ messages in thread
From: Max Chernoff via ntg-context @ 2022-06-04 21:54 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

> Is it possible at the end off compile proces to move the created PDF to another directory (subdirectory of current directory)

You can try something like this:

     \startluacode
         luatex.wrapup(function()
             local pdf = tex.jobname .. ".pdf"
             file.copy(pdf, "subdirectory/" .. pdf)
             os.remove(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 / 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] 4+ messages in thread

end of thread, other threads:[~2022-06-04 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-04  5:21 Compiling context files in command line Jaroslav Hajtmar via ntg-context
2022-06-04  5:38 ` Denis Maier via ntg-context
2022-06-04 18:53 ` Bruce Horrocks via ntg-context
2022-06-04 21:54 ` Max Chernoff via ntg-context

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