0

Considering this code, how to make chapter title continue smoothly under the word CHAPTER 1: spanning the whole \textwidth?

\RequirePackage{luatex85}
\documentclass[chapterprefix=off]{scrbook}
\renewcommand*{\chapterformat}{CHAPTER~\thechapter:\enskip}
\renewcommand*\raggedchapter{\centering}
\begin{document}
    \chapter{Some long long long long long long long long long long long title}
\end{document}

enter image description here

2

Possible with a simple command.

diaabiidouScrbookChapterlayout

\documentclass[oneside]{scrbook}
\renewcommand*{\chapterformat}{CHAPTER~\thechapter:\enskip}
\renewcommand*\raggedchapter{\centering}
\renewcommand{\chapterlinesformat}[3]{#2#3}
\begin{document}
\chapter{I am sorry to say that no wombats and no ducks can be
found in the following text}
\chapter{Some long long long long long long long long long
long long title}
\end{document}
  • Many thanks for your answer. Could you please tell me the meaning of \renewcommand{\chapterlinesformat}[3]{#2#3}? since I couldn't understand it from the manual. – Diaa Nov 29 '16 at 17:44
  • 2
    @DiaaAbidou The default sets the command to do what you see, the title hangs next to the chapter word (does not flow underneath it). With renewing that, and not telling LaTeX to do the former, the result is what you expect. – Johannes_B Nov 29 '16 at 17:46
  • Thanks for your previous explanation. I would be grateful if you could consider my question here about removing indentation of ToC section entries. – Diaa Nov 29 '16 at 18:41
0

You mean like this?

\documentclass[chapterprefix=off]{scrbook}
\usepackage{titlesec}
\titleformat{\chapter}[block]{\Huge\bfseries}{CHAPTER~\thechapter:}{0.5em}{}
\begin{document}
    \chapter{Some long long long long long long long long long long long title}
  \end{document}
  • Thanks for your answer. Yes, I need the same output, but, unfortunately, the incompatibility between titlesec and koma-script prevented me from depending on this approach. – Diaa Nov 29 '16 at 17:33

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.