我在使用 hyperref 包时遇到了一些问题。当我添加它时,我的所有文档都会向右滑动,所有内容都会被边框页面切开。图中是我的问题的示例
这里是 MWE:
\documentclass[11pt,a4paper,twoside,openright]{report}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[caption=false]{subfig}
\usepackage{afterpage}
\usepackage{booktabs}
\usepackage{color}
\usepackage{colortbl}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
\usepackage{amsmath,amssymb}
\usepackage{enumerate}
\usepackage{rotating}
\usepackage{fancyhdr}
\usepackage[scriptsize]{caption}
\setlength{\paperwidth}{16cm}
\setlength{\paperheight}{24cm}
\setlength{\oddsidemargin} {2. cm}
\setlength{\evensidemargin} {2. cm}
\addtolength{\oddsidemargin} {-0.4 cm}
\addtolength{\evensidemargin} {-0.4 cm}
\linespread{1.1}
\usepackage[latin1]{inputenc}
\renewcommand{\captionfont}{\normalfont \sffamily \itshape \small}
\newcommand{\p}{\partial}
\newcommand{\vect}[1]{\bold {#1} }
\newcommand{\aver}[1]{\left\langle {#1} \right\rangle}
\pagestyle{empty}
\begin{document}
\include{frontespizio}
\thispagestyle{empty} \normalfont \cleardoublepage
\include{dedica}
\thispagestyle{empty} \cleardoublepage
\pagenumbering{Roman}
\include{sommario}
\thispagestyle{empty} \vspace*{.75truecm} \cleardoublepage
\include{ringraziamenti}
\thispagestyle{empty} \vspace*{.75truecm} \normalfont \cleardoublepage
\pagestyle{plain}\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[RE]{\bfseries\leftmark}
\fancyhead[LO]{\bfseries\rightmark}
\renewcommand{\headrulewidth}{0.3pt}
\pagenumbering{arabic}
\tableofcontents
\listoffigures
\begingroup
\let\clearpage\relax
\listoftables
\endgroup
\include{capitolo1}
\include{capitolo2}
\include{capitolo3}
\include{capitolo4}
\include{capitolo5}
\include{capitolo6}
\include{capitolo7}
\cleardoublepage
% ---- Bibliography ----
\addcontentsline{toc}{chapter}{Bibliografia}
\bibliographystyle{unsrt}
\bibliography{mq}
%\nocite{*}
\appendix
\pagestyle{fancy}
\fancyfoot{}
\renewcommand{\chaptermark}[1]{\markboth{\appendixname\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[RE]{\bfseries\leftmark}
\fancyhead[LO]{\bfseries\rightmark}
\renewcommand{\headrulewidth}{0.3pt}
\include{appendiceA}
\include{appendiceB}
\include{appendiceC}
\include{appendiceD}
\include{appendiceE}
\include{appendiceF}
\end{document}
有什么建议吗?
谢谢你的帮助,Yella
答案1
您观察到的错误似乎是由于graphicx
和setlength{\paperwidth}
/的组合造成的\setlength{\paperheight}
。
我建议不要使用这些命令,而是使用geometry
如以下示例所示的包:
\documentclass[11pt,a4paper,twoside,openright]{report}
\usepackage{graphicx}
\linespread{1.1}
\usepackage[textwidth=16cm,textheight=24cm]{geometry} % <---- (1)
%\usepackage[paperwidth=16cm,paperheight=24cm]{geometry}% <---- (2)
\usepackage[latin1]{inputenc}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
上述示例使用 A4 尺寸的纸张,并将文本块的宽度和高度分别设置为 16 和 24 厘米。替代行(当前已注释掉,标记为 <---- (2))将实际纸张的尺寸更改为 16 厘米 x 24 厘米。