2

I'm preparing a document (scrreprt) which has pretty long chapter titles. Apparently, those are too long: they exceed the right margin by quite a bit, and of course I'm getting Overfull \hbox messages. It looks like this:

Chapter heading #1

Chapter heading #2

Any ideas on how I could prevent this? I initially thought LaTeX would insert line breaks between Marketing- and Forschung (and und and Organisationen), but it won't do that.

A minimal example:

\documentclass[10pt]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{titlesec}
\titleformat{\chapter}{\fontseries{eb}\huge}{\thechapter}{1em}{}
\usepackage[default,osfigures]{opensans}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{a4paper, top=2.5cm, left=2.5cm, right=2.5cm, bottom=2.5cm, headsep=.35in, footskip=0.4in, headheight=2.5cm, footnotesep=1in}

\begin{document}

\chapter{Käuferverhalten und Marketing-Forschung als Gegenstandsbereiche des Marketing}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.
\end{document}
8
  • Is that German? Are you using the babel package with german option? – Sigur Nov 16 '13 at 14:19
  • Yep, that's German and I'm using babel with the ngerman option. Hyphenation works fine for the rest of the document... – Daniel Nov 16 '13 at 14:23
  • You can do it by yourself. Use \- to split a word. – Sigur Nov 16 '13 at 14:28
  • 4
    Then you will have to supplement your question with a self-contained and minimal example. – Thorsten Donig Nov 16 '13 at 15:24
  • 1
    Do you really need titlesec You can achieve the same with \addtokomafont{chapter}{\fontseries{eb}\huge}. However it seems that titlesec doesn't use \raggedright. – Marco Daniel Nov 17 '13 at 15:15
2

Since you're already using babel with the ngerman option, you could solve the issue at hand by (i) replacing Marketing-Forschung with Marketing"=Forschung in the chapter header and (ii) adding \raggedright to the second argument of the \titleformat{chapter}{...}{...}{} directive:

\titleformat{\chapter}{\fontseries{eb}\huge\raggedright}{\thechapter}{1em}{}

These two changes will produce the following chapter header:

enter image description here

3
  • According to Bringhurst’s recommendation, headings are more peasant set ragged right without hyphenation. May be you shall add something regarding typography in your answer. I do not have Bringhurst at hand so I cannot give further reference tonight. – Sveinung Nov 17 '13 at 20:03
  • @Sveinung - Since there's already a hyphen in the composite noun "Marketing-Forschung", I think it's OK to let a line break happen at that hyphen. I'm also familiar with Bringhurst's recommendation not to hyphenate words in sectioning headers. :-) However, given that his book is on English (and, more specifically, North American) rather than on German typographic usage, I'm not sure if this recommendation carries over directly. Notice that by using the directive \raggedright in the sectioning headers, no new hyphenation points will be created. – Mico Nov 18 '13 at 7:07
  • Yes, of course, I was not clear. This type of compound words are OK to hyphenate in headings also according to Bringhurst. I was referring to in general. – Sveinung Nov 18 '13 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.