包含的 PDF 頁面弄亂了 PDF 閱讀器中的頁碼

包含的 PDF 頁面弄亂了 PDF 閱讀器中的頁碼

我有一份包含首頁、摘要、前言和致謝的報告。這些頁面沒有編號。然後剩餘的頁麵包含幾個章節,並且所有這些頁面都已編號。然而今天我在首頁和摘要之間添加了兩個 PDF 資訊頁。這搞亂了頁碼!在紙上一切都還好,因為數字沒有印在這些頁面上,但是當我使用 PDF 閱讀器以數位方式查看文件時,頁碼從第一個包含的 PDF 頁面開始,下一個包含的 PDF 頁面是第2 頁。

像這樣:

[code]
Frontpage = {page 1}
[Included PDF1] = Page 2
[Included PDF2] = Page 3
Abstract = Page 1
Preface = Page 1
Acknowledgement = Page 2
TOC = Page 3
[/code]

目錄之前的所有頁面過去都是未編號的,但現在它們的頁碼值顯然是錯誤的。我很確定 \pdfinclude 指令是負責的。我希望編號從“確認”或“目錄”頁面開始,並繼續而不重置計數器。過去就是這樣,但包含的 PDF 頁面以某種方式弄亂了編號,並強制未編號的頁面具有頁碼 1。

如何將其恢復為正常頁碼,例如:

[code]
Frontpage = {no page number}
[Included PDF1] = {no page number}
[Included PDF2] = {no page number}
Abstract = Page {no page number}
Preface = Page 1
Acknowledgement = Page 2
TOC = Page 3
[/code]

一個簡約的程式碼範例:

[code]
\documentclass[12pt]{report}

\usepackage{hyperref}
\usepackage{pdfpages}

\begin{document}

\input{./texfrontpage.tex}

\includepdf[pages={1,2}]{./pdf/information-page-one.pdf, ./pdf/information-page-two.pdf}

\begin{abstract}
  Interesting stuff.
\end{abstract}

\chapter*{Preface}
\addcontentsline{toc}{section}{Preface}

\chapter*{Acknowledgement}
\addcontentsline{toc}{section}{Acknowledgement}

\tableofcontents

\chapter{Introduction}

\chapter{Background}

\chapter{Results}

\chapter{Conclusion}

\end{document}
[/code]

澄清一下:我不想包含兩個 PDF 檔案的頁碼,也不想重置頁碼。我希望頁碼從致謝頁的前言開始計數。這應該是第一個真實的頁碼為 1 的頁面。

答案1

這是一個解決方案。與\pagenumbering{gobble}\pagenumbering{arabic}

\documentclass[12pt]{report}

\usepackage{hyperref}
\usepackage{pdfpages}

\begin{document}
\pagenumbering{gobble}

\input{./texfrontpage.tex}

\includepdf[pages={1,2}]{./pdf/information-page-one.pdf, ./pdf/information-page-two.pdf}

\begin{abstract}
  Interesting stuff.
\end{abstract}

\pagenumbering{arabic}
\chapter*{Preface}
\addcontentsline{toc}{section}{Preface}

\chapter*{Acknowledgement}
\addcontentsline{toc}{section}{Acknowledgement}

\tableofcontents

\chapter{Introduction}

\chapter{Background}

\chapter{Results}

\chapter{Conclusion}

\end{document}

相關內容