LaTeX forum ⇒ Theses, Books, Title pagesThe \rightmark in fancyhdr is recognized as chapter Topic is solved

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

The \rightmark in fancyhdr is recognized as chapter

Postby templateuser » Mon Mar 30, 2015 1:16 pm

Hi,

I changed the document from to "twopage". I would like at the header to appear the chapter name on the one page and the section name on the other (this is the default fancyhdr style I think). But the \rightmark is not recognized as section but as chapter, just like the \leftmark.

I tried to add a new command and use it insted of \rightmark:

  1. \renewcommand{\sectionmark}[1]{ \markright{#1}{} }


But an error appears when the first subsesection appears.

Are there any ideas how to solve this problem?

Thank you.

elinach

Tags:

User_2015
Posts: 1
Joined: Thu May 28, 2015 4:39 pm

Postby User_2015 » Thu May 28, 2015 4:50 pm

Hi,

It is important to note that in every chapter and corresponding file, the header is overwritten (\lhead). This has to be removed.

I worked for me, when i used the following in Thesis.cls
  1. \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\thechapter\ #1}{}}
  2. \renewcommand{\sectionmark}[1]{\btypeout{\thesection\space #1}\markright{\thesection\ #1}}


And in main.tex added:
  1. \pagestyle{fancy} % Return the page headers back to the "fancy" style
  2. \lhead[\rm\thepage]{\fancyplain{}{\sl{\leftmark}}}
  3. \rhead[\fancyplain{}{\sl{\rightmark}}]{\rm\thepage}


before the chapters are loaded
  1. \input{Chapters/Chapter1}


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 1 guest