[NTG-context] How to display the pages of a particular section in another PDF?
Henning Hraban Ramm
texml at fiee.net
Mon Dec 5 11:03:35 CET 2022
Am 04.12.22 um 23:30 schrieb Joel via ntg-context:
> I can use this code to display page 5 from a PDF:
>
> \externalfigure[filename.pdf][page=5]
>
> I am making a teacher's guide for a workbook (workbook.pdf). I need to
> be able to display on the page all pages of a particular section.
>
> The teacher's guide uses the same section titles as the workbook, e.g.:
>
> 17-A: Title
> 17-B: Title
>
> In other words, there is 1:1 pairing of section titles in the teacher's
> guide and the workbook.
>
> Is there any way to tell ConTeXt to display all of the pages for a
> particular section?
>
> \externalfigure[filename.pdf][section=17A]
Use a loop in Lua or TeX:
https://wiki.contextgarden.net/System_Macros/Loops_and_Recursion
\dostepwiserecurse {5} {17} {1}
{\externalfigure[filename.pdf][page=\recurselevel]}
or
\startluacode
for s=5, 17 do
context.externalfigure({"filename.pdf"},{page=s})
end
\stopluacode
(untested)
Hraban
More information about the ntg-context
mailing list