From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/109261 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ramkumar KB Newsgroups: gmane.comp.tex.context Subject: Re: Running mtxrun in a continuous batch mode Date: Fri, 6 Nov 2020 16:38:42 +0800 Message-ID: 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="===============6622690473742615565==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8514"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ntg-context@ntg.nl To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 06 09:39:39 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 1kaxHW-00026r-Mj for gctc-ntg-context-518@m.gmane-mx.org; Fri, 06 Nov 2020 09:39:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 99FC61A9DBF; Fri, 6 Nov 2020 09:39:05 +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 5NXixzpiNP4d; Fri, 6 Nov 2020 09:39:04 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0BD701A9E2C; Fri, 6 Nov 2020 09:39:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8F94F1A9DFC for ; Fri, 6 Nov 2020 09:39:02 +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 vwBvnpn020aV for ; Fri, 6 Nov 2020 09:39:01 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.167.52; helo=mail-lf1-f52.google.com; envelope-from=ramkumarkb@gmail.com; receiver= Original-Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id A93AD1A9DBF for ; Fri, 6 Nov 2020 09:39:01 +0100 (CET) Original-Received: by mail-lf1-f52.google.com with SMTP id b1so760465lfp.11 for ; Fri, 06 Nov 2020 00:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R4Xl0Sd0gnh7fSXYeBRFcqh8K29uTJCITapUAX8M/oY=; b=jlf7L3vUT/bDol/w9gac9cWdXf8cpAWO8xPkhhDy31VrIV7tvmLzS00Y78+e+fyBeG VZYe7k9sK5bsxr5dAOOYgWIluLU+QU8VfJKaCBVUsnecygb7Qi0ijFCplxzdZGKBZmwW PjAru2hHTrtP+oOqEsXz0MpJU4f7vN51HMP91GKhmujhPgen8na9uYEkEt7KgFL7CzLs 9KYISVNDmpGMpqq8qupNNuqy5VzaBNIqurZEDidgIYn2hRRDOMI3j4/7gWBw67Hw7Jes scGk44Gdb2TxJ+r0aytpyoRogJdUu6lkpHemOVlKtxll69QTwVLX5z/7aMlIn14b6/TX oaMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R4Xl0Sd0gnh7fSXYeBRFcqh8K29uTJCITapUAX8M/oY=; b=kpFaT7XGiosTpLbBAXPOyb0g/V4aJObo76fGQ9uR+pISk/MdJCJ/F4WAdaBGjav/Ty EGWVs+g4QZJ0FrdjMxVcXTtwN2y8sJBHb/bM0/M6/HqnBM50gzIDIpA7OjNOS+d/BBj+ o4bG6ReJDcpbJaKuW8qgEOQ3ornqccFzmayMkoNJZ1TxjifO9YMG1WU7yAfL6sBjsd9b ouM37xkSOkQYGzKS5S0oTaWt2OIDT2SRDgd5v9dvH8oWmuVbatNV5kcOW/CXBQVFbrMP useB8mpsN+E+2O/vy9J8srwoEWFujqY2/7PM6gi9emEODTvrMD2h2BLm3NwiUxKw4jKz vWLg== X-Gm-Message-State: AOAM531O9lE9GwhtgdVpzaV8RKXBAVIrX49Z5Te4ShXDknLxubfjqvMJ LM1MvQZcv4WE+RV98vaQXxdw1lqqiKTu3/2hILw= X-Google-Smtp-Source: ABdhPJzTcFuEC3OYXFe4Txp3X096IouOqvj0Q/Zm3lmNko2mOw6ndw6zdN0/o3M/NY+0NlrwCgR4M1chISRUh2CSFGc= X-Received: by 2002:a19:3fd6:: with SMTP id m205mr425624lfa.1.1604651941016; Fri, 06 Nov 2020 00:39:01 -0800 (PST) In-Reply-To: <1c813804-96ff-4b4c-9484-7e10fe3c2c5f@xs4all.nl> 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:109261 Archived-At: --===============6622690473742615565== Content-Type: multipart/alternative; boundary="000000000000eeb97405b36c24cc" --000000000000eeb97405b36c24cc Content-Type: text/plain; charset="UTF-8" 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 > ----------------------------------------------------------------- > --000000000000eeb97405b36c24cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hans,

Thank you for the suggestions. Le= t me try them out and feedback back to you (as the batch set-up involves &g= t; 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=C2=A0that I was not very clear in my initial=C2=A0query. I h= ave -
>
>=C2=A0 1. MyStatement.tex, with all the necessary fonts, static text, i= mages,
>=C2=A0 =C2=A0 =C2=A0header, footer etc
>=C2=A0 2. MyStatement.tex reads from a JSON file for certain sections o= f the
>=C2=A0 =C2=A0 =C2=A0document for the dynamic content
>=C2=A0 3. context MyStatement.tex produces MyStatement.pdf
>
> How do I do the above steps 1 to 3 in a continuous fashion such that -=
>
>=C2=A0 =C2=A0* Output is MyStatement_1.pdf (reads from data_1.json), >=C2=A0 =C2=A0 =C2=A0MyStatement_2.pdf (reads from data_2.json) and so o= n
>=C2=A0 =C2=A0* The tex processing is fast as fonts etc are loaded once = (as the Tex
>=C2=A0 =C2=A0 =C2=A0template is same for all the MyStatement_n.pdf)
>
>=C2=A0 From the sample code that you gave, I get a hint that this can b= e
> possibly done using ConTeXt Lua Document approach. Is this correct? i'd just write a script that calls context like

context mystatement.tex --myjsonsection=3D1 --batch
context mystatement.tex --myjsonsection=3D2 --batch
context mystatement.tex --myjsonsection=3D3 --batch

etc .. maybe --once if no multipass is needed, or --runs=3D2 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


-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Hans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Ridderstraat 27 | 80= 61 GH Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.nl | www.= pragma-pod.nl
-----------------------------------------------------------------
--000000000000eeb97405b36c24cc-- --===============6622690473742615565== 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== --===============6622690473742615565==--