0

The good:
When I use plain TeX, and then run dvips to get the Postscript output, I see negative page numbers for the front matter in the thumbnail pages on the left in evince and gv (ghostview), followed by positive page numbers starting at 1 after the front matter, although okular shows positive pages pages starting at 1 for the front matter, ignoring the negative page numbers of the front matter.

The bad:
When I convert the Postscript file to PDF using ps2pdf, all of my four PDF viewers show me the pages starting at 1 for the first physical page instead of using negative page numbers for the front matter. Then the numbering continues with a constant offset between the page number in the PDF thumbnails and the printed page number on each page.

What I would like is for the postscript-to-PDF conversion to produce a PDF file which shows pages -1 to -22 for the 22 pages of front matter, and then shows 1 for first page after the front matter. In other words, the thumbnails should show the page number which is printed on each page.

I've looked through the parameters for ps2pdf and dvips, but nothing there looks promising. I have heard that LaTeX users do get the right result, but I am using plain TeX.


PS. Here's a sample file which demonstrates the problem.
% test1.tex   2015-8-4   Alan U. Kennington.
% Demo of using \pageno to set negative page numbers, like normal plain TeX.
% Compile with tex, dvips and ps2pdf.

\pageno-1
Page minus 1.
\vfill\eject
Page minus 2.
\vfill\eject

\pageno1
Page plus 1.
\vfill\eject
Page plus 2.
\bye

The PDF viewers show pages i and ii as 1 and 2. Then they show pages 1 and 2 as 3 and 4. I would really like them to show i and ii as -1 and -2. Then they should show pages 1 and 2 as 1 and 2.

1 Answers1

1

The answer is here: plain xetex page labels.
And here's a minimal example in plain TeX.
(It's minimal if you ignore the fish.)

\pageno-1
Page minus 1.
\vfill\eject
Page minus 2.
\vfill\eject

\special{pdf: docview << /PageLabels << /Nums[0 <</S /r>> 2 <</S /D>>] >> >> }
\special{pdf: docinfo << /Author (Fred Fish) /Title (Fried Fish) >> }

\pageno1
Page plus 1.
\vfill\eject
Page plus 2.
\bye

If this is compiled with tex and dvipdfm, the resulting PDF file shows the page numbers "i" and "ii" for the first two pages, and "1" and "2" for the 3rd and 4th pages in evince, acroread and gv PDF viewers, although my copy of okular just shows pages 1 to 4.

Anyway, this shows that the required parameters are getting into the PDF file from plain TeX. Definitely dvips does not accept these \special commands.

Many thanks to Heiko Oberdiek for posting the answer on 2012-09-26.
And for posting the crucial link:
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf.


PS. 2015-8-5.
The 2013-8-13 answer by Heiko Oberdiek is comprehensive and detailed, much better than mine: How can I achieve having logical page numbers shown in acrobat reader? There it is shown how to use dvips with a raw postscript \special instead of dvipdfm with the PDF \special. I have verified that the raw postscript method works as advertised for plain TeX with dvips and ps2pdf.