GeneralToC running out of page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
aerodinamika
Posts: 7
Joined: Tue Nov 10, 2020 9:51 am

ToC running out of page

Post by aerodinamika »

Hello all!

First of all, I hope my plea for help is reaching all of you in good health, amidst the ongoing pandemic! Now for the issue at hand, I am writing my master's thesis using Overleaf platform. I made the "skeleton" or outlines of my thesis by defining and dividing it into chapters, sections, subsections, etc. up to paragraphs, without actually writing any of the main text inside aforementioned parts. When I compile my "code", the ToC spills out of the page, as there are no margins! I have provided a picture, in case my rambling proves to be unintelligible.


Thanks in advance
Attachments
problem_forum.JPG
problem_forum.JPG (88.07 KiB) Viewed 4089 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

ToC running out of page

Post by Ijon Tichy »

aerodinamika wrote:I made the "skeleton" or outlines of my thesis by defining and dividing it into chapters, sections, subsections, etc. up to paragraphs, without actually writing any of the main text inside aforementioned parts
You should always add text behind a heading, e.g., something like \textsc{To be done.}. LaTeX prevents page breaks after headings. So if you have only \chapter, \section etc. in you document, there cannot be any page breaks.

Usually this should not influence the ToC, but without Infominimal working example I cannot reproduce your problem. So I can only gamble but not really help.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
aerodinamika
Posts: 7
Joined: Tue Nov 10, 2020 9:51 am

ToC running out of page

Post by aerodinamika »

Ijon,

First of all, thank you for a prompt reply.
I have written minimalist text inside every division of my thesis, just to see if it changes the situation, but to no avail.
Since my minimalist code should include the problem, I am thinking of posting the whole code since it comprises only ToC?
Another option is to continue writing my thesis, and if the problem persists, I will make another post in the forum.
aerodinamika
Posts: 7
Joined: Tue Nov 10, 2020 9:51 am

ToC running out of page

Post by aerodinamika »

Alright, I seem to have run into a more serious problem. Any text that should be translated onto the next page, just keeps on running, until it cannot be seen anymore. I will provide my whole code here, I do apologize for the lengthiness.

Code: Select all

\documentclass[12pt,serbian]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[serbian]{babel}
\usepackage[margin=1in,left=1in,includefoot]{geometry}
\usepackage{ragged2e}
\usepackage{lettrine}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[symbols,nogroupskip,sort=none]{glossaries-extra}
\usepackage{setspace}
\usepackage{pdfpages}
\usepackage{titlesec}
\usepackage[shortlabels]{enumitem}
\usepackage{booktabs}
\usepackage{bm}
\usepackage{xcolor}
\usepackage{multicol}
\usepackage{afterpage}
\usepackage{csvsimple}
\usepackage{subcaption}
\usepackage{float}
\usepackage{caption}
\usepackage[scr]{rsfso}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.geometric}
\AtBeginDocument{\renewcommand{\contentsname}{\LARGE{Садржај}}}
\AtBeginDocument{\renewcommand{\listfigurename}{Списак слика}}
\AtBeginDocument{\renewcommand{\figurename}{Слика}}
\AtBeginDocument{\renewcommand{\listtablename}{Списак табела}}
\AtBeginDocument{\renewcommand{\glossaryname}{Списак кориштених ознака}}
\AtBeginDocument{\renewcommand{\abstractname}{Сажетак}}
\AtBeginDocument{\renewcommand{\chaptername}{Поглавље}}
\AtBeginDocument{\renewcommand{\bibname}{Литература}}
\captionsetup[table]{name=Табела}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{hyperref}
\hypersetup{unicode,colorlinks,citecolor=black,filecolor=black,
linkcolor=black,urlcolor=black}
%\addtolength{\cftsecnumwidth}{10pt}
\usepackage[Glenn]{fncychap}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}
\usepackage{titletoc}
\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}}
\glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}}
\glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}}
\glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}}
\glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}

