General ⇒ ToC running out of page
-
- Posts: 7
- Joined: Tue Nov 10, 2020 9:51 am
ToC running out of page
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
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 (88.07 KiB) Viewed 4105 times
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
You should always add text behind a heading, e.g., something likeaerodinamika 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
\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

Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. 

-
- Posts: 7
- Joined: Tue Nov 10, 2020 9:51 am
ToC running out of page
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.
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.
-
- Posts: 7
- Joined: Tue Nov 10, 2020 9:51 am
ToC running out of page
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}
- Attachments
-
- Capture.JPG (75.16 KiB) Viewed 4086 times
-
- Posts: 7
- Joined: Tue Nov 10, 2020 9:51 am
ToC running out of page
I managed to fix the issue. For those interested the issue with text spilling over the page was fixed by using
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.
Code: Select all
\raggedbottom
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
ToC running out of page
I think, your main problem was to use a negative bottom margin:
The bottom margin should always be >> 0 (and usually > top margin).
BTW: There are several not recommended points in the shown code, e.g., loading packages twice, early loading of hyperref, using
Code: Select all
\newgeometry{left=1in, right=1in,top=1in, bottom=-0.2in}
\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 … 
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. 

-
- Posts: 7
- Joined: Tue Nov 10, 2020 9:51 am
ToC running out of page
Ijon,
I am a bit messy, but I will take your suggestions gladly. Thanks
I am a bit messy, but I will take your suggestions gladly. Thanks