我有 2 个单独的文档。一个使用 texstudio 编译,另一个使用 overleaf。我不确定为什么段落中的文本间距不同。我相信我复制了完全相同的设置并添加了其他几行。
我正在尝试使 overleaf 上当前论文的格式(第二张图片)看起来更接近 texstudio 上的格式(第一张图片)。下面是我在 texstudio 上论文的代码。
我尝试将 \linespace 命令从 1.5 改为 1 再改为 1.25,但看起来仍然不一样。我希望有人能指出我需要编辑的地方。
\documentclass[pdftex,12pt,a4paper]{report}
\usepackage{titlesec}
%\titleformat{\chapter}{\bfseries\huge}{\thechapter.}{20pt}{\huge}
\usepackage[top=3cm, bottom=3cm, left=3cm, right=3cm]{geometry}
% graphics images
\usepackage[pdftex]{graphicx}
\usepackage[toc,page]{appendix}
\usepackage{slashbox}
% 1.5 line spacing
\usepackage{setspace}
\usepackage{tabu}
\usepackage{tabularx}
\onehalfspacing
% maths symbols
\usepackage{amsmath}
%\usepackage[math-style = upright]{unicode-math}
% table package
\usepackage{multirow}
% citation style
\usepackage[colorlinks=false]{hyperref}
\makeatletter
\let\Hy@linktoc\Hy@linktoc@none
\makeatother
\usepackage[square,sort,comma,numbers]{natbib}
\usepackage{amsfonts}
%\renewcommand{\chaptername}{}
\usepackage{tikz,colortbl}
\usetikzlibrary{calc}
\usepackage{zref-savepos}
\usepackage[bf,small,tableposition=top]{caption}
\usepackage{subfig}
\usepackage{float}
\usepackage{url}
\usepackage{pdfpages}
\begin{document}
% cover
%\input{cover_report.tex}
\includepdf[pages=1]{CoverPage}
% abstract
\setcounter{page}{1}
\pagenumbering{roman}
\input{abstract.tex}
% acknowledgement
\input{acknowledgements.tex}
% table of content
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{intro.tex}
\input{literature.tex}
\input{objectdetection.tex}
\input{objecttracking.tex}
\input{multicameraanalysis.tex}
\input{results.tex}
\input{conclusion.tex}
%\input{conclusion.tex}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
% references
\bibliographystyle{unsrtnat}
\bibliography{fyp}
\end{document}
这是我在背面所写的论文的代码。
\documentclass[12pt,a4paper]{report}
\usepackage{titlesec}
\usepackage[toc]{appendix}
\titleformat{\chapter}[display] {\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\Huge}
\usepackage[english]{babel}
\usepackage{pdfpages}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{subfig}
\usepackage{float}
\usepackage{booktabs}
\linespread{1.5}
\usepackage[a4paper,top=3cm,bottom=3cm,left=3cm,right=3cm]{geometry}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{xcolor}
\usepackage{tocbibind}
\usepackage{xpatch}
\usepackage{hyperref}
\hypersetup{
colorlinks=false,
urlbordercolor=red
}
\makeatletter
%\xpatchcmd{\titlepage}{\thispagestyle{empty}}{\pagestyle{plain}}{}{}
\xpatchcmd{\endtitlepage}{\setcounter{page}\@ne}{\cleardoublepage}{}{}% Remove the reset of page at the end of titlepage
\makeatletter
\newcommand\frontmatter{%
\cleardoublepage
% \@mainmatterfalse
\pagenumbering{roman}
}
\newcommand\mainmatter{%
\cleardoublepage
% \@mainmattertrue
\pagenumbering{arabic}
}
\newcommand\backmatter{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
% \@mainmatterfalse
}
\makeatother
\title{Your Paper}
\author{You}
\begin{document}
\end{document}