2

I have titleformat for chapter title specified like this:

\documentclass{report}

\usepackage[sf,sl,outermarks,explicit]{titlesec}

\titleformat{\chapter}{\normalfont\sffamily\Large\bfseries}{\thechapter \quad \MakeUppercase{#1}}{.5em}{}

\begin{document}

\chapter{Too long chapter name needs to be split into multiple lines}

\end{document}

Now my chapter title is too long so it cannot be displayed well in one line and needs to be splitted into multiple lines. Ive tried adding \\ or \newline but without success.

\chapter{Too long chapter name needs to be split into multiple lines}

enter image description here How can I split this title into multiple lines? Ive tried to search for similar questions but couldnt find anything useful.

2

You're putting the title in the wrong place:

\documentclass{report}

\usepackage[sf,sl,outermarks,explicit]{titlesec}

\titleformat{\chapter}
  {\normalfont\sffamily\Large\bfseries}
  {\thechapter}
  {1em}
  {\MakeUppercase{#1}}

\begin{document}

\chapter{Too long chapter name needs to be split into multiple lines}

\end{document}

enter image description here

Without explicit it can be

\titleformat{\chapter}
  {\normalfont\sffamily\Large\bfseries}
  {\thechapter}
  {1em}
  {\MakeUppercase}
1

Looks like the optional argument [display] will work. Section 3.1 of the titlesec documentation.

\documentclass{report}    
\usepackage[sf,sl,outermarks,explicit]{titlesec}

\titleformat{\chapter}[display]%
  {\normalfont\sffamily\Large\bfseries}%
  {\thechapter \quad \MakeUppercase{#1}}{.5em}{} % Succeeds
%\titleformat{\chapter}%
%  {\normalfont\sffamily\Large\bfseries}
%  {\thechapter \quad \MakeUppercase{#1}}{.5em}{} % Fails

\begin{document}

\chapter{Too long chapter name needs to be split into multiple lines}

\end{document}

enter image description here

  • [display] argument just added a big space after my chapter title but it remained in one line.... could there be a problem with other packages I am using? Should I post them to question? – delusionX Nov 27 '16 at 19:04
  • Verify my answer works as-is (I'm pretty sure it does), and if that's not fixing your actual document, there you'll need to start narrowing down the conflicting package or setting. – Mike Renfro Nov 27 '16 at 19:06
  • There is a problem with explicit. When I remove it and change the command to: \titleformat{\chapter}{\normalfont\sffamily\Large\bfseries}{\thechapter}{.5em}{} then the result is as I wanted, split into multiple lines but I dont know how can I make it uppercase now. (I dont even need to add display because when I do it puts number on one line and chapter title on new line under the number.) – delusionX Nov 27 '16 at 19:19
  • 1
    Normally, display is for chapter number and chapter title on different lines. What you obtain corresponds more to the block style. – Bernard Nov 28 '16 at 1:24

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.