1

I understand this type of error occurs as a result of line stretching beyond the region. What is the best way to fix it?

LaTeX file (lines)

75 A \emph{trajectory} is a representation  of a portion of spatio-temporal 
   positions [${t_{begin},t_{end}}$] of a moving object within time 
  interval ${t_{begin}}$ (the begin time) and ${t_{end}}$ (the end time) 
   constituting respectively the beginning and end movement of the object 
   to Space
76

pdf output: enter image description here

Adding a \newline command shift the stretched part to the next line, yet this error is still reported:

75 A \emph{trajectory} is a representation  of a portion of spatio-temporal 
   positions \newline [${t_{begin},t_{end}}$] of a moving object within time 
  interval ${t_{begin}}$ (the begin time) and ${t_{end}}$ (the end time) 
   constituting respectively the beginning and end movement of the object 
   to Space
76

pdf output: enter image description here

How do I fix it?

EDIT

It is a large document but I extract up to line above to show content. I actually have lots of Overfull/Underfull warnings, but seeing the pdf file is generated, I thought that wouldn't matter, but now decided to fix it so that the printout isn't affected.

\documentclass[a4paper, 10pt]{report}
\usepackage{biblatex}
\addbibresource{references.bib}
\usepackage{graphicx}
\usepackage[top=25mm, bottom=20mm, left=20mm, right=20mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{array}
\usepackage[nopostdot,toc,acronym,nomain,nonumberlist]{glossaries-extra}
\makeglossaries

\loadglsentries[acronym]{myglossaries}
\pagenumbering{roman}
\begin{document}
\setlength{\parindent}{0pt}

\input{titlepage}

%Abstract page
\newpage
    \Large
     \begin{center}
     \addcontentsline{toc}{section}{Abstract}
    \textbf{\textit Abstract} 
    \end{center}
    \hspace{10pt}

    %\normalsize
    This is a simple one-page abstract template. Please keep your abstract length at one page. The abstract should be in English.

    %Table of content
    \tableofcontents

    \newpage
    %\addcontentsline{toc}{section}{List of Abbreviations}
    \printglossary[title={Abbreviations},type=acronym,style=long]

    %\newpage

%begin main document
\chapter{Introduction}
\pagenumbering{arabic}

    \section{Statement of Problem}
    This is the beginning of the introduction section.
    %\subsection{Research Questions}
    \section{Motivation}

    \section{Research Objectives}


    \section{Pre-Thesis Structure}

%===CHAPTER TWO ===
\chapter{Machine Learning Concepts}
   \section{Machine Learning Overview}
   Machine learning is an evolving fields from intersection of  statistics, artificial intelligence(\gls{ai}) and computer science \cite{muller2016}, that essentially involves extracting knowledge from data, and to deliver systems that learn from data without being explicitly programmed \cite{ElNaqa2015}. In contrast to traditional software development processes in which case algorithms consist of explicit instructions to process data and output results, machine learning applications are presented with data to learn from, and provide output based on learned features from data. Machine learning algorithms generally look for patterns in data by learning features from examples data given and make better decisions in the future based on learned features in the examples provided. The overall goal of machine learning is to enable computers learn automatically without human intervention and adjust action accordingly. \\

   \section{Machine Learning Problems}
   Machine learning problems are generally classified to two major categories, \emph{supervised learning} and \emph{unsupervised learning} \cite{muller2016}. In supervised learning, the learning algorithm is provided with a pair of input and required output, and the algorithm figure out a way to obtained the required output based on observed patterns in input/output pairs. That way, supervised learning algorithms are able of decision-making by generalising from previously seen examples, thus is able to produce output from input data it has never seen before without human intervention.\\

   In unsupervised learning problems on the other hand, only the input data is known, therefore no examples output are given, e.g. identifying customers with similar buying behaviour from customer records. As the focus of this PhD study is mainly a supervised machine learning problem, our discussion is centred to supervised learning methodologies only.

   \subsection{Classification Problem}

   \subsection{Artificial Neural Networks}
   describe some deep learning lcassification algorithms here!
   \subsubsection{Convolutional Neural Network}

%=== CHAPTER THREE ===
\chapter{State of the Art}
    This chapter covers state-of-the-art definition of terminologies in Global Positioning System(\gls{gps}) trajectories, specifically focusing our discussions on \gls{gps} trajectory reconstruction and transportation mode identification. First, we provide an overview of previous research related to transportation problem and mode detection methods utilized, and then present our approach compared to previous work. 

    \section{Terminology}
    A \emph{trajectory} is a representation  of a portion of spatio-temporal positions \newline [${t_{begin},t_{end}}$] of a moving object within time interval ${t_{begin}}$ (the begin time) and ${t_{end}}$ (the end time) constituting respectively the beginning and end movement of the object to Space \cite{spaccapietra2013}. It is worth noting that trajectory determination  is largely application specific (e.g. tourist movement). Trajectories are essentially represented in one of three forms:  (\Rn{1}) \emph{continuous trajectory}, (\Rn{2}) \emph{discrete trajectory}, and (\Rn{3}) \emph{step-wise}.\\

    Whereas a \emph{continuous trajectory} representation relates to the continuous movement of an object over time interval [${t_{begin}, t_{end}}$] for which the trajectory constitutes a finite sequence of spatial positions, and an interpolation function that computationally determines object’s position at given time ${t}$. A \emph{discrete trajectory} representation is a non-continuous (not showing continuous movement) list of spatial positions over the time interval [${t_{begin}, t_{end}}$].

%=== Reference Lists ====

\printbibliography

\end{document}
  • 2
    please post code that we can run to reproduce the error (a complete small document) The image you show is of an over-full box (sticking in to the margin, not an under full box (a box with not enough content to fill its specified size) – David Carlisle Oct 6 '19 at 12:31
  • unrelated but use $t_{\mathrm{end}}$ or $t_{\mathit{end}}$ not ${t_{end}}$ never use the default math italic font for a word, it is designed to make adjacent letters separate and look like a product of variables – David Carlisle Oct 6 '19 at 12:33
  • 1
    The warning in the title is almost always from a mis-placed \\ see tex.stackexchange.com/a/334249/1090 – David Carlisle Oct 6 '19 at 12:34
  • This might be addressed by putting the math string in an \mbox and applying sloppypar as described in How to avoid using \sloppy document-wide to fix overfull \hbox problems? This will still yield an Underfull hbox warning, but the paragraph will be set as best as possible. – barbara beeton Oct 6 '19 at 13:58
  • @barbarabeeton the underfull box warning can't be generated by the code shown, so I don't think it's possible to suggest any changes to this code that will affect the warning in the title. – David Carlisle Oct 6 '19 at 14:03
2

The text sticking in the margin is unrelated to the underfull box warning (which is due to the mis-used \\ commands), The over-running text is an over full box with the warning

Overfull \hbox (15.81268pt too wide) in paragraph at lines 75--76
\OT1/cmr/m/n/14.4 A \OT1/cmr/m/it/14.4 tra-jec-tory \OT1/cmr/m/n/14.4 is a rep-
re-sen-ta-tion of a por-tion of spatio-temporal po-si-tions [$[]$]

You can use sloppypar around that paragraph to avoid the overfull box. All the underfull box warnings go if you delete the erroneous \\ resulting in the document below:

\documentclass[a4paper, 10pt]{report}
\usepackage{biblatex}
\addbibresource{references.bib}
\usepackage{graphicx}
\usepackage[top=25mm, bottom=20mm, left=20mm, right=20mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{array}
\usepackage[nopostdot,toc,acronym,nomain,nonumberlist]{glossaries-extra}
\makeglossaries

%NOT PROVIDED \loadglsentries[acronym]{myglossaries}
\pagenumbering{roman}

% if you have 0parindent you want non zero parskip \setlength{\parindent}{0pt}
\usepackage{parskip}

\begin{document}

%NOT PROVIDED \input{titlepage}

%Abstract page
\newpage
    \Large
     \begin{center}
     \addcontentsline{toc}{section}{Abstract}
    \textbf{\textit Abstract} 
    \end{center}
    \hspace{10pt}

    %\normalsize
    This is a simple one-page abstract template. Please keep your abstract length at one page. The abstract should be in English.

    %Table of content
    \tableofcontents

    \newpage
    %\addcontentsline{toc}{section}{List of Abbreviations}
    \printglossary[title={Abbreviations},type=acronym,style=long]

    %\newpage

%begin main document
\chapter{Introduction}
\pagenumbering{arabic}

    \section{Statement of Problem}
    This is the beginning of the introduction section.
    %\subsection{Research Questions}
    \section{Motivation}

    \section{Research Objectives}


    \section{Pre-Thesis Structure}

%===CHAPTER TWO ===
\chapter{Machine Learning Concepts}
   \section{Machine Learning Overview}
   Machine learning is an evolving fields from intersection of  statistics, artificial intelligence(\gls{ai}) and computer science \cite{muller2016}, that essentially involves extracting knowledge from data, and to deliver systems that learn from data without being explicitly programmed \cite{ElNaqa2015}. In contrast to traditional software development processes in which case algorithms consist of explicit instructions to process data and output results, machine learning applications are presented with data to learn from, and provide output based on learned features from data. Machine learning algorithms generally look for patterns in data by learning features from examples data given and make better decisions in the future based on learned features in the examples provided. The overall goal of machine learning is to enable computers learn automatically without human intervention and adjust action accordingly. 

   \section{Machine Learning Problems}
   Machine learning problems are generally classified to two major categories, \emph{supervised learning} and \emph{unsupervised learning} \cite{muller2016}. In supervised learning, the learning algorithm is provided with a pair of input and required output, and the algorithm figure out a way to obtained the required output based on observed patterns in input/output pairs. That way, supervised learning algorithms are able of decision-making by generalising from previously seen examples, thus is able to produce output from input data it has never seen before without human intervention.

   In unsupervised learning problems on the other hand, only the input data is known, therefore no examples output are given, e.g. identifying customers with similar buying behaviour from customer records. As the focus of this PhD study is mainly a supervised machine learning problem, our discussion is centred to supervised learning methodologies only.

   \subsection{Classification Problem}

   \subsection{Artificial Neural Networks}
   describe some deep learning lcassification algorithms here!
   \subsubsection{Convolutional Neural Network}

%=== CHAPTER THREE ===
\chapter{State of the Art}
    This chapter covers state-of-the-art definition of terminologies in Global Positioning System(\gls{gps}) trajectories, specifically focusing our discussions on \gls{gps} trajectory reconstruction and transportation mode identification. First, we provide an overview of previous research related to transportation problem and mode detection methods utilized, and then present our approach compared to previous work. 

    \section{Terminology}
    \begin{sloppypar}
    A \emph{trajectory} is a representation  of a portion of spatio-temporal positions [$t_{\mathrm{begin}},t_{\mathrm{end}}$] of a moving object within time interval ${t_{begin}}$ (the begin time) and ${t_{end}}$ (the end time) constituting respectively the beginning and end movement of the object to Space \cite{spaccapietra2013}. It is worth noting that trajectory determination  is largely application specific (e.g. tourist movement). Trajectories are essentially represented in one of three forms:  (\Rn{1}) \emph{continuous trajectory}, (\Rn{2}) \emph{discrete trajectory}, and (\Rn{3}) \emph{step-wise}.
 \end{sloppypar}

    Whereas a \emph{continuous trajectory} representation relates to the continuous movement of an object over time interval [${t_{begin}, t_{end}}$] for which the trajectory constitutes a finite sequence of spatial positions, and an interpolation function that computationally determines object’s position at given time ${t}$. A \emph{discrete trajectory} representation is a non-continuous (not showing continuous movement) list of spatial positions over the time interval [${t_{begin}, t_{end}}$].

%=== Reference Lists ====

\printbibliography

\end{document}
  • I left it as it was but is it intended that the entire document is in the scope of \Large so set with 14pt fonts? – David Carlisle Oct 6 '19 at 17:29
  • Yes, all gone. I actually used `\` to give 1-line space between paragraphs.. Many thanks. – arilwan Oct 6 '19 at 20:30
  • @arilwan no as I explain in the duplicate question, \\ at the end of the paragraph does not give a space it forces a spurious extra line of paragraph text that is empty (so underfull). and is basically a syntax error and flagged with badness 10000, the maximum level of badness in tex's self checking. Also note that the code you posted was unrelated to the warning you asked about. – David Carlisle Oct 6 '19 at 20:34
  • I understand, many thanks. – arilwan Oct 6 '19 at 20:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.