Skip to content

Commit

Permalink
Numbers overlap the titles in TOC of PDF
Browse files Browse the repository at this point in the history
With a lot of paragraphs / nesting levels in the TOC it happens that the paragraph number flows into paragraph title in the toc, this patch overcomes this problem.
See also https://en.wikibooks.org/wiki/LaTeX/Tables_of_Contents_and_Lists_of_Figures#Numbers_overlap_the_titles
  • Loading branch information
albert-github committed May 16, 2018
1 parent df0d9c3 commit abca136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/latexgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ static void writeDefaultHeaderPart1(FTextStream &t)
t << "\\usepackage{caption}\n"
<< "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n";

// prevent numbers overlap the titles in toc
t << "\\renewcommand{\\numberline}[1]{#1~}\n";

// End of preamble, now comes the document contents
t << "%===== C O N T E N T S =====\n"
"\n"
Expand Down

0 comments on commit abca136

Please sign in to comment.