ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Henning Hraban Ramm <texml@fiee.net>
Subject: Re: How to display the pages of a particular section in another PDF?
Date: Mon, 5 Dec 2022 11:03:35 +0100	[thread overview]
Message-ID: <d3f6faa7-d8fc-f044-0824-c71868c866b2@fiee.net> (raw)
In-Reply-To: <1550657480.592642.1670193056410@mail.yahoo.com>

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

  parent reply	other threads:[~2022-12-05 10:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1550657480.592642.1670193056410.ref@mail.yahoo.com>
2022-12-04 22:30 ` Joel via ntg-context
2022-12-05  9:42   ` Denis Maier via ntg-context
2022-12-05 10:03   ` Henning Hraban Ramm via ntg-context [this message]
2022-12-05 12:13   ` Hans Hagen via ntg-context
2022-12-05 16:39     ` Pablo Rodriguez via ntg-context
2022-12-05 17:30       ` Hans Hagen via ntg-context
2022-12-05 18:23         ` Pablo Rodriguez via ntg-context
2022-12-05 20:22           ` Hans Hagen via ntg-context
2022-12-06  0:39     ` Joel via ntg-context
2022-12-06  8:05       ` Hans Hagen via ntg-context
2022-12-06 17:33         ` Pablo Rodriguez via ntg-context
2022-12-06 19:02           ` Hans Hagen via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3f6faa7-d8fc-f044-0824-c71868c866b2@fiee.net \
    --to=ntg-context@ntg.nl \
    --cc=texml@fiee.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).