PDF 查看器中的页码编号有三种不同的页码样式

PDF 查看器中的页码编号有三种不同的页码样式

我使用三种页码样式,即 Alpha、Roman 和 Arabian。我希望我的 pdf 查看器也能显示它们,并在我输入“1”时跳转到第一个阿拉伯数字页,而不是文档的第一页。我找到了这个帖子PDF 查看器中的不同页面标签/编号 很好地解释了两种风格(阿拉伯文和罗马文)是如何实现的

但是对于三个人来说该怎么办呢?

一个工作示例

\documentclass[
a4paper,        % A4 Papier ist Pflicht am Fachgebiet
twoside,        % Empfehlung des Fachgebietes
openright,  % Empfehlung des Fachgebietes
12pt,               % mindestens 9pt
BCOR=1cm,      % Bindungskorrektur -> sollte an die eigenen Ansprüche entsprechend angepasst werden
DIV=10         % Seitenaufteilung: 10 ist Standard für 11pt Schrift. Vor Änderung am besten passende Literatur zu scrreport lesen.
]{scrreprt}


\usepackage{amsmath}
\usepackage[english,ngerman]{babel} 
\usepackage[OT1]{fontenc}  
\usepackage[utf8]{inputenc} 

\begin{document}
% % % % % % % % % % % % % % % % % % % %
% Gleichungen in der Form Chapter.equation
\numberwithin{equation}{chapter}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
% Die ersten Seiten bekommen keine Kopf- und Fußzeile.
\pagestyle{empty} 
%\pdfcatalog{%
%  /PageLabels<<%
%    /Nums[%
%      % Page numbers are zero based.
%      % Uppercase roman numbers starting with first page.
%      A<</S/R>>%
%      % Arabic numbers starting with current page.
%      \the\numexpr\value{page}-1\relax<</S/D>>%
%    ]%
%  >>%
%}
\pagenumbering{Alph}


%% Eidesstattliche Versicherung %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{formaler_Inhalt/selbststaendigkeitsErklaerung}
\cleardoublepage

%% Inhaltsverzeichnis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{Roman}
\tableofcontents %Table of contents
\cleardoublepage

%% Abbildungsverzeichnis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\addcontentsline{toc}{chapter}{Abbildungsverzeichnis} % Abbildungsverzeichnis ins Inhaltsverzeichnis schreiben
\listoffigures


%% INHALT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\pagestyle{headings}
\pdfcatalog{%
  /PageLabels<<%
    /Nums[%
      % Page numbers are zero based.
      % Uppercase roman numbers starting with first page.
      0<</S/R>>%
      % Arabic numbers starting with current page.
      \the\numexpr\value{page}-1\relax<</S/D>>%
    ]%
  >>%
}
\pagenumbering{arabic}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\chapter{Kant sagt}
Sapere aude 
\newpage
Sapere aude


%% LITERATURVERZEICHNIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\cleardoublepage
\addcontentsline{toc}{chapter}{Literaturverzeichnis} % Literaturverzeichnis ins Inhaltsverzeichnis schreiben

\end{document}

答案1

hyperref您为我指出了我在文档中使用到的正确方向,但pdfpagelabels=false应该放在哪里呢true:)

答案2

它也完全没有hyperref。您首先必须\newcounter在序言中声明 。然后,您无需在第一次编号更改时设置 PDF 页面标签,而是设置计数器。

然后,在第二次编号更改时设置 PDF 页面标签,并使用计数器的值作为第二个条目的开始。

\documentclass{report}

\pagenumbering{Alph}
\newcounter{lastAlphpage}

\begin{document}

\chapter{chap1}

Bla bla bla

\clearpage
% Set your counter at the space between \clearpage and \pagenumbering
\setcounter{lastAlphpage}{\value{page}}
\pagenumbering{Roman}

\chapter{chap2}
bla bla bla    
\clearpage
% Using Heiko Oberdiek's solution from the other thread:
% Best place at the start of the Arabic numbered pages
% after \cleardoublepage and before the page number is
% reset in \pagenumbering{arabic}.
\pdfcatalog{%
    /PageLabels<<%
    /Nums[%
    % Page numbers are zero based.
    % Alphabetic numbers starting with first page.
    0<</S/A>>%
    % Roman numbers starting with the page saved in the counter.
    \the\numexpr\value{lastAlphpage}-1\relax<</S/R>>%
    % Arabic numbers starting with current page. 
    % Don't forget to add the counter. \value{page} contains the 
    % current "roman" page number. You have to subtract two because 
    % each of the values include one page "too much".
    \the\numexpr(\value{lastAlphpage}+\value{page})-2\relax<</S/D>>%
    ]%
    >>%
}
\pagenumbering{arabic}

\chapter{chap3}
bla bla bla

\end{document}

(这用这个答案作者:Heiko Oberdiek)

相关内容