在编译LaTeX文档时,我得到两页,编号为“ 1”:首页和目录的第一页。这是MWE:
\documentclass[12pt,a4paper]{report}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\title{Title}
\begin{document}
\maketitle
\tableofcontents
\chapter{Chapter one}
\end{document}
在编译时(仅使用pdflatex file.tex
),我得到了:
但是,当我删除行\usepackage{hyperref}
时,页码就可以了。请注意,我需要此软件包在目录中具有指向页面的链接,但是也许有更好的方法。这是怎么回事?如何获得正常的页码?
谢谢。
答案 0 :(得分:3)
report
class下的 while True:
d1a = raw_input ("Which do you inspect:\na) The back door?\nb) The basement?\n")
# check if d1 is equal to one of the strings, specified in the list
if d1a in ['a', 'b']:
# if it was equal - break from the while loop
break
# process the input
if d1a == "a":
print ("You approach the door.\n\
'Who's out there?'\n\
No one answers.\n\
You start to creep back into the kitchen but then there's tapping on the window.\n\
'Who's there? I'm warning you!'")
while True:
d2a = raw_input ("What do you do:\na) Run outside to see who's there?\n\
b) Run back to your bedroom and hide underneath your bed?\n")
if d2a in ['a', 'b']:
break
if d2a == "a":
print ("You run out the door with a knife from the kitchen.\n\
You swing your head back and forth but see no one outside.")
elif d2a == "b":
print ("You run up the stairs.\n\
There is a feeling of someone's hand on your back.\n\
It makes you run faster, not looking back.")
elif d1a == "b":
print ("You approach the basement.\n\
You go to turn on the light but it's flicking.\n\
You walk down the stairs. It's dim.\n\
You trip!\n\
'Ugh...'\n\
There's rustling under on the couch but you can't see what's on it.")
while True:
d2b = raw_input ("What do you do:\na) Flash your flashlight on the couch?\n\
b) Ignore it and head back upstairs?")
if d2b in ['a', 'b']:
break
在标题页上将页码设置为\maketitle
,但在下一页也将其从1重新启动。这就是为什么您为标题获得虚拟页码1,然后为ToC获得 actual 页码1的原因。我在这里强调 virtual ,因为1
在\maketitle
页面样式上设置标题,以便在页眉/页脚中不打印任何内容。但是,在Adobe Acrobat中查看时,这些页码仍显示在工具栏中。
一种解决方法是手动将页面显示更改为更适合标题页面的显示。例如,让标题页命名为empty
:
T