页面左右边距的变化

页面左右边距的变化

为了写我的硕士论文,我使用了 overleaf。我希望奇数页码在右侧,而偶数页码应在页面左侧。但是,根据我的测量,页面似乎以某种方式发生了移动,页码一侧的边距较大。我不知道是什么原因造成的。提前致谢。

\documentclass[a4paper,twoside]{article}

%packages used listed here%
\usepackage{mathptmx}
\usepackage{abstract}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[paperheight=11.0in,
  left=1.5in,right=1.0in,top=1.0in,bottom=1.5in,
  includefoot,heightrounded]{geometry}
\usepackage{titling}
\usepackage[absolute]{textpos}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{titlesec}
\usepackage[labelfont=bf]{caption}
\usepackage{placeins}
\usepackage{mdframed}
\usepackage{xcolor}
\usepackage{url}
\usepackage{amsmath}
\usepackage{svg}
\usepackage{pdfpages}
\usepackage[super]{nth}

%page number on the right side
\usepackage{titleps}
\renewpagestyle{plain}{%
\sethead{}{}{}
\setfoot[\thepage][][]{}{}{\thepage}
}%
\pagestyle{plain}

%bibliography type
\bibliographystyle{plain}
%define abbreviations here
\usepackage[acronym,toc,nonumberlist]{glossaries}
\makeglossaries
\newacronym{lbs}{LBS}{Location Based System}
\newacronym{gps}{GPS}{Global Positioning System}
\newacronym{lbsn}{LBSN}{Location Based Social Network}
\newacronym{lbg}{LBG}{Location Based Gaming}
\newacronym{sms}{SMS}{Short Message Service}
\newacronym{gprs}{GPRS}{General Packet Radio Service}
\newacronym{wifi}{WIFI}{Wireless Fidelity}
\newacronym{e2ee}{E2EE}{End-to-end Encryption}
\newacronym{des}{DES}{Data Encryption Standart}
\newacronym{mms}{MMS}{Multimedia Messaging Service}
\newacronym{cspng}{CSPNG}{Cryptographically Secure Pseudorandom Number Generator}
\newacronym{kdf}{KDF}{Key Derivation Function}
\newacronym{aes}{AES}{Advanced Encryption Standart}
\newacronym{pbkdf2}{PBKDF2}{Password Based Key Derivation Function 2}
\newacronym{lan}{LAN}{Local Area Network}
\newacronym{ap}{AP}{Access Point}
\newacronym{mac}{MAC}{Media Access Control}
\newacronym{dos}{DOS}{Denial-of-Service}
\newacronym{prng}{PRNG}{Pseudo Random Number Generator}
\newacronym{sha}{SHA}{Secure Hash Algorithms}


%start modify section sizes
\titleformat*{\section}{\Huge\bfseries}
\titleformat*{\subsection}{\Large\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titleformat*{\paragraph}{\normalfont\normalsize}
\titlespacing*{\section} {0pt}{6ex plus 4ex minus .2ex}{3ex plus .3ex}
\titlespacing*{\subsection} {0pt}{2.25ex plus 1ex minus .2ex}{3ex plus .3ex}
\setlength\parindent{0.5cm}
\renewenvironment{abstract}{\subsection*{\center\abstractname}}{}

%modify textbox style
% all 4 borders
\newmdenv{allfour}
% just top and bottom
\newmdenv[leftline=false,rightline=false]{topbot}
% just left and bottom
\newmdenv[topline=false,rightline=false]{leftbot}
\newmdenv[
  topline=false,
  bottomline=false,
  rightline=false,
  skipabove=\topsep,
  skipbelow=\topsep,
  leftmargin=15pt,
  rightmargin=5pt,
  innertopmargin=0pt,
  innerbottommargin=0pt
]{leftbox}

%start cover information%
\setlength{\droptitle}{10em}
\title{Master Thesis}
\author{Eroglu, Ahmet}
\date{March 2019}
%finish cover information

% table of contents depth should be 2 for distributed systems department!
\setcounter{tocdepth}{2}

\begin{document}
\input{Chapters/cover_main.tex}
\input{Chapters/abstract.tex}
\input{Chapters/table_of_contents.tex}
\input{Chapters/chapter_introduction/introduction.tex}
\input{Chapters/chapter_related_work/related_work.tex}
\input{Chapters/chapter_designed_solution/designed_solution.tex}
\input{Chapters/chapter_evaluation/chapter_evaluation.tex}
\input{Chapters/chapter_improved_version/improved_version.tex}
\input{Chapters/chapter_future_work/future_work.tex}
\input{Chapters/appendix.tex}
\newpage
\bibliographystyle{plain}
\input{Chapters/abbreviations_page.tex}
\input{Chapters/acknowledgements.tex}
\bibliography{references}
\end{document}

在此处输入图片描述

答案1

嗯,通常硕士论文会使用类reportbook代替article(因为你需要\chapter{}给你的论文一个结构)......

尽管如此,请参见以下简化的代码:

\documentclass[a4paper,twoside]{article} % <============================ report??

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[%
  paperheight=11.0in,
% left=1.5in,right=1.0in,top=1.0in,bottom=1.5in,
  outer=1.5in,inner=1.0in,top=1.0in,bottom=1.5in, % <===================
  includefoot,heightrounded,
  showframe % <=========================================================
]{geometry}

\usepackage{blindtext} % <==============================================
\usepackage{xurl} % <=================================================== better url breaking
\usepackage[hidelinks]{hyperref} % <====================================

\begin{document}
\Blinddocument
\end{document}

要获得双面文档的正确布局,您需要使用选项outer=1.5in,inner=1.0in,而不是使用的leftright

请看以下结果:

生成的 pdf

选项showframegeometry用于可视化打字区域和边距...您可以看到较小的inner边距和较大的outer边距...请查看更改后的调用顺序:hyperref在您的情况下应该最后调用,并xurl为您在 URL 中提供更好的换行符...

相关内容