views:

26

answers:

2

I'm writing a document and I have a few chapter titles that I would like to appear as 2 lines for a chapter title, but only one line in the table of contents. Is there a simple command I to filter out the newline character like this?

Chapter Title

First Line:

Second more informative line

ToC:

First Line: Second more informative line

+3  A: 

you can define alternative chapter titles for the toc:

\chapter[toc title]{regular title}
second
Excellent, this will do it. I knew there had to be some way to deal with it that I just wasn't aware of.
Tony
+1 because I learned something new while posting an answer -- I was going to suggest something with adding a TOC line manually because I didn't know chapter took an optional argument.
Alex Martini
+2  A: 

Building on second's answer above -- adding another answer so I can format the code nicely.

If you want, you can even make your own command. Something like this:

\newcommand{\twolineChapter}[2]{ %
    \chapter[#1: #2]{#1: \\ #2} %
}

Then write in your document's body

\twolineChapter{First Line}{Second more informative line}

Which, when you typeset your book, will get turned into

\chapter[First Line: Second more informative line]{First Line: \\ Second more informative line}

This is especially nice if you later decide to change how titles are formatted, for example putting the subtitle in a smaller font.

Alex Martini