Changes

Jump to navigation Jump to search
Added section on Page Numbering
</texcode>
to insert the first 30 pages scaled down to 95%.
 
== Page numbering with \startpagefigure ==
 
Experience shows that when you include a page from a PDF file using <code>\startpagefigure</code>, the page number of your document is not increased. The included PDF page is completely excluded from the page numbering process. This is annoying if you include a PDF page in the middle of your document, and expect your page numbers to be correct after the PDF page.
 
One solution is to use the commands <code>\insertpages</code>, <code>\filterpages</code>, and <code>\copypages</code>. They correctly increment the page numbers. But those commands include the PDF pages like additional "layers" on your page, so it means that your headers, footers, crop marks, etc. will be printed on top of or behind the included PDF pages.
 
Another solution is to fix the page number manually after using <code>\startpagefigure</code>.
 
Let's say we include 3 pages from a PDF like this:
<texcode>
% Several pages of text here
\startpagefigure[include_this.pdf][page=4]\stoppagefigure
\startpagefigure[include_this.pdf][page=6]\stoppagefigure
\startpagefigure[include_this.pdf][page=11]\stoppagefigure
% Several pages of text here
</texcode>
Notice that <code>\startpagefigure</code> can include only 1 page at a time. After compiling the above file with ConTeXt, your page numbers will look like this:
<texcode>
...
Page 10
Page 11
Page 12
include_this.pdf page 4
include_this.pdf page 6
include_this.pdf page 11
Page 13
Page 14
...
</texcode>
This behavior is also reflected in the command line output of ConTeXt. The value of <code>userpage</code> is the page number which will be printed in your header/footer. Continuing the above example:
<texcode>
pages > flushing realpage 12, userpage 10
pages > flushing realpage 13, userpage 11
pages > flushing realpage 14, userpage 12
&lt;include_this.pdf&gt;
pages > flushing realpage 15, userpage 13 <-- include_this.pdf page 4
pages > flushing realpage 16, userpage 13 <-- include_this.pdf page 6
pages > flushing realpage 17, userpage 13 <-- include_this.pdf page 11
pages > flushing realpage 18, userpage 13 <-- First ConTeXt page after PDF pages
pages > flushing realpage 19, userpage 14
</texcode>
Therefore, you must "fix" your page number after you finish including PDF pages. You can either set it to a fixed number by saying:
 
<texcode>
% Several pages of text here
\startpagefigure[include_this.pdf][page=4]\stoppagefigure
\startpagefigure[include_this.pdf][page=6]\stoppagefigure
\startpagefigure[include_this.pdf][page=11]\stoppagefigure
\setcounter [userpage] [16]
% Several pages of text here
</texcode>
 
Or, which is even better, increment the page number by the number of included PDF pages:
<texcode>
% Several pages of text here
\startpagefigure[include_this.pdf][page=4]\stoppagefigure
\startpagefigure[include_this.pdf][page=6]\stoppagefigure
\startpagefigure[include_this.pdf][page=11]\stoppagefigure
\setcounter [userpage] [\pagenumber+3]
% Several pages of text here
</texcode>
 
This way your command line output will be:
<texcode>
pages > flushing realpage 12, userpage 10
pages > flushing realpage 13, userpage 11
pages > flushing realpage 14, userpage 12
<include_this.pdf>
pages > flushing realpage 15, userpage 13 <-- include_this.pdf page 4
pages > flushing realpage 16, userpage 13 <-- include_this.pdf page 6
pages > flushing realpage 17, userpage 13 <-- include_this.pdf page 11
pages > flushing realpage 18, userpage 16 <-- First ConTeXt page after PDF pages
pages > flushing realpage 19, userpage 17
</texcode>
 
This <code>\setcounter</code> command was tested and worked correctly with
<code>ConTeXt ver: 2013.10.01 20:08 MKIV beta</code>.
== Printing Slides from a presentation ==
11

edits

Navigation menu