What would be the best way to include sample LaTeX output, in the form of (reduced) whole pages, into another document that discusses its typesetting?
I am thinking of creating one ("example") document with all the examples, and tagging each one with \label; in the main document, I would fetch the labels with the help of the xr package and include the appropriate page range with pdfpages. A first problem: I can expect to know the number of pages to include for each example, but how can I tell pdfpages to include from \pageref{exampleA} to \pageref{exampleA}+1? (Presumably there's some package that can calculate \pageref{exampleA}+1 in a form that I can pass to pdfpages. But which one?)
So far so good. This has the advantage that it's easy for the example document to use a different style than the documentation; but I need to manually ensure that the examples are generated with the same code that I describe in the main document. This is not essential, but could be handy. Perhaps I could also include latex code from the example document into the main document by somehow retrieving and line ranges (how?) and passing them to \lstinputlisting of the listings package), but I'd expect that to be more trouble than it's worth.
Can anyone recommend a better workflow? Are there better-suited packages that I am unaware of?
To summarize: I'm interested in the best way to show whole pages as sample output in a document that discusses its typesetting. Including PDF pages from another document, and including source lines from another TeX file, are possible approaches but not necessarily the best ones: I'm open to alternatives.

\includegraphics(and a ton of pdf files) instead ofpdfpages? The latter is clearly designed for managing all of the generated pages, whether one-up or n-up, so maybe I won't be able to use it for this? (I could try to get it to work, I know, but I don't want to waste a lot of time barking up the wrong tree.) – alexis Apr 21 '14 at 13:08\includegraphics[page=2]{filename}is a valid syntax, which will alleviate the need for you to split the target file into subfiles. – Steven B. Segletes Apr 21 '14 at 18:39pgfpages? This way you can keep everything in one file (I think). – cfr Apr 21 '14 at 19:35\includegraphicscan also keep everything in one file, it turned out, butpgfpagesmight have other advantages.) – alexis Apr 23 '14 at 18:56\includegraphicsneeds two as far as I know - one for the stuff-to-be-included and one for the stuff-to-do-the-including.pgfpagesreally does need only one. Whether this is advantageous or not probably depends on the details of your workfolow ;). – cfr Apr 23 '14 at 21:41pgfpagesdocumentation with this in mind. – alexis Apr 24 '14 at 07:37