0

I used automatically generated documents to export some computation results and I have observed that when section number reach 100 the indentation becomes too small to prevent some overlaps: enter image description here

I have written this bash script to reproduce the problem:

#!/bin/bash
output="generate_110_sections.tex"
echo "\documentclass[11pt]{article}" > "$output"
echo "\begin{document}" >> "$output"
echo "\tableofcontents" >> "$output"

for i in {1..110}
do
    echo "\section{Welcome $i times}" >> "$output"
    echo "\pagebreak" >> "$output"
done

echo "\end{document}" >> "$output"

Then generate the pdf by:

latex generate_110_sections.tex; dvipdf generate_110_sections.dvi

My latex version:

latex -version
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian)
kpathsea version 6.3.1/dev
... 

My questions:

  • can you reproduce?

  • if so, is it a LaTeX bug?

  • is there a workaround/trick to avoid these overlaps?

Browse other questions tagged or ask your own question.