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 4105 times

Recommended reading 2024:

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

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

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

Code, edit and compile here:
\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}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Attachments
Capture.JPG
Capture.JPG (75.16 KiB) Viewed 4086 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
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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