2

I have a Miktex 2.9 installation on my computer, I am writing my PhD thesis and I am struggling with the fancyhdr package. Up to now, whenever I need a new package, the software just ask me whether I want to download and install it, I agree with him and I keep going with my thesis.

Problems come with the fancyhdr package. If I add the line of code

\usepackage{fancyhdr} 

on my thesis preamble than what I get is

! Class MastersDoctoralThesis Error: Package `fancyhdr' is incompatible
(MastersDoctoralThesis)              with this class.

See the MastersDoctoralThesis class documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.58 \usepackage{fancyhdr}

? 

I had a look around, other people struggle with this packages and I also tried to provide a kind of manual download from the Miktex Package Manager, which also "believe" the fancyhdr is already installed. But I can't use it at all.

Would you be able to help me sorting out this problem, please?

4
  • 4
    Welcome to TeX.SX! The message says all: you cannot use fancyhdr with that class. Can you point to the source of the class and specify what changes to the headers or footers you wish?
    – egreg
    Commented Sep 11, 2017 at 17:11
  • What also helps is the documentation for your class. texdoc MastersDoctoralThesis would in most cases pop up the documentation. Commented Sep 11, 2017 at 17:40
  • @OlegLobachev Actually not in this case as you'll find the "documentation" (template) online only...
    – TeXnician
    Commented Sep 11, 2017 at 18:39
  • If you would have typed h, there would have been a more meaningful explanation. The template you are using uses package scrlayer-scrpage from the KOMA-script bundle.
    – Johannes_B
    Commented Sep 17, 2017 at 10:42

1 Answer 1

4

From what I can tell this is hardcoded in the MastersDoctoralThesis.cls

\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined 
using package `scrlayer-scrpage', please consult the\MessageBreak 
KOMA-script documentation for details.}]{fancyhdr}

So why not go ahead and checkout the suggested package scrlayer-scrpage. Maybe it has the options you need? Checkout chapter 5, especially pg. 236.

E.g. this puts your page pagenumber in the bottom center:

\clearpairofpagestyles
\cfoot*{- \pagemark{} -}
3
  • It looks like scrlayer-scrpage works on my thesis. What I personally need is just to move the page number from the top left to the bottom centre. I am googling around but still I didn't find anything valid and/or easy to apply. Could you suggest me anything? Commented Sep 11, 2017 at 18:46
  • 2
    \clearpairofpagestyles \cfoot*{- \pagemark{} -} should do the trick :-) read up on the fancy options of the package!
    – nhck
    Commented Sep 11, 2017 at 19:20
  • I spent an hour looking for this. Thanks a lottt:))
    – mdasari
    Commented Jan 4, 2022 at 4:15

You must log in to answer this question.

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