0

I am writing my Master Thesis Report and I am trying to get my section name on the left hand top corner of the page, the chapter name on the right hand top corner of the page and the page number on the bottom center of the page. After changing the page geometry and page setup packages for the nth time, I was able to get the section name on the top left hand corner of the page, but now I am not able to get my page no. or the chapter name on the right. Is there any way around this? I would ordinarily post only my page geometry and page setup packages, but now I posted also my entire root document for your convenience. Kindly help. This is the root document that I am using.

\documentclass[twoside=false,12pt]{scrbook}    
 %twoside=false--->both pages look the  same
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00A0}{~}


%%GRAPHICS PACKAGES
%%----------------------------------------------------------------------
%%----------------------------------------------------------------------
\usepackage{graphicx}               %needed for the insertion of graphics, 
remove draft for final script.
\graphicspath{{./Images/}}            %needed for choosing the image path
\usepackage{subcaption}         %needed for allowing captioning of images
\setcapindent{0cm}                   %indents the caption borders to zero
\usepackage{float}                           %allows using [H] for images
\usepackage[font={small}]{caption} %image captions in different fonts
%\usepackage{float}
%\floatstyle{boxed} 
%\restylefloat{figure}          %defines a border for all the float images
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

%%PAGE GEOMETRY and PAGE SETUP, as in header/footer/footnote
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------
\usepackage[a4paper, bindingoffset=6mm]{geometry} 
\usepackage{fancyhdr}
\pagestyle{fancy}
%%\fancyhead{}
%%\lhead{Chapter \thechapter}
%%\rhead{}
%\renewcommand{\sectionmark}[1]{% 
%   \markboth{\thesection\quad #1}{}}
%\fancyhead{}
%\fancyhead[L]{\leftmark}
%\fancyfoot{}
%\fancyfoot[C]{\thepage}
\fancyfoot[C]{\thepage}
\cfoot{\thepage}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\fancyhf{}
\fancyhead[RE]{\chaptername~\thesection}
\fancyhead[LO]{\leftmark}
\fancyhead[LE,RO]{}
\setlength{\headheight}{15.2pt}
%\usepackage[
%automark,
%autooneside=false 
%]{scrlayer-scrpage}
%\pagestyle{scrheadings}
%\ohead{Nitish Agarwal}
%\ihead{Deployment and use of a WSN for situation detection}
%\ofoot{Master Thesis, TU Chemnitz, Embedded Systems, 2017}{}
%\ifoot[]{\thepage}
%\lhead{}
%\rhead{}
%\title{The logic behind reciprocal lattice spaces}
%\author{Chitran Ghosal}
%\date{\today}
\usepackage[bottom]{footmisc}                         %creates footnotes
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

%MATHEMATICAL PACKAGES
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------
\usepackage{amsmath,esint}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{tcolorbox}
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

%%BIBLIOGRAPHY PACKAGES
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------
%\usepackage[square, numbers]{natbib}
%\usepackage[nottoc]{tocbibind}
\usepackage[backend=bibtex,
natbib=true,
style=numeric-comp,                                 %% ursprünglicher 
Bibliothekstyle
firstinits=true,                                    %% Vornamen werden als 
Initialen Dargestellt
maxnames=10,                                            %% ab n Auroten wird 
'et al.' verwendet
doi=false,                                          %% DOI wird / wird nicht 
in Referenzen angezeigt
url=false,                                          %% URL der Quelle wird / 
wird nicht in Referenzen angezeigt
isbn=false,                                         %% ISBN wird / wird 
nicht angezeigt
sorting=none,                                       %% Quellen werden 
entsprechend ihrer ersten Verwendung im Text sortiert
]{biblatex}

\addbibresource{references.bib}             %% Einbinden des gewünschten 
Literaturverzeichnises

\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot}}         
%% 'und andere' wird zu 'et al.'
\DeclareFieldFormat[article]{title}{\mkbibemph{"#1"}\addcomma}  %% Format 
des Artikeltitels (kursiv und in " ")
\DeclareFieldFormat[article]{journaltitle}{{#1}\addcomma}       %% Format 
des Journalnamens
\DeclareNameAlias{default}{last-first}                          %% 
Autorenangabe in Form Nachname, Vorname
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}\isdot}      %% 
Laufnummer der Ausgabe des Journals fettgedruckt
\DeclareFieldFormat[article]{number}{\mkbibbold{#1}}            %% 
Nummerierung des Artikels in der entsprechenden Ausgabe auch fettgedruckt
\DeclareFieldFormat[article]{pages}{{#1}\addcomma}              %% "S." vor 
Seitenangabe für Atikel wird nicht ausgegeben
\DeclareFieldFormat[book]{title}{\mkbibemph{"#1"}\addcomma}     %% Format 
des Buchtitels (kursiv und in " ")

\renewcommand*{\labelnamepunct}{\addcolon\addspace}             %% Einfügen 
eines Doppelpunktes nach den Autoren
\renewcommand*{\multinamedelim}{\addsemicolon\space}            %% Autoren 
durch Semikolon getrennt
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}                  %% Nachnamen 
der Autoren in Kapitälchen

\renewbibmacro*{in:}{}                                          %% "in: " 
vor Journal wird nicht ausgegeben
\renewbibmacro*{journal+issuetitle}{                            %% entfernt 
Jahresangabe nach Laufnummer, da diese am Ende stehen soll (© J. Lidzba =P)
\usebibmacro{journal}%                                      %% siehe 
nächster Eintrag
\setunit*{\addspace}%                                       %%  v
\iffieldundef{series}                                       %%  v
{}                                                          %%  v
{\newunit
    \printfield{series}%
    \setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{note+pages}{                                    %% Ausgabe 
Jahr am Ende angefügt, in Klammern gesetzt (© J. Lidzba =P)
\printfield{note}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\addspace
\printfield[parens]{year}%
\newunit}

%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

%%PHYSICS AND CHEMISTRY PACKAGES
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------
\usepackage{siunitx}      %allows the use of degrees, angstrom...etc
\newcommand*\chem[1]{\ensuremath{\mathrm{#1}}}   %chemistry typesetting
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
\usepackage{braket}      %simplifies the use of the bra-ket notation
\newcommand*{\hham}{\hat{\mathcal{H}}}   %defines the hamiltonian
\usepackage{physics}               %allows the use of additional commands
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

%%PACKAGE FOR APPENDICES
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------
\usepackage[toc,page]{appendix}
%%-----------------------------------------------------------------------
%%-----------------------------------------------------------------------

\begin{document}
%\maketitle
\frontmatter
\tableofcontents
\thispagestyle{empty}
\listoffigures
\thispagestyle{empty}

\mainmatter
\input{Basics}
\input{Basics1}
%\input{char_eg}
\input{char_pthalo}
% \begin{appendices}
%\input{FourierTransform}
%\input{MoirePatterns}
%\input{superstructures}
%\end{appendices}

\backmatter
% \bibliographystyle{unsrt}
%\bibliography{references}
 \thispagestyle{empty}
 \addcontentsline{toc}{chapter}{Bibliography}
 \printbibliography
\end{document}
2

I am not sure if I understand how the desired header looks like. There are some weird things in your code.

\fancyhf{} removes all content from header and footer. If you use it after \fancyfoot[C]{\thepage} the page number is ofcourse removed from the footer.

Maybe the following helps:

\documentclass[twoside=false,12pt,english]{scrbook}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage[a4paper, bindingoffset=6mm,
  headheight=15.2pt % use geometry to change the head height
]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}% before redefinition of \chaptermark and sectionmark
\renewcommand*{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand*{\sectionmark}[1]{\markright{#1}}

\fancyhf{}% before setting the new contents of header and footer
\fancyfoot[C]{\thepage}
\fancyhead[RO]{\leftmark}
\fancyhead[LO]{\rightmark}
%\fancyhead[LE]{\leftmark}% only used if twoside=true
%\fancyhead[RE]{\rightmark}% only used if twoside=true

% page style empty in TOC, LOF, LOT and all other lists under controll of  package tocbasic
\AfterTOCHead{\thispagestyle{empty}\pagestyle{empty}}
\AfterStartingTOC{\thispagestyle{empty}}

\usepackage{blindtext}% only for dummy text

\begin{document}
\frontmatter
\tableofcontents
\listoffigures

\mainmatter
\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}

Result:

enter image description here

Note: It is recommended to use scrlayer-scrpage instead fancyhdr with a KOMA-Script class. So here is a suggestion using package scrlayer-scrpage:

\documentclass[twoside=false,12pt,english]{scrbook}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage[a4paper, bindingoffset=6mm,
  headheight=15.2pt % use geometry to change the head height
]{geometry}

\usepackage[headsepline,automark,autooneside=false]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\renewcommand*\chaptermarkformat{}% remove chapter number from header entry
\renewcommand*\sectionmarkformat{}% remove section number from header entry

\clearpairofpagestyles% before setting the new contents of header and footer
\cfoot*{\pagemark}
\ihead{\rightmark}
\ohead{\leftmark}
\addtokomafont{pageheadfoot}{\upshape}

% page style empty in TOC, LOF, LOT and all other lists under controll of  package tocbasic
\AfterTOCHead{\thispagestyle{empty}\pagestyle{empty}}
\AfterStartingTOC{\thispagestyle{empty}}

\usepackage{blindtext}% only for dummy text

\begin{document}
\frontmatter
\tableofcontents
\listoffigures

\mainmatter
\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\Blinddocument\Blinddocument
\end{document}
  • Thanks a lot. Works like a charm for me, but is there any way that I can remove the header for my last bibliography chapter. Since there are no sections in the bibliography chapter, hence it prints Bibliography on the left and right edges of the header. I would have it only on the left or have no header at all in that chapter. – ubuntu_noob Jan 26 '18 at 16:05
  • 1
    Use \clearpage\pagestyle{plain}\printbibliography to remove the header at all. To avoid the same header entry on left and right side of the page header replace either \rightmark by \ifstr{\rightmark}{\leftmark}{}{\rightmark} or \leftmark by \ifstr{\leftmark}{\rightmark}{}{\leftmark}. – esdd Jan 27 '18 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.