[NTG-context] How to display the pages of a particular section in another PDF?

Hans Hagen j.hagen at freedom.nl
Mon Dec 5 18:30:08 CET 2022


On 12/5/2022 5:39 PM, Pablo Rodriguez via ntg-context wrote:
> On 12/5/22 13:13, Hans Hagen via ntg-context wrote:
>> On 12/4/2022 11:30 PM, Joel via ntg-context wrote:
>>> I can use this code to display page 5 from a PDF:
>>> [...]
>>> \externalfigure[filename.pdf][section=17A]
>>
>> prototype attached (first process crap, then load)
> 
> Hi Hans,
> 
> it would be great to have something like:
> 
>    \loadsection	[1] [2] [3]
> 
>    1	FILE
>    2	REFERENCE
>    3	inherits from \setupexternalfigure
> 
> Just in case it may be relevant to the discussion.
that is not flexible ... we're talking about a rather special 
application, so what I can add is a simple helper that returns the first 
and last page of a section

\dostepwiserecurse {\firstsectionpage[crap][chapter:3]} 
{\lastsectionpage[crap][chapter:3]} {1} {
     \startpagemakeup
         \externalfigure[crap.pdf][page=#1]
     \stoppagemakeup
}

\dostepwiserecurse {\firstsectionpage[crap][chapter:5]} 
{\lastsectionpage[crap][chapter:5]} {1} {
     \dontleavehmode
     \externalfigure[crap.pdf][page=#1,width=3cm,frame=on]%
     \space\allowbreak
}

keep in mind that it is also a biut fragile as one never know where the 
last one ends

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



More information about the ntg-context mailing list