Titlesec ignores odd and even page formatting for chapters

Yes, it seems that the page option doesn't take effect for \chapter.

You can work around this by declaring something like:

\titleformat{name=\chapter}{\Huge}{\ifthenelse{\isodd{\thepage}}{ODD:}{EVEN:}}{.5em}{}

with the help of \ifthenelse from the ifthen package.

MWE:

\documentclass[11pt,twoside]{report}
\usepackage[a4paper]{geometry}
\geometry{a4paper, top=22mm, left=45mm, right=25mm, bottom=30mm}
\usepackage{lipsum}
\usepackage[rigidchapters,explicit]{titlesec}
\usepackage{ifthen}
\titleformat{name=\section,page=odd}{}{ODD:}{.5em}{}
\titleformat{name=\section,page=even}{}{EVEN:}{.5em}{}
\titleformat{name=\chapter}{\Huge}{\ifthenelse{\isodd{\thepage}}{ODD:}{EVEN:}}{.5em}{}

\begin{document}
\chapter{ChapterA}
\section{Section A} \lipsum[1-2]
\chapter{ChapterB}
\section{Section B} \lipsum[1-2]
\chapter{ChapterC}
\section{Section C} \lipsum[1-2]
\end{document} 

Output (needs two compilations, at least!)

enter image description here

Tags:

Titlesec