\newcommand{\abstractname}{Сажетак}
\newenvironment{abstract}{
    \vspace*{\stretch{2}}
    { \noindent \bfseries \Huge \abstractname}
    \begin{center}
        Тематика овог мастер рада јесте синтеза проширеног Калмановог филтра на објекту чији је математички модел изразито нелинеарне природе. Литијум-полимерске као и литијум-јонске батерије су свеприсутне у нашим животима. Тежње да се смање емисије продуката сагоревања фосилних горива су довеле до експанзије аутомобила на електрични погон. Таква средства превоза за извор енергије користе велики број батеријских ћелија повезаних у сегменте. Један од проблема који је неопходно отклонити за безбедну вожњу и продужетак животног века батеријског сегмента јесте прецизна процена нивоа напуњености. Један од начина за процену SoC - state of charge параметара јесте управо имплементација проширеног Калмановог филтра.  
        \thispagestyle{plain}
    \end{center}
}
{\vspace*{\stretch{5}}}

\let\cleardoublepage=\clearpage


\begin{document}
\usetikzlibrary{fadings}
\DeclareFixedFont{\titlefont}{T2A}{ppl}{b}{}{0.7in}
\DeclareFixedFont{\subtitlefont}{T2A}{ppl}{b}{}{0.3in}
\afterpage{\restoregeometry}
\newgeometry{left=1in, right=1in,top=1in, bottom=-0.2in}
\definecolor{mytan}{HTML}{fff8d6}
\pagecolor{mytan}\afterpage{\nopagecolor}
\thispagestyle{empty}
\begin{centering}
\titlefont \Huge{\textbf{Синтеза проширеног Калмановог филтра}}\\
%\subtitlefont мастер рад
\end{centering}
\vfill
\begin{center}
\begin{tikzpicture}
\node[scope fading=north, inner sep=0pt, outer sep=0pt]{
\makebox[\textwidth]{\includegraphics[width=\paperwidth]{dawn_isawa.jpg}}
};
\end{tikzpicture}
\end{center}

\clearpage
\tableofcontents
\clearpage

\listoffigures
\clearpage

\listoftables
\clearpage

\printunsrtglossary[type=symbols,style=long,title={Списак кориштених ознака}]
\clearpage


\onehalfspacing
\justifying
\sloppy
\clearpage

\begin{centering} 
\begin{abstract}
\end{abstract}
\end{centering}
\addcontentsline{toc}{chapter}{Сажетак}
\chapter{Увод}
\lettrine[findent=2pt]{\fbox{\textbf{У}}}{ }вод овог рукописа има за циљ да приближи читаоцима појмове из статистике, теорије естимације, и оне који се заснивају на малопре поменутим. Тамо где се покаже нужним, без нарушавања концизности рада, биће дате математичке дефиниције са извођењима на којима су постављени темељи Калмановог филтра, и које су неопходне за даље разумевање. Кратак историјски осврт на методе које су претходиле појму какав је данас Калманов филтар су такођер приложене. Имајући у виду да је ужа научна област којој припада рукопис аутоматско управљање, део увода је посвећен и класификацији система аутоматског управљања, уз пропратне једначине и дефиниције, као и основни појмови те области. 
\section{Статистика и вероватноћа}
Статистика као грана математике представља један научни метод квантитативног истраживања појава са великом фреквенцијом, односно учестаношћу. При чему се анализирани догађаји одвијају са стабилном учестаношћу. Математичка дисциплина која изучава случајне експерименте се назива теоријом вероватноће. Када се употреби појам случајног ескперимента, превасходно се мисли на одређени скуп услова који се могу неограчено много пута поновити, а да при реализацији догађаја не инзуђују искључиво једнозначан исход самог догађаја.
\subsection{Теорија естимације}
Теорија естимација или теорија процене као једна од грана статистике, има за задатак да процени вредности параметара на основу мерљивих емпиријских података скупа који се посматра и који потенцијално садржи стохастичке компоненте.

\subsection{Кратак историјски преглед}

\subsection{Откриће сателита Церес}

\section{Математички апарат}



\subsection{Основне дефиниције и појмови}

\subsection{Метод најмањих квадрата}

\subsection{Регресиона анализа}

\subsection{Естиматори}

\subsection{Теорија вероватноће и статистике}

\subsection{Основни појмови}

\subsubsection{Варијанса}

\subsubsection{Коваријанса}

\subsubsection{Стандардна девијација}

\subsubsection{Очекивање}

\subsubsection{Бајесова централна гранична теорема }

\subsubsection{Функција густине вероватноће}

\subsubsection{Секвенцијално пробабилистичко закључивање}
\section{Класификација система аутоматског управљања}
\subsection{Линеарни, стационарни, динамички, временски непрекидни САУ}
\subsection{Линеарни, стационарни, динамички, временски дискретни САУ}

\subsection{Нелинеарни, стационарни, динамички, временски непрекидни САУ}

\subsection{Нелинеарни, стационарни, динамички, временски дискретни САУ}

\chapter{Калманов филтар}

\section{Историјски преглед}

\subsection{Рудолф Емил Калман}

\section{Шта представља Калманов филтар?}


\subsection{Откуд именица филтар?}


\section{Примене Калмановог филтра}

\subsection{Примена у гранама инжењерства}
\subsection{Примене у финансијама}
\subsection{Примена приликом елементарних непогода}

\section{Врсте Калмановог филтра}


\subsection{Калманов филтар за линеарне системе}


\subsection{Калманов филтар за нелинеарне системе}


\subsubsection{Проширени Калманов филтар}


\chapter{формални опис проблема}
\section{Проблем}
\subsection{Порекло проблема}
\section{Понуђено решење}
\subsection{Синтеза проширеног Калмановог филтра}

\chapter{Објект}
\section{Технички опис система}
\subsection{Резервоари}
\subsection{Пумпа}
\subsection{Систем за аквизицију података}
\section{Математички модел система}
\subsection{Математички модел временски непрекидног система}
\subsection{Математички модел временски дискретног система}

\chapter{План и методологија рада}

\chapter{Резултати}

\chapter{Анализа и дискусија}

\chapter{Закључак}


\newpage
\begin{thebibliography}{11}

\bibitem{kako_napisati}
Зоран В. Поповић.
\textit{Како написати и објавити научно дело}.
Институт за Физику, Земун, 1999.

\bibitem{pmf}
Павле Младеновић.
\textit{Вероватноћа и статистика}.
Математички факултет, Београд, 2008.

\bibitem{sau1}
Драган В. Лазић.
\textit{Нелинеарни системи}.
Машински факултет, Београд, 2005.

\bibitem{sau2}
Борислав Р. Милојковић \& Љубомир Т. Грујић.
\textit{Аутоматско управљање}.
Машински факултет, Београд, 1990.

\bibitem{sau2}
Љубомир Т. Грујић.
\textit{Дискретни системи}.
Машински факултет, Београд, 1991.

\bibitem{kalman_filtering}
Mohinder S. Grewal \& Angus P. Andrews.
\textit{Kalman Filtering: Theory and Practice using} MATLAB.
John Wiley \& Sons, Inc., New York, 2001.





\end{thebibliography}





\end{document}
Attachments
Capture.JPG
Capture.JPG (75.16 KiB) Viewed 4070 times
aerodinamika
Posts: 7
Joined: Tue Nov 10, 2020 9:51 am

ToC running out of page

Post by aerodinamika »

I managed to fix the issue. For those interested the issue with text spilling over the page was fixed by using

Code: Select all

\raggedbottom
command. Thanks to this article https://tex.stackexchange.com/questions ... al-spacing. The issue with the ToC was fixed by imposing regular geometry margins right after the title page. Hope this helps.
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

ToC running out of page

Post by Ijon Tichy »

I think, your main problem was to use a negative bottom margin:

Code: Select all

\newgeometry{left=1in, right=1in,top=1in, bottom=-0.2in}
The bottom margin should always be >> 0 (and usually > top margin).

\raggedright prevents enlarged vertical space between objects, e.g., before and after headings and moves all such needed extra space to the end of the page.

BTW: There are several not recommended points in the shown code, e.g., loading packages twice, early loading of hyperref, using \centering as environment, using abstract inside another environment, (maybe the \addcontentsline is misplaced, but I do not know, because I do not understand Serbian), \clearpage before a \tableofcontents etc. is useless, because these are chapters and chapters already start a new page automatically. If the documents works, you don't need to change these, but maybe for the next one … :roll:
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
aerodinamika
Posts: 7
Joined: Tue Nov 10, 2020 9:51 am

ToC running out of page

Post by aerodinamika »

Ijon,

I am a bit messy, but I will take your suggestions gladly. Thanks
Post Reply