I am writing my thesis using

\documentclass[12pt, oneside]{book}

Using the document class 'book', I am automatically getting 'Chapter #' headlines which I don't want and have removed using titlesec by the following command


So now I want to have my page number on the bottom right corner and I want a header named after the given chapter or section it is under. I have tried doing this by the following command

\documentclass[12pt, oneside]{book} 

Latex code

% The \usepackage{} command will import predefined fonts, symbols, environments, etc.  For example, the ams packages below come from the American Mathematical Society and include all kinds of useful math symbols like integrals
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{a4paper}                          % ... or a4paper or a5paper or ... 
%\geometry{landscape}                       % Activate for for rotated page geometry
\usepackage[pdftex]{graphicx}               % Use pdf, png, jpg, or eps with pdflatex; use eps in DVI mode  
\usepackage{wrapfig}                % enables the use of \wrapfig, for figures with text wrapped around them

\usepackage{bibentry} % for list of publications

% \usepackage[english]{babel}
\usepackage{xcolor} %% Text color
\usepackage{subfiles} % Best loaded last in the preamble
\usepackage{multicol,multirow}  %% Figure in two columns
\usepackage{mathtools, nccmath}

\usepackage{lipsum}         % gives access to \lipsum, which dumps some latin text into your document as filler if you want to check formatting

%\usepackage[parfill]{parskip}          % Activate to begin paragraphs with an empty line rather than an indent

%my additions
\usepackage{fancyhdr, graphicx}


% Here we set the page dimensions to match the standard thesis format.  These values should not be changed.

%\begin{document} starts LaTeX looking for actual content.  Everything above this point is purely formatting.


% \vspace* creates some vertical white space on the page to make the title page look more pleasing.  \vspace would do much the same thing, but would not insert the white space if we were at the top of a fresh page.  As this is the start of the document we're obviously at the beginning of a page, so the asterisk is necessary to ensure we still put in two cm of white space.


\large{Master's thesis}


{\huge \textbf{Title}} % \huge sets the font size.  Other options include things like \large, \Large, \small, \tiny, etc.


\vspace{1 cm}

% \vfill creates an arbitrary amount of vertical white space as necessary to fill the page

% \vspace*{3cm}



% \frontmatter defines the pieces of the thesis which will use roman numerals for page numbering

% \chapter{} and/or \chapter*{} will create a chapter in your thesis.  Including the asterisk will cause the chapter to not appear in the table of contents.


%\tableofcontents will create a table of contents.  By default it will include entries for any \chapter, \section, and \subsection command that appears in your thesis unless you have called the tag with an asterisk

% The \mainmatter command defines the main body of the thesis and indicates where regular numbering starts




% the \appendix tag tells LaTeX where it should start labelling chapters with letters (denoting appendices) rather than numbers (denoting main chapters)

% \bibliographystyle command to choose the format of your bibliography. More examples of bibliography styles can be found at https://www.overleaf.com/learn/latex/Bibtex_bibliography_styles

% \bibliography is the command for the actual file containing your bibliographic data. This file can be produced manually or automatically using software such as BibTeX. Both options can work, however, learning to use BibTex is beneficial in the long run. An example of the format needed to generate your own bibliography file can be found as the bibliography.bib file here provided.

  • Welcome to SE. Please provide a compilable version of your code that generates the problem. It's hard to know which package conflict you get if you don't say which packages you're using. The code you're currently showing doesn't yield any error message.
    – Miyase
    Commented May 20, 2022 at 12:50
  • I have updated it with the entire latex code, thanks!
    – Natasja
    Commented May 20, 2022 at 13:08
  • Since you load titlesec with option [pagestyles], you should use its companion package titleps, which has a \renewpagestyle command.
    – Bernard
    Commented May 20, 2022 at 13:55

1 Answer 1


It is not recommended to use titleps (as implied by the pagestyles option) and fancyhdr together. With some caution it is possible, however. But then fancyhdr should not be loaded before \usepackage[pagestyles]{titlesec} because they both define \headrule. However, fancyhdr checks for this, so it can be loaded after.

So remove the line \usepackage{fancyhdr, graphicx} and remove the option pagestyles:


Then it may work.

Another issue: Don't just define your page dimensions:

% Here we set the page dimensions to match the standard thesis format.  These values should not be changed.

Instead use the geometry package to define them, and do it before loading fancyhdr. Otherwise you get inconsistencies in the page layout, like the header being too small.

You must log in to answer this question.

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