Graphics, Figures & TablesTOC numbering overlapping text

Information and discussion about graphics, figures & tables in LaTeX documents.
Locked
nico
Posts: 20
Joined: Tue Jun 08, 2010 10:13 am

TOC numbering overlapping text

Post by nico »

Hi,

i changed the style of the section numbering in this way:

Code: Select all

\renewcommand*\thesection{\Roman{section}}
It works fine, but in the TOC the numbers overlapp the text as the numbers get larger. So how do I have to edit the renewcommand?

Here is a working example:

Code: Select all

%\documentclass[10pt,a4paper]{scrartcl}
\documentclass[a4paper]{article}

\usepackage[utf8]{inputenc}	%inputencoding
\usepackage[ngerman]{babel}	%Silbentrennung
\usepackage[unicode,a4paper, colorlinks=true,linkcolor=black,citecolor=black]{hyperref}
\usepackage{geometry}
\geometry{a4paper, portrait, left=2.5cm, right=3cm, top=2cm, bottom=2cm, includefoot, marginpar=2cm}
\usepackage[ngerman]{babel}
\usepackage{lmodern}

\renewcommand*\thesection{\Roman{section}}

\begin{document}
\tableofcontents
\pagebreak
%------------------------------------------------------------------------------
\section{Einleitung}
\subsection{Aufgabenstellung}
\subsection{Unterlagen, Vorgespräche}
\subsection{Quellen}
\renewcommand*{\refname}{\vspace*{-12mm}}
\bibliography{../../bsnLiteratur} 
\pagebreak
%------------------------------------------------------------------------------
\section{Beschreibung des Objekts, Grundlagen}
\subsection{Lage, bauliche Merkmale}
\subsection{Raumnutzung}
\subsection{Betriebsbeschreibung}
\subsection{Baurechtliche Einordnung}
\subsection{Brand- und Explosionsgefahren}
\subsection{Brandszenarien}
\pagebreak
%------------------------------------------------------------------------------
\section{Brandschutzanforderungen}
\subsection{Brandschutztrennung}
\subsection{Bemessung des Brandabschnitts}
\subsection{Baustoffe und Bauteile}
\subsection{Rettungswege}
\subsection{Rauchableitung}
\subsection{Wärmeabzug}
\subsection{Zugang und Zufahrten der Feuerwehr}
\subsection{Brandmeldung und Alarmierung}
\subsection{Löschwasserversorgung und Löschgerät}
\subsection{Sonstige Anforderungen}
\pagebreak
%------------------------------------------------------------------------------
\section{Zusammenfassung}
%------------------------------------------------------------------------------
\label{LastPage}
\end{document}
The problem appears in article and scrartcl (KOMA-Script). I use

Code: Select all

pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2010.5.17)
Thanks for any hints!!
Last edited by nico on Tue Jun 08, 2010 3:45 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

TOC numbering overlapping text

Post by gmedina »

Hi,

add the following lines to the preamble of your document:

Code: Select all

\makeatletter
  \renewcommand\l@subsection{\@dottedtocline{2}{1.5em}{3em}}
\makeatother
Change the value for the last argument (I used 3em in my example code) according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
nico
Posts: 20
Joined: Tue Jun 08, 2010 10:13 am

Re: TOC numbering overlapping text

Post by nico »

Thank you so much, gmedina! This is working great.
hvancauter
Posts: 1
Joined: Wed Jun 22, 2011 11:39 pm

Re: TOC numbering overlapping text

Post by hvancauter »

Hi,

Is there a way to do this only once and not for all the other chapters of the table of contents? Because otherwise there is too much white space between the numbers and the titles of the other chapters.

I would be very grateful for any tips!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: TOC numbering overlapping text

Post by localghost »

It is unwanted to hijack a thread with a solved problem. Please open a new topic and refer to this one here.


Thorsten
Locked