0

I have 2 separate documents. One compiled using texstudio, the other using overleaf. I am not sure why the spacing for the text in the paragraph is different. I believe I copied over the exact same settings and added a few more other lines.

I am trying to make the format for my current paper on overleaf (second image) look closer to the one on texstudio (first image). Below is the code I have for the paper on texstudio.

I tried changing the \linespace command from 1.5 to 1 to 1.25 but it still does not look alike. I hope someone can point out where I need to edit.

\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}

enter image description here

And here is the code for the paper that i have on overleaf.

\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}

enter image description here

4
  • The exact settings are not the same. What happens if it is the same. . Commented Jan 9, 2018 at 20:04
  • 1
    Well, one is using \onehalfspacing and the other with \linespread{1.5}, they don't give the same result. Can you use one or the other in both documents?
    – Troy
    Commented Jan 9, 2018 at 20:10
  • 1
    The documents are also quite different. I suggest you fix this first. Commented Jan 9, 2018 at 21:43
  • By the by: tabu cannot be recommended. In my opinion, it should be avoided at almost any cost.
    – cfr
    Commented Jan 10, 2018 at 0:49

0

You must log in to answer this question.

Browse other questions tagged .