3

I'm writing my Ph.D. thesis and I'm using a format that a colleague of mine gave me. I noticed a strange situation: there are all around blocks of text that I separate with \\ only. Anyway, on pdf output, I get that some newline are larger than others.

For example, this one has a normal newline:

...individuals' satisfaction degree. \\

A pioneering and well-known model depicting such situation...

while this other one has a very large newline (wrong or unwanted behavior):

...even though they have been conceived in different ways.\\

Even though there is a plenty of works studying ...

These two newlines are defined in the same ways. The code you see is exactly a copy-and-paste from my tex. I don't know where to start in order to understand what I'm doing wrongly.

Addition 1 Hereafter you find the master tex file:

\documentclass[12pt,makeidx]{phdthesis}

\usepackage{a4wide}
\usepackage{appendix}
\usepackage{cite}

\usepackage{avant}

\usepackage{makeidx}  
\makeindex


\usepackage[english]{babel}
\usepackage{fancyheadings}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amstext}
\usepackage{amsmath}    
\usepackage{graphicx}   
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{enumitem}



%%% General page formatting %%%%
\addtolength{\textwidth}{-0.6in} %-0.6
\addtolength{\evensidemargin}{0.3in} %0.3
\addtolength{\oddsidemargin}{0.3in} %0.3

%\addtolength{\topmargin}{1.00in}
%\addtolength{\textheight}{2.00in}

\renewcommand{\textfraction}{0.01}
\renewcommand{\topfraction}{0.99}
\renewcommand{\floatpagefraction}{0.99}
\renewcommand{\bottomfraction}{0.99}
\renewcommand{\baselinestretch}{1.2} 


