0

I have a minimal example here that creates lowercase headings.

\documentclass[12pt, a4paper, oneside, onecolumn]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[round]{natbib}

\usepackage{lipsum, filecontents}
\usepackage{fancyhdr}

\pagestyle{fancy}

\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\newcommand{\plainplain}{%
  \fancypagestyle{plain}{%
      \renewcommand{\headrulewidth}{0pt}
      \fancyhead[LO]{}
      \fancyhead[RE]{}
}}
\newcommand{\myplain}{%
  \fancypagestyle{plain}{%
    \fancyhead[LO]{\bfseries\rightmark}
    \fancyhead[RE]{\bfseries\leftmark}
    \renewcommand{\headrulewidth}{0.5pt}
    }}

\plainplain
\pagestyle{plain}

\begin{document}

\frontmatter
\pagenumbering{Roman}

\tableofcontents
\clearpage

\listoffigures
\clearpage

\chapter*{Abkürzungsverzeichnis}
\lipsum[1-4]
\clearpage

\listoftables
\clearpage

\mainmatter % implies arabic pagenumbering
\myplain
\pagestyle{plain}

\chapter{Introduction}
\lipsum[1-7]

\section{New Section}
\lipsum[8-14]

\clearpage
\plainplain
\pagestyle{plain}

\backmatter
\pagenumbering{roman}
\setcounter{page}{5}

\nocite{mybook1}

\bibliographystyle{plainnat}

\begin{filecontents}{bibliography.bib}
@book{mybook1,
    title = {Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
    author = {myauthor},
    year = {2010}
}
\end{filecontents}

\bibliography{bibliography}
\end{document}

If you instead comment out the first \pagestyle{fancy}, some of the section headlines become uppercase. Here is the same code again, but \pagestyle{fancy} is removed.

\documentclass[12pt, a4paper, oneside, onecolumn]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[round]{natbib}

\usepackage{lipsum, filecontents}
\usepackage{fancyhdr}

% \pagestyle{fancy}

\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{%
\markright{\thesection\ #1}}
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % space for the rule
\newcommand{\plainplain}{%
  \fancypagestyle{plain}{%
      \renewcommand{\headrulewidth}{0pt}
      \fancyhead[LO]{}
      \fancyhead[RE]{}
}}
\newcommand{\myplain}{%
  \fancypagestyle{plain}{%
    \fancyhead[LO]{\bfseries\rightmark}
    \fancyhead[RE]{\bfseries\leftmark}
    \renewcommand{\headrulewidth}{0.5pt}
    }}

\plainplain
\pagestyle{plain}

\begin{document}

\frontmatter
\pagenumbering{Roman}

\tableofcontents
\clearpage

\listoffigures
\clearpage

\chapter*{Abkürzungsverzeichnis}
\lipsum[1-4]
\clearpage

\listoftables
\clearpage

\mainmatter % implies arabic pagenumbering
\myplain
\pagestyle{plain}

\chapter{Introduction}
\lipsum[1-7]

\section{New Section}
\lipsum[8-14]

\clearpage
\plainplain
\pagestyle{plain}

\backmatter
\pagenumbering{roman}
\setcounter{page}{5}

\nocite{mybook1}

\bibliographystyle{plainnat}

\begin{filecontents}{bibliography.bib}
@book{mybook1,
    title = {Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.},
    author = {myauthor},
    year = {2010}
}
\end{filecontents}

\bibliography{bibliography}
\end{document}

I thought that \pagestyle{fancy} would be unnecessary there because the pagestyle is later defined to be \pagestyle{plain} and plain itself is redefined. Why do I have to set the pagestyle to something that I do not use at all when configuring fancyhdr?

lockstep
  • 250,273
Xiphias
  • 1,233
  • 1
    \pagestyle{fancy} doesn't only set the page style, but also prepares LaTeX to using newly defined styles. Why are you redefining the plain style? It's better to have different names for different styles. – egreg Feb 04 '14 at 18:12
  • @egreg Thank you. I am redefining it because I have a guideline, which says that every page of the bibliography has to contain a single lowercase roman letter. As the bibliography uses the plain style by default and I do not know how to change that, I rewrote plain. Every other approach led to strangely formatted pages after the first bibliography page. – Xiphias Feb 04 '14 at 18:13
  • Where did you read that the bibliography uses the plain style? It's simply untrue. – egreg Feb 04 '14 at 18:30
  • This now feels like stabbing someone who helped from behind --- this question originated from another one that was answered by someone here on stackexchange. He said: "\pagestyle changes the default page style for all pages from that point on which don't have a special configuration. (The first page of chapters use a non-default style unless you redefine the command. Usually, plain. So to change that, you'd redefine the plain style e.g. \fancypagestyle{plain}{...}." Although you are probably right, as in your solution my chapter-first-pages changed, he made a point somehow ...? – Xiphias Feb 04 '14 at 18:40
  • 1
    The first page! – egreg Feb 04 '14 at 18:43
  • Right, the first page is the one in question, the others behave correctly. – Xiphias Feb 04 '14 at 18:56
  • This now converges with another question here, because we are talking about whether or not to redefine plain: http://tex.stackexchange.com/questions/158563/why-does-the-setspace-package-change-my-fancyhdr-design/158570?noredirect=1#comment361887_158570 – Xiphias Feb 04 '14 at 19:00
  • @Tobias: So can we close this question to be a duplicate of Why does the setspace package change my fancyhdr design?? – Werner Jul 17 '14 at 23:52
  • Yes, please. That would be great. – Xiphias Jul 20 '14 at 12:43

0 Answers0