I got a problem with my current document. Some of the Section titles are fairly long and the linebreak won't work in the table of contents. For some reason it works when I compile it with texstudio. (where other stuff won't work) But when I compile it with texcenter and the profile LaTeX-PS-PDF it will produce a toc wich just looks horrible.
\documentclass[
12pt,
footheight=22pt,
openright,
a4paper,
twoside,
listof=totoc,
bibliography=totocnumbered,
final]{scrbook}
\usepackage{scrhack}
\usepackage{geometry}
\geometry{inner=2.5cm, outer=5cm, head=22pt}
\raggedbottom
\frenchspacing
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath, amssymb, amsfonts, pifont, float, color,setspace}
\usepackage{notoccite} %keeps cite numbers from text in toc...
\usepackage{graphicx}
\usepackage[format=plain,justification=justified,singlelinecheck=false,font={stretch=1.125,small,sf},labelfont=bf,labelsep=space]{caption}
\usepackage[section]{placeins} %keeps floats in section
\usepackage[pdfpagelayout=TwoColumnRight,colorlinks=false, pdfborder={0 0 0}, bookmarksnumbered=true]{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage{footnote}
\usepackage{tabularx}
\makesavenoteenv{tabular}
\captionsetup{width=.9\textwidth} %90% textwidth for all captions
\usepackage{psfrag}
\usepackage[right]{eurosym}
\usepackage[super,square,comma,sort&compress]{natbib} %hochstellen des cite befehls
\usepackage[version=3]{mhchem}
\apptocmd{\thebibliography}{\raggedright}{}{}%url formatting in biblio
\usepackage{verbatim}
%list of figures spacing
\makeatletter
\renewcommand*\l@figure{\@dottedtocline{1}{1em}{3.2em}}
\makeatother
\usepackage[final]{listings}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[headsepline,footsepline]{scrlayer-scrpage}
\automark[section]{section}
%\renewcommand*{\partmark}[1]{}
\setkomafont{pageheadfoot}{\normalcolor\footnotesize\scshape}
\setkomafont{pagenumber}{\normalfont\normalsize}
\clearpairofpagestyles
\ihead{\scriptsize\headmark}
\ohead*{\pagemark}
\clubpenalty = 100000
\widowpenalty = 100000
\displaywidowpenalty = 100000
\interlinepenalty=5000 %dont break sentences
%Zeilenabstand
\linespread{1.5}
\begin{document}
\tableofcontents
\addtocontents{toc}{\protect\enlargethispage{0.5cm}}
\chapter{Chapter 1}
\section{Section with a really really really long title I mean really really long title}
\subsection{Even worse title for a subsection once you finished reading you feel like you read a book}
\end{document}
Has anyone an idea how I can fix it?
\section
to usr a short version of the section title, both in headers and in the table of contents.hyperref
andbreakurl
is relevant. Exactly which ghostscript version are you using. Exactly how are you compiling i texstudio? The MWE has no issues withpdflatex
only the latex+dvips+ps2pdf route