\newcommand{\Complex}{\mathbb{C}}
\newcommand{\Real}{\mathbb{R}}
\newcommand{\Integer}{\mathbb{Z}}
\newcommand{\Natural}{\mathbb{N}}
\newcommand{\Endproof}{$\hfill\square$}
\newcommand{\needcite}{{\color{red}[\textbf{Citation needed}]}}
\newcommand{\bs}[1]{\boldsymbol{#1}}
\newcommand{\todo}[1]{{\color{red}[\textbf{TODO: }#1]}}
\newcommand{\edited}{\color{MidnightBlue}}


\newtheorem{Theorem}{Theorem}
\newtheorem{Corollary}{Corollary}

\begin{document}
\pagestyle{fancyplain}
\pagenumbering{roman}


%% create the table of contents
\cleardoublepage
\lhead[]{\fancyplain{}{\rightmark}}
\chead[\fancyplain{}{}]{\fancyplain{}{}}
\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{}}
%\rhead[\fancyplain{}{}]{\fancyplain{}{}}
%\lhead[\fancyplain{}{}]{\fancyplain{}{}}
\begin{center}
{\huge My thesis}
\end{center}

\tableofcontents
\include{src/lop} % list of publications of author
\cleardoublepage

\newcommand{\publ}{}

\pagestyle{fancyplain}
%\setlength{\headrulewidth}{0.3pt}
%\setlength{\footrulewidth}{0.0pt}
%\setlength{\plainfootrulewidth}{0.0pt}
%\setlength{\plainheadrulewidth}{0pt}
\renewcommand{\sectionmark}[1]{\markright{\it \thesection.\ #1}}
\renewcommand{\chaptermark}[1]{\markboth{\it \thechapter.\ #1}{}}
\lhead[\thepage]{\fancyplain{\publ}{\rightmark}}
\chead[\fancyplain{}{}]{\fancyplain{}{}}
\rhead[\fancyplain{}{\leftmark}]{\fancyplain{}{\thepage}}
\lfoot[]{} \cfoot[]{} \rfoot[]{}
%------------------------------


\include{src/intro}
\include{src/game/game}
%\include{src/eeg} 
%\include{src/bio/bio} 


%% Include the bibliography
%\renewcommand{\publ}{}
\cleardoublepage
\small
\addcontentsline{toc}{chapter}{Bibliografy}
%\bibliography{Biblio_PhDThesis}
\include{src/biblio}

%% Include the index
\cleardoublepage
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}
  • In general you don't need to keep using \\ all the time. The extra spacing may be caused by TeX stretching spaces to keep the pages even, but without a MWE it's hard to tell. Can you please provide a complete-but-minimal example that shows the behaviour? – Thruston Mar 29 '15 at 18:55
  • 5
    Do not use \\ to end a paragraph. That is not its purpose. If you are referring to "blank" vertical space between paragraphs, there are a number of reasons why this might occur and there are ways to solve it. But it is impossible to do so reliably before you give us some complete, but minimal code that demonstrates the problem. – jon Mar 29 '15 at 18:56
  • 2
    Thanks for posting your file, but the trouble is that none of us can compile that because we don't have the files you are including - if you want assistance here, then what you need to do is to limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. – Thruston Mar 29 '15 at 19:27
  • Plenty could be changed in the masterfile (in terms of best practices), but nothing there is responsible for the weird spacing. As you point out, it occurs near lines that end with \\, so your code needs to include that part as well for people to diagnose the problem correctly. – jon Mar 29 '15 at 19:54
  • @Thruston got it. You can find the pruned code at this dropbox link: https://www.dropbox.com/sh/atow1pb16nouopb/AAB1bpnvEhA80aPntVbG_LI1a?dl=0 – the_candyman Mar 29 '15 at 20:07
  • 2
    I think you're seeing the same problem as http://tex.stackexchange.com/questions/10743/why-does-latex-stretch-small-sections-across-the-whole-page-vertically. In other words, try adding \raggedbottom to the preamble. – Torbjørn T. Mar 29 '15 at 21:51
  • 2
    Please add a minimal example *here*. Questions should be generally useful and should continue to help future users, even if the contents of links disappears or is modified. For that reason, questions should be self-contained - they should not rely on information hosted on external sites. – cfr Mar 29 '15 at 22:22
  • 1
    Your log file has several lines Underfull \hbox (badness 10000) in paragraph at lines 8--20 note 10000 is infinitely bad these are probably all generated by the misuse of \\ and it has one Underfull \vbox (badness 10000) has occurred while \output is active [] which means that one vertical box can't be set correctly and will be over-stretched. – David Carlisle Mar 30 '15 at 00:12
  • 1
    Please do not use dropbox (or other external) links. This question will be archived on this site forever and won't make sense unless you are offering to preserve the external links in the same timeframe. you don't need \include.. in the example, make a small self contained example that demonstrates the problem, that people can run locally and test answers. – David Carlisle Mar 30 '15 at 15:43
  • 1
    we are suggesting not to use \\ because it makes your document infinitely bad and will lead to inconsistent white space in the output and loads of warning in the log file. – David Carlisle Mar 30 '15 at 15:44
  • @DavidCarlisle ok, I would do this but I also have the class file phdthesis.cls. If I replace the \documentclass with standard article or book, the problem disappears... – the_candyman Mar 30 '15 at 17:43
  • @the_candyman so that's progress, you've started the debugging. Move lines of the thesis class into your preamble until the problem comes back. then you've found the problem. – David Carlisle Mar 30 '15 at 17:49
  • @DavidCarlisle thanks for the hint. I'll do this. Anyway, what am I meant to use as \documentclass in this case? – the_candyman Mar 30 '15 at 17:52
  • For an example preferably ones in the core latex distribution such as article, or at least a class that people have eg memoir or scrbook if the thesis is based on one of those. – David Carlisle Mar 30 '15 at 17:55
  • @DavidCarlisle I've inserted the class file in the tex file after the \documentclass line. I started obtaining errors from compiler... Seems it does not like the line from the class \newcommand{@mult}{1}... – the_candyman Mar 30 '15 at 17:58
  • If you need to add lines which contain @, surround them by \makeatletter (before) and \makeatother (after you've finished with lines which use @). – cfr Apr 22 '15 at 00:15

1 Answers1

6

Never end a paragraph with \\ it forces a line break after the last word of the paragraph producing an empty line that messes up the space and produces

Underfull \hbox (badness 10000) in paragraph at lines...

in the log. Note that 10000 is infinitely bad. TeX is telling you that the spacing in this document has been forced to be as bad as it measures.

If you have large unbreakable boxes in your text you may prefer \raggedbottom rather than \flushbottom where TeX tries to keep the baseline of the bottom row of each page at the same point, so may have to stretch white space to achieve that, but without an example it is hard to be sure. But first you need to remove the \\ commands as it is impossible to get correct spacing with that markup.

David Carlisle
  • 757,742