4

Is there any way to align the chapter number to the right (without the CHAPTER word!) and the chapter title itself to the left? The chapter title must be on the line below the chapter number

Here is part of the code I use (both the chapter number and title are right aligned):

\usepackage{titlesec}

\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries\color[RGB]{0,120,182}}
{\thechapter}{1em}

PS: I use Sphinx to generate latex output if it matters

Thanks in advance

5

You can use \filleft just before \thechapter:

\documentclass{book}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{lipsum}% just to generate text for the example

\titleformat{\chapter}[display]
  {\normalfont\Huge\bfseries\color[RGB]{0,120,182}}
  {\filleft\thechapter}{1em}{}

\begin{document}

\chapter{Test chapter}
\lipsum[2]

\end{document}

enter image description here

| improve this answer | |

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.