Conversion Tools ⇒ ps2pdf page numbering problem
ps2pdf page numbering problem
Has anyone here ever seen a problem where ps2pdf will create a PDF where the page numbers in the document itself are fine, but in any PDF reader the page numbers are all roman numerals in the page navigation menu? I've attached a pic of what I mean. This is in Acrobat Reader, but the same happens in Evince. Notice the roman numeral lxix instead of 69 in the textfield:
I normally use dvips and ps2pdf to convert my LaTeX files to PDF, and this has worked fine for me in Fedora 7. But when I upgraded to Fedora 11 this problem suddenly appeared. And the weird thing is it only happens some of the time. The postscript files created by dvips show the page numbers correctly in any postscript viewer, so I think ps2pdf (part of ghostscript) is the culprit. F7 uses ghostscript 8.15 and F11 uses ghostscript 8.70.
I normally use dvips and ps2pdf to convert my LaTeX files to PDF, and this has worked fine for me in Fedora 7. But when I upgraded to Fedora 11 this problem suddenly appeared. And the weird thing is it only happens some of the time. The postscript files created by dvips show the page numbers correctly in any postscript viewer, so I think ps2pdf (part of ghostscript) is the culprit. F7 uses ghostscript 8.15 and F11 uses ghostscript 8.70.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
ps2pdf page numbering problem
It could be helpful to have a minimal working example (MWE) at hand that reproduces this behaviour. You can generate longer parts of text (and even whole documents) by means of the blindtext package.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
ps2pdf page numbering problem
OK, here's a minimal working example:
Here's the weird part: it works fine the first time I run latex -> dvips -> ps2pdf. But if I comment out lines 3 and 17 (\usepackage{fancybox} and \thisfancypage...) and run it again, the problem appears! So my guess is that there is some kind of weird caching issue going on. I know that some temporary files get created by latex, but how would that affect the PDF created by ps2pdf?
This problem happens no matter what I do on a book I wrote. It has lots of files and graphics, and requires multiple runs to get all the references right. So I'm not sure how I'd handle any kind of cache issues with that. Any help would be appreciated.
Code: Select all
\documentclass[letterpaper,11pt,titlepage,openany,twoside]{scrbook}
\usepackage[english]{babel}
\usepackage{fancybox}
\usepackage[T1]{fontenc}
\usepackage{newcent}
\usepackage{textcomp}
\usepackage[dvips,bookmarks]{hyperref}
\usepackage[toc,math]{blindtext}
\setlength\oddsidemargin{20pt}
\setlength\evensidemargin{20pt}
\setlength\topmargin{0pt}
\makeatletter
\makeatother
\begin{document}
\frontmatter
\pagestyle{empty}
\thisfancypage{\setlength{\fboxsep}{1pt}\setlength\fboxrule{1.5pt}\fbox}{}
\title{Something}
\author{\textsf{\textbf{Shad Grind}}}
\uppertitleback{Some stuff.}
\lowertitleback{No copyright.}
\maketitle
\mainmatter
\Blinddocument
\end{document}
This problem happens no matter what I do on a book I wrote. It has lots of files and graphics, and requires multiple runs to get all the references right. So I'm not sure how I'd handle any kind of cache issues with that. Any help would be appreciated.
- Stefan Kottwitz
- Site Admin
- Posts: 10319
- Joined: Mon Mar 10, 2008 9:44 pm
Re: ps2pdf page numbering problem
I've tested this example, using dvips and ps2pdf and the Acrobat Reader. The first two pages were numbered i, ii and it was numbered 1, 2, ... afterwards.
Do you get all numbers in roman?
Stefan
Do you get all numbers in roman?
Stefan
LaTeX.org admin
Re: ps2pdf page numbering problem
Yes, I get all numbers in Roman in the page navigation toolbar in Acrobat Reader (and Evince). The numbers on the pages themselves are correct. Did you try commenting out those lines I mentioned? Also, which version of ghostscript are you using? This problem only happens for me with the ps2pdf from ghostscript 8.70; it works properly with version 8.15.
Re: ps2pdf page numbering problem
I am also using ghostscript 8.70 on Fedora 11 and get the same behaviour with and without the commented lines, once I run latex a few times to get the internal references correct i.e.
without commented lines i,ii,iii
with commented lines i,ii,1,2
I'm afraid I don't have any solutions. I am just posting to show that the behaviour can be replicated, in case you were starting to think it was your computer/version of latex.
without commented lines i,ii,iii
with commented lines i,ii,1,2
I'm afraid I don't have any solutions. I am just posting to show that the behaviour can be replicated, in case you were starting to think it was your computer/version of latex.
ps2pdf page numbering problem
OK, I submitted a bug report to the ghostscript developers, and found out something very interesting. It turns out that the postscript file being created by dvips contains a request to label the page numbers with roman numerals. See the last comment here, and the last attachment. Making the change to the line in the postscript file indicated in the diff file does indeed change the page labels in Acrobat Reader after running ps2pdf.
So this is a problem with dvips. Basically, it was ignored in earlier versions of ghostscript, but with version 8.70 it is no longer ignored. So the question is, why is dvips generating roman numeral page labels after the table of contents? This is the dvips that comes with TexLive 2007.
So this is a problem with dvips. Basically, it was ignored in earlier versions of ghostscript, but with version 8.70 it is no longer ignored. So the question is, why is dvips generating roman numeral page labels after the table of contents? This is the dvips that comes with TexLive 2007.