Page LayoutFormatting heading

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
aliiq
Posts: 1
Joined: Wed Aug 02, 2023 12:01 am

Formatting heading

Post by aliiq »

HI,
i am writing a thesis, the document class is one side, report.
I’m using fancyhdr package. i want the header shows the chapter number on the left side and the chapter name on the right side for example chapter one (one the left) and introduction (on the right).
can you help how to do that.
best,
Ali

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Formatting heading

Post by kaiserkarl13 »

I adapted this from the examples in fancyhdr's documentation, though there is one glitch in there in terms of the ordering of left and right...but this should do what you are asking:

Code: Select all

\documentclass{report}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
%\fancyhead[LE,RO]{\itshape\leftmark}
%\fancyhead[LO,RE]{\itshape\rightmark}
\renewcommand{\chaptermark}[1]{%
  \markboth{\MakeUppercase{#1}}%
           {\MakeUppercase{\chaptername~\thechapter.}}%
}

\begin{document}
\chapter{Introduction}
\lipsum[1-10]
\chapter{Hello!}
\lipsum[11-20]
\end{document}
The default is slanted text; if you want italicized text instead, uncomment the two lines above that are commented out.
chrisok
Posts: 2
Joined: Sat May 18, 2024 9:51 pm

Formatting heading

Post by chrisok »

This reply was helpful to me too.
Please want to have the following on the PDF, but do not know how to include the 1.0 to appear automatically, I rather having to enter it manually and the text is never the same size as the 1.1.

Chapter 1

\textbf{1.0 Chapter Introduction:}\\ % This line show's the 1.0
Brief Definition: Setting the stage

\section{Social Power - Brief Definition and Concepts} % This line show the 1.1 with bolded text, automatically generated for the chapter.

The body of the chapter...
chrisok
Posts: 2
Joined: Sat May 18, 2024 9:51 pm

Formatting heading

Post by chrisok »

Great and thanks to the support team for their invaluable rapid response on Overleaf.
The issue was resolved by placing the following at the beginning of each chapter, causing the chapter numbering to start at "0".
Solution:
\setcounter{section}{-1}
\section{Chapter Introduction:}

Result:
1.0 Chapter Intro:
Statement here...

1.1 Chapter heading title here...
statement and body of the chapter...
% === End result ===
Post Reply