Document ClassesBook Class Header

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Mikerada6
Posts: 42
Joined: Fri Oct 17, 2008 5:55 pm

Book Class Header

Post by Mikerada6 »

How do i make the header on the left page read the Part number and the name of the Part?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Book Class Header

Post by Stefan Kottwitz »

Hi,

you could use the fancyhdr package for that purpose, have a look at its documentation.

Stefan
LaTeX.org admin
Mikerada6
Posts: 42
Joined: Fri Oct 17, 2008 5:55 pm

Book Class Header

Post by Mikerada6 »

i tried look at that but i am confused as to what i should put as

Code: Select all

\fancyhead[LO,RE]{\part \partname}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Book Class Header

Post by Stefan Kottwitz »

Chapters and sections in headers are well-supported, better than parts.
You could create a \partmark macro (using \markboth) and call it after each \part command:

Code: Select all

\newcommand\partmark[1]{\markboth{Part\ \thepart\ #1}{}}
...
\part{Title of the part}\partmark{Title of the part}
Stefan
LaTeX.org admin
Mikerada6
Posts: 42
Joined: Fri Oct 17, 2008 5:55 pm

Book Class Header

Post by Mikerada6 »

this is what i have but it seems to just but the Problem in both sides of the margin. I would like the problem number on the right pags and project number on the left pages

Problem is the renamed Chapter
Project is the renaned Part

Code: Select all

\documentclass[openright]{book}
\usepackage{amsfonts}
\usepackage{multirow}
\usepackage{latexsym}
\usepackage{enumerate}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{graphics}
\usepackage{grffile}
\usepackage{fancyhdr}
\pagestyle{fancy}
\newtheorem{thm}{Theorem}
\renewcommand*\partname{Project}
\renewcommand*\chaptername{Problem}
\renewcommand{\contentsname}{Table of Contents}
\newcommand\partmark[1]{\markboth{Part\ \thepart\ #1}{}}
\newtheorem{note}{\textsuperscript{note:}}
\makeindex
\begin{document}
\author{Michael Radaszkiewicz\\Michael Papetti\\Nil Choudhury\\Aktaru Zzaman}
\title{DIFFERENTIAL EQUATIONS - MATH 3328}
\date{\today}
\maketitle
\tableofcontents
\part[Existence and uniqueness]{Slope fields. Separation of Variables.  Existence and uniqueness}\partmark{Existence and uniqueness}
\include{p1}
\part[Linearization]{The phase line. Linearization. Bifurcations.  Linear Equations}\partmark{Linearization}
\include{p2}
\part[Systems of equations]{Systems of equations.}\partmark{Systems of equations}
\include{p3}
\part[Systems of equations]{Systems of equations. II}\partmark{Systems of equations}
\include{p4}
\part[Systems of equations]{Systems of equations, III. Second-order equations.}\partmark{Systems of equations}
\include{p5}
\part[Oscillations]{Forced oscillations. Beats. Resonance}\partmark{Oscillations}
\include{p6}
\part[Linearization]{Linearization and Hartman’s Theorem}\partmark{Linearization}
\include{p7}
\part[Periodic solutions]{Global analysis. Periodic solutions. Hamiltonian systems}\partmark{Periodic solutions}
\include{p8(2)}
\part[Gradient systems]{Lyapunov stability. Gradient systems}\partmark{Gradient systems}
\include{p9}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Book Class Header

Post by Stefan Kottwitz »

Then try this instead:

Code: Select all

\newcommand\partmark[1]{\markboth{\partname\ \thepart\ #1}{}}
\renewcommand\chaptermark[1]{\markright{\chaptername\ \thechapter\ #1}}
\fancyhead{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
Stefan
LaTeX.org admin
Mikerada6
Posts: 42
Joined: Fri Oct 17, 2008 5:55 pm

Re: Book Class Header

Post by Mikerada6 »

That worked thank you so very much
Post Reply