0

I'm writing my thesis (i choose report class) and I'd like to have chapters looking like this:

1 Introduction

I mean I want only chapter number and title in one line. Furthermore I'd like the left header as section number and title and right header chapter number and title on each page the same, something like this:

left header: 1.2 ANTIMOCOTIC DRUGS

right header: CHAPTER 1. INTRODUCTION

I know that I can do this with fancyhdr package, but I dont know to put this section and chapters names.

4
  • For headers, use option twoside and \pagestyle{headings}. Your chapter format is the default of KOMA-Script classes. Maybe you can try its reportlike class: \documentclass[twoside]{scrreprt}.
    – jlab
    Commented Mar 10 at 9:28
  • @jlab I interpret left header and right header different (because of on each page the same). If I'm right, twoside would not be needed. But maybe I'm wrong.
    – cabohah
    Commented Mar 10 at 10:06
  • You right. I misunderstood your request.
    – jlab
    Commented Mar 10 at 10:59
  • IMHO these are two questions in one. The first can already be found answered here. Usually you should not mix several problems to one question but focus to a single problem per question. For two problems you should ask two question. And it is recommended to always add a minimal working example to the question, that makes it possible to reproduce the problem.
    – cabohah
    Commented Mar 10 at 15:02

2 Answers 2

1

It is not absolutely clear whether “left header” means the left aligned header or header of left pages. Because you write, “on each page the same”, I think you mean the first. And I also guess, that you want the page header also on chapter starting pages. So with the KOMA-Script report class scrreprt this would be, for example:

\documentclass{scrreprt}

\usepackage[automark,autooneside=false,markcase=upper]{scrlayer-scrpage}
\ihead{\rightbotmark}
\chead{}
\ohead{\leftmark}
\renewcommand*{\chaptermarkformat}{\chapapp~\thechapter. }
\renewcommand*{\chapterpagestyle}{headings}% If chapter pages should also use
                                % running heads

\usepackage{mwe}% for demonstration only

\begin{document}
\chapter{Introduction}
\lipsum[1]
\section{Whatever}
\lipsum[2]
\section{Antimocotic drugs}
\lipsum[3-5]
\end{document}

with scrreprt + scrlayer-scrpage

If you don't want the slanted font in the page header just add:

\setkomafont{pageheadfoot}{}

to the document preamble.

See the KOMA-Script manuals for more information about scrlayer-scrpage and all the other commands. And please also try out what happens, if you remove options or commands.

The KOMA-Script author also provides additional information and examples about how change the head and foot of the page in English and in German and also about how to change headings of parts, chapters, section etc. in English and in German.

You can get something similar with the standard class report additionally using package titlesec:

\documentclass{report}

\usepackage{titlesec}
\titleformat{\chapter}
  {\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

\usepackage[automark,autooneside=false,markcase=upper]{scrlayer-scrpage}
\ihead*{\rightbotmark}% star version to use the same on plain pages, e.g., chapter starting pages
\chead{}
\ohead*{\leftmark}

\usepackage{mwe}% for demonstration only

\begin{document}
\chapter{Introduction}
\lipsum[1]
\section{Whatever}
\lipsum[2]
\section{Antimocotic drugs}
\lipsum[3-5]
\end{document}

with report + titlesec + scrlayer-scrpage

With report and alternative to scrlayer-scrpage would be using fancyhdr:

\documentclass{report}

\usepackage{titlesec}
\titleformat{\chapter}
  {\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

\usepackage{fancyhdr}
\fancyhead[L]{\slshape\LastMark{2e-right}}
\makeatletter\let\ps@plain\ps@fancy\makeatother% make plain pages (e.g. chapter starting pages) the same like fancy
\renewcommand*\headrulewidth{0pt}
\pagestyle{fancy}

\usepackage{mwe}% for demonstration only

\begin{document}
\chapter{Introduction}
\lipsum[1]
\section{Whatever}
\lipsum[2]
\section{Antimocotic drugs}
\lipsum[3-5]
\end{document}

report + titlesec + fancyhdr

To remove the dot after the section number in the page header (as shown in your question), you would additionally need:

\renewcommand*{\sectionmark}[1]{\markright{\MakeUppercase{\thesection\ #1}}}

with both report solutions.

0

EDIT: Chapter title added

In fact, if you use the report documentclass with fancyhdr, this is the default header layout you get.

For the chapter title I recommend the titlesec package, see the code.

\documentclass{report}

\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}

\usepackage{titlesec}
\titleformat{\chapter}[hang]
{\bfseries\huge} % this defines the font for the chapter title
{\thechapter} % chapter number, may be followed by punctuation if desired
{0.5em} % amount of white space between chapter number and title
{}

\begin{document}
\chapter{Introduction}

\lipsum

\section{Introduction}

\lipsum

\section{Antimocotic Drugs}

\lipsum

\end{document}

enter image description here

enter image description here

4
  • This IMHO answers only the second part of the question but not how to get chapter titles without "Chapter 1" line, but as "1 Title".
    – cabohah
    Commented Mar 10 at 14:56
  • You said you wanted "right header: CHAPTER 1. INTRODUCTION". So do you mean it should actually be "right header: 1. INTRODUCTION" or would you like "1. Introduction", i.e. without all caps? Commented Mar 10 at 15:02
  • You don't mean me. However see in the question the part before "furthermore". This is IMHO about the chapter title itself not the page header.
    – cabohah
    Commented Mar 10 at 15:04
  • OK, I have added that part. Commented Mar 10 at 15:28

You must log in to answer this question.

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