From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115776 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jethro Djan via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Clipping multiple PDFs Date: Tue, 23 Aug 2022 17:12:15 +0000 Message-ID: References: <562590a3-0a27-ffb2-e76f-a5491bcbed8e@gmx.es> <0bc8c642-10b7-2052-a49e-626063ef4d43@gmx.es> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3598577959949859246==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jethro Djan To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 23 19:13:28 2022 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 1oQXSy-00026F-7o for gctc-ntg-context-518@m.gmane-mx.org; Tue, 23 Aug 2022 19:13:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 447812A3F70; Tue, 23 Aug 2022 19:12:50 +0200 (CEST) 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 QCGGPCvQlGFE; Tue, 23 Aug 2022 19:12:48 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1D3852A3FA2; Tue, 23 Aug 2022 19:12:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 992422A3FA2 for ; Tue, 23 Aug 2022 19:12:31 +0200 (CEST) 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 n7WHhZmN4M8b for ; Tue, 23 Aug 2022 19:12:30 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.178; helo=mail-yw1-f178.google.com; envelope-from=jthryeboah@gmail.com; receiver= Original-Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (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 1507F2A3F70 for ; Tue, 23 Aug 2022 19:12:30 +0200 (CEST) Original-Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-335624d1e26so397249167b3.4 for ; Tue, 23 Aug 2022 10:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc; bh=t1l6poxc3R64EP50rGAGtOyBoQbzcmOEWD0lTn3t+KM=; b=X3JKk7KS0Jmkoj+g6iScMQo6g1n2VXxGJ3wDvIl1E+YArLOLe9lf54CamlnVFWL3pC UKShc7M/9V6b3bLRuYJ+LmqgYxM76pdQARcB75h+/UlDz4tA+fq9E8m3RvV6OTHPKhM1 cJA1LoANQEyT8Y5+bOJPFF4HB/i+N85hZll2f4AWRMO2ocOgqBYH2INa5IAOWjSQ0306 75wPjnFVqfxLn+tIFfJe6rJhuCd8jnC0ksE1JwDE+6XF4r3CoMDryqQ8Xw75bFB4P2p6 uYclaVPVWJzS38F6i7cgBRL0PJbV8w6KYePoB+aLGnjzVACuvu5B+cDFpMkRfdjFLq0B 4/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc; bh=t1l6poxc3R64EP50rGAGtOyBoQbzcmOEWD0lTn3t+KM=; b=UohK80343PfCGG/2H+VFk4GwvsanCsXRXuCVxfEVGwAuK7ZWNxymeLJXvvurJ2Cccx gWt4NIKAgsctxw5BmxrZzO+6sCijflokVsZYI46PvcGICLEjPsteAn5/ob0BUNraYCk/ WAj/LZnenUd+uLFlBWUARSsHruo0micqmbyMPEgPH4ngIgzMtHE/JTTp3LDfhyGQR8G8 bsYSbx5mCciCUBaR6mbAUsyaPEwdLuZVysQxdUFmbgtWVnfOziAtFRdqNhI5ZZcivXaL CKkOy48ItnvMTBwzCkzVeUtoRyf/CxXth8ka/9xG1UluUPp/l3GG2zKasB5sNh7KLmM9 1HOA== X-Gm-Message-State: ACgBeo2I6d22+xK1Re0Mza7oNeME0dHyK6LHANtBTLC9U5vUZWIFh9Tk /yObgsUItKrMQCMsiiLgKygiisGA9S6ajrx3nvcWAnw1GRaKhg== X-Google-Smtp-Source: AA6agR5t6+4EQUidK+3fu85FG3qXdsHP17SfL6fDEBRI1EDEHbzZpxWtLKWSaGFUZ4YHP8M9a7832c0OcoC9cXa06ZY= X-Received: by 2002:a0d:d496:0:b0:335:4877:7dc5 with SMTP id w144-20020a0dd496000000b0033548777dc5mr26549359ywd.405.1661274747179; Tue, 23 Aug 2022 10:12:27 -0700 (PDT) In-Reply-To: <0bc8c642-10b7-2052-a49e-626063ef4d43@gmx.es> 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:115776 Archived-At: --===============3598577959949859246== Content-Type: multipart/alternative; boundary="0000000000002e24dc05e6ebab33" --0000000000002e24dc05e6ebab33 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Thanks to Pablo and Aditya for the solutions. Sometimes it is very difficult to find the right manuals and info for what you want to achieve for those of us new to ConTeXt. I found the stuff on context(context.noffigurepages) here ( https://wiki.contextgarden.net/Image_Placement) and I didn=E2=80=99t know t= he manual you linked to existed. I have also been searching for stuff about =E2=80=9Clow-level=E2=80=9D stuff in ConTexT like the \doloopoverlist comma= nd. I hope to contribute to the online wiki as I become a better user of ConTeXt. On Tue, Aug 23, 2022 at 3:58 PM Pablo Rodriguez via ntg-context < ntg-context@ntg.nl> wrote: > On 8/22/22 17:46, Jethro Djan via ntg-context wrote: > > Thanks for the solution Pablo. It works well. > > Glad to read it worked for you, Jethro. > > > I wanted to add more pdfs (which also has many pages) and found it > > was easier for me to reason in the lua side of things. This is what I > > have at the moment: > > I think this might be what you intend: > > \setuplayout[page] > \starttext > \doloopoverlist{ass1,ass2,ass3,ass4,ass5,ass6,ass7,ass8} > {\def\Doc{\recursestring.pdf} > \getfiguredimensions[\Doc] > \dorecurse{\noffigurepages} > {\externalfigure[\Doc] > [page=3D\recurselevel, width=3D20cm, scale=3D950]}} > \stoptext > > > I didn=E2=80=99t know how to get an array (or indexed table or whatever= you > > call it) in ConTeXt/Tex. > > \doloopoverlist & \recursestring are your friends here. > > > My problem is now with context(context.noffigurepages). Am I calling > > it wrong? All I want to do is call \noffigurepages from the lua side. > > Is there something I am missing? > > The approach is totally different: "getnofpages" > ( > http://www.pragma-ade.com/general/manuals/luametatex.pdf#search=3Dgetnofp= ages > ). > > BTW, your code crashed my session, CPU goes to 100% and RAM usage too. I > wonder how your sample could be compiled fine by your system. > > I hope it helps, > > Pablo > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --0000000000002e24dc05e6ebab33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

Thanks to Pablo and Aditya for t= he solutions. Sometimes it is very difficult to find the right manuals and = info for what you want to achieve for those of us new to ConTeXt. I found t= he stuff on context(context.noffigurepages) here (https://wiki.contextgarden.net/Image_Plac= ement) and I didn=E2=80=99t know the manual you linked to existed. I ha= ve also been searching for stuff about =E2=80=9Clow-level=E2=80=9D stuff in= ConTexT like the \doloopoverlist command.

I h= ope to contribute to the online wiki as I become a better user of ConTeXt.<= br>

On Tue, Aug 23, 2022 at 3:58 PM Pablo Rodriguez via ntg-context &l= t;ntg-context@ntg.nl> wrote:
On 8/22/22 17:46,= Jethro Djan via ntg-context wrote:
> Thanks for the solution Pablo. It works well.

Glad to read it worked for you, Jethro.

> I wanted to add more pdfs (which also has many pages) and found it
> was easier for me to reason in the lua side of things. This is what I<= br> > have at the moment:

I think this might be what you intend:

=C2=A0 \setuplayout[page]
=C2=A0 \starttext
=C2=A0 \doloopoverlist{ass1,ass2,ass3,ass4,ass5,ass6,ass7,ass8}
=C2=A0 =C2=A0 {\def\Doc{\recursestring.pdf}
=C2=A0 =C2=A0 =C2=A0\getfiguredimensions[\Doc]
=C2=A0 =C2=A0 =C2=A0\dorecurse{\noffigurepages}
=C2=A0 =C2=A0 =C2=A0{\externalfigure[\Doc]
=C2=A0 =C2=A0 =C2=A0 =C2=A0[page=3D\recurselevel, width=3D20cm, scale=3D950= ]}}
=C2=A0 \stoptext

> I didn=E2=80=99t know how to get an array (or indexed table or whateve= r you
> call it) in ConTeXt/Tex.

\doloopoverlist & \recursestring are your friends here.

> My problem is now with context(context.noffigurepages). Am I calling > it wrong? All I want to do is call \noffigurepages from the lua side.<= br> > Is there something I am missing?

The approach is totally different: "getnofpages"
(http://www.pragma-ade.= com/general/manuals/luametatex.pdf#search=3Dgetnofpages).

BTW, your code crashed my session, CPU goes to 100% and RAM usage too. I wonder how your sample could be compiled fine by your system.

I hope it helps,

Pablo
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / https://www.ntg.nl/mailman/listinfo/= ntg-context
webpage=C2=A0 : https://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 :
https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: https://contextgarden.net
___________________________________________________________________________= ________
--0000000000002e24dc05e6ebab33-- --===============3598577959949859246== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============3598577959949859246==--