Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there any easy way to force a line break in a section name manually, without getting the line break in the Table of Contents? It's because I have a rather long section name, and it breaks just only the last three letters and it looks stupid, but there is no problem in ToC. I have tried double-\ but it breaks the line in the ToC as well.

I have looked at How to put a line-break in section heading? and tried

\texorpdfstring

And it does break the line, but the new line starts below the section number, not below the section name.

(I'm using PDFLaTeX for compiling in TexMaker, and I would prefer not to change that.)

Another solution could be to squeeze the title a bit, if that is possible? I don't think it would be noticeable.

share|improve this question
    
try putting the broken word in an \mbox. and/or try using a tie ~ to attach a couple of words that you want to keep together. –  barbara beeton Dec 14 '12 at 0:02
    
The accepted answer to the question you linked mentions using the optional argument; I've rephrased the answer so that it becomes more explicit. –  Gonzalo Medina Dec 14 '12 at 0:29
    
I'm sorry, didn't get that by then I think. I see now... –  Niels Møller Dec 14 '12 at 0:30

1 Answer 1

up vote 2 down vote accepted

You can use the optional argument for the section (inside [...]) which will used for running content:

\documentclass{article}
\usepackage{lipsum}

\begin{document}
\tableofcontents

\section[my section]{This is going to \\ go for two lines}
\lipsum

\end{document}

enter image description here

Make sure to use a short title in the optional argument.

share|improve this answer
    
This worked! Thanks! I actually just used the same title in the optional argument, as there is no problem in ToC (it's only 3 letters too much for one line in the text). –  Niels Møller Dec 14 '12 at 0:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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