From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109263 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: thierry horsin Newsgroups: gmane.comp.tex.context Subject: Re: Running mtxrun in a continuous batch mode Date: Fri, 6 Nov 2020 09:47:01 +0100 Message-ID: <200332d2-52c2-854d-2f0c-bce0f1f011f3@free.fr> References: <001a4cfc-d1ec-dbc9-0f2a-3d9bf613a035@xs4all.nl> <1c813804-96ff-4b4c-9484-7e10fe3c2c5f@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8268944953103438677==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8362"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 06 09:48:40 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaxQF-00021d-Jz for gctc-ntg-context-518@m.gmane-mx.org; Fri, 06 Nov 2020 09:48:39 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A79681A9E42; Fri, 6 Nov 2020 09:47:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SQtl0zR_tDmw; Fri, 6 Nov 2020 09:47:06 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 001041A9E52; Fri, 6 Nov 2020 09:47:05 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4F4981A9E4F for ; Fri, 6 Nov 2020 09:47:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qMq5JdUCALF7 for ; Fri, 6 Nov 2020 09:47:03 +0100 (CET) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=212.27.42.1; helo=smtp1-g21.free.fr; envelope-from=horsin@free.fr; receiver= Original-Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 149F11A9E42 for ; Fri, 6 Nov 2020 09:47:03 +0100 (CET) Original-Received: from [192.168.0.16] (unknown [89.3.114.35]) (Authenticated sender: horsin) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 931ABB0055E for ; Fri, 6 Nov 2020 09:47:01 +0100 (CET) In-Reply-To: Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:109263 Archived-At: This is a multi-part message in MIME format. --===============8268944953103438677== Content-Type: multipart/alternative; boundary="------------89740990D034E917558768E5" Content-Language: en-US This is a multi-part message in MIME format. --------------89740990D034E917558768E5 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Ramkumar, Maybe you could have some scripts that check when the JSON file is modified and if so launches the compilation. I did that sort of script in order to have a continuous compilation process by checking every second if my current .tex file is modified. Best Thierry On 06/11/2020 09:38, Ramkumar KB wrote: > Hans, > > Thank you for the suggestions. Let me try them out and feedback back > to you (as the batch set-up involves > 10,000 docs). > > Best, > Ramkumar > > On Wed, Nov 4, 2020 at 7:24 PM Hans Hagen > wrote: > > On 11/4/2020 4:48 AM, Ramkumar KB wrote: > > Hans, > > > > Thank you so much for the kind response. > > > > Apologies that I was not very clear in my initial query. I have - > > > >  1. MyStatement.tex, with all the necessary fonts, static text, > images, > >     header, footer etc > >  2. MyStatement.tex reads from a JSON file for certain sections > of the > >     document for the dynamic content > >  3. context MyStatement.tex produces MyStatement.pdf > > > > How do I do the above steps 1 to 3 in a continuous fashion such > that - > > > >   * Output is MyStatement_1.pdf (reads from data_1.json), > >     MyStatement_2.pdf (reads from data_2.json) and so on > >   * The tex processing is fast as fonts etc are loaded once (as > the Tex > >     template is same for all the MyStatement_n.pdf) > > > >  From the sample code that you gave, I get a hint that this can be > > possibly done using ConTeXt Lua Document approach. Is this correct? > i'd just write a script that calls context like > > context mystatement.tex --myjsonsection=1 --batch > context mystatement.tex --myjsonsection=2 --batch > context mystatement.tex --myjsonsection=3 --batch > > etc .. maybe --once if no multipass is needed, or --runs=2 if you > know > how many runs are needed > > to stay in a run and kind of restart is asking for troubles > because what > should be reset? of course i could context make do that buit it > doesn't > pay off > > an alternative that you generate one document with all statements and > use mutool to split of the pages > > but anyway, nowadays machines are fast enough to have separate > runs (and > one can run them in parallel) > > 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 / 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 > ___________________________________________________________________________________ --------------89740990D034E917558768E5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Ramkumar,

Maybe you could have some scripts that check when the JSON file is modified and if so launches the compilation. I did that sort of script in order to have a continuous compilation process by checking every second if my current .tex file is modified.

Best

Thierry

On 06/11/2020 09:38, Ramkumar KB wrote:
Hans,

Thank you for the suggestions. Let me try them out and feedback back to you (as the batch set-up involves > 10,000 docs).

Best,
Ramkumar

On Wed, Nov 4, 2020 at 7:24 PM Hans Hagen <j.hagen@xs4all.nl> wrote:
On 11/4/2020 4:48 AM, Ramkumar KB wrote:
> Hans,
>
> Thank you so much for the kind response.
>
> Apologies that I was not very clear in my initial query. I have -
>
>  1. MyStatement.tex, with all the necessary fonts, static text, images,
>     header, footer etc
>  2. MyStatement.tex reads from a JSON file for certain sections of the
>     document for the dynamic content
>  3. context MyStatement.tex produces MyStatement.pdf
>
> How do I do the above steps 1 to 3 in a continuous fashion such that -
>
>   * Output is MyStatement_1.pdf (reads from data_1.json),
>     MyStatement_2.pdf (reads from data_2.json) and so on
>   * The tex processing is fast as fonts etc are loaded once (as the Tex
>     template is same for all the MyStatement_n.pdf)
>
>  From the sample code that you gave, I get a hint that this can be
> possibly done using ConTeXt Lua Document approach. Is this correct?
i'd just write a script that calls context like

context mystatement.tex --myjsonsection=1 --batch
context mystatement.tex --myjsonsection=2 --batch
context mystatement.tex --myjsonsection=3 --batch

etc .. maybe --once if no multipass is needed, or --runs=2 if you know
how many runs are needed

to stay in a run and kind of restart is asking for troubles because what
should be reset? of course i could context make do that buit it doesn't
pay off

an alternative that you generate one document with all statements and
use mutool to split of the pages

but anyway, nowadays machines are fast enough to have separate runs (and
one can run them in parallel)

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 / 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
___________________________________________________________________________________
--------------89740990D034E917558768E5-- --===============8268944953103438677== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============8268944953103438677==--