# Customizing the first page of each \chapter of a {book}

I'm writing my thesis in LaTeX using ShareLaTeX but my university gives very specific format rules. I improved my chapter page with Styling the \part page but I still have two problems:

• I need to have "1 Introduction" all in the same line. I deleted "Chapter" and tried by adding negative vertical space between them but when it's correct in one chapter, in the next one they are unaligned.
• The page number appears (only in the first page of each \chapter) at the bottom and I have to show it (as I have in the rest of the document), in the top right part (as it is always an odd page).

I leave the code I'm using for the moment. Hope it's clear and thanks a lot.

\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english,spanish]{babel}
\usepackage{titlesec}

\titleformat{\chapter}
[display]
{\normalfont\huge\bfseries}
{\thechapter}
{-45.7pt} %Here's where I modify the vertical space
{\hspace{20pt}\huge}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}

\begin{document}

\chapter{Introduction}
Here it starts the text of my introduction.

\end{document}


Just use the block style, not display and re-define the plain page style with pagestyles option for titlesec (note it is incompatible with fancyhdr):

\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english,spanish]{babel}

\usepackage[pagestyles]{titlesec}

\titleformat{\chapter}
[block]
{\normalfont\huge\bfseries}
{\thechapter}
{0pt} %
{\hspace{20pt}\huge}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}

\begin{document}

\chapter{Introduction}
Here it starts the text of my introduction.

\end{document}


• Thanks a lot! That solves the problem perfectly! But, can you explain how to re-define the plain pagestyle with pagestyles? Many thanks Jul 31, 2017 at 12:33
• @Hitch: I see now I had forgotten to update my code. Please take a look at the new version, corresponding to the image. Setting headers and footers with titleps is much simpler than with fancyhdr, as you do not have to use the markssystem (but you can, if you want). Jul 31, 2017 at 13:02
• Hi @Bernard! Thanks for your help and time. Now I have the title of the chapter in both header and foot (only in the first page of each chapter) and I don't want that... Besides, I would also like that in every page odd page, in the header, instead of appearing "Chapter 1. Introduction", I'd rather had "1 Introduction", without the word "Chapter" and the point. But this last one is not a big deal. Do you know a way to solve these things? Mostly the first one, but if you know also the second, it would be great! Thanks again! Aug 4, 2017 at 20:00
• @Hitch: In this case I think the simplest is to define a new custom pages style (always with titleps). But what would you like to have on even pages? Aug 4, 2017 at 20:52
• even just the number of the page is ok, but {book} automatically puts also the name of the section, which is good looking, but not necessary. I only need it to be consistent, every page the same format. So, in conclusion: I have two parts: First part: Numeration in roman numbers and in the bottom center. Second part: I want the number of the page in the bottom center part or in the upper exterior part of each page (odd pages: up left, even pages: up right). Normally I had the roman numbers correct, but with your new code it changed also to the top part! Thanks! Aug 6, 2017 at 17:49