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

0

1 Answer 1

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .