I'm using fancyhdr
and I want to have the header with chapters name without number opposite to section name. I've tried a lot of configurations, but none works with in this case.
How could be fixed?
ps: This short document has a different style in the Chapter page, but in the real document this is fixed.
\documentclass[11pt,a4paper,twoside,titlepage,openany]{book}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage{amsfonts}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage[italian]{babel}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{sectsty}
\usepackage{geometry}
\geometry{
left=35mm,
right=30mm,
top=27mm,
bottom=30mm
}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand\headrulewidth{0.4pt}
\renewcommand\footrulewidth{0.4pt}
\fancyhead[LE,RO]{\rightmark}
\fancyhead[LO,RE]{\chaptermark}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\fancyfoot[LE,RO]{\thepage} % Left side on Even pages; Right side on Odd pages
\begin{document}
\chapter{Chapter Intro}
\lipsum
\chapter{Chapter with subsections}
\section{section foo}
\lipsum
\subsection{subsection bar}
\lipsum
\end{document}
Best Answer
With
each chapter sets the left mark to the chapter name. So you have to use
to get the desired result.
Code:
If there are some starred chapters which should get a header entry too, use
\markboth
manually. Example:Of course you can define a macro to do that.