1

I attach the minimal working example of my issue:

\documentclass[12pt, a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\tiny\thepage} %Left even page, right odd page
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\space#1}{}}
\fancyhead[CE]{\tiny\leftmark} %Center even page
\fancyhead[CO]{\tiny\rightmark} %Center odd page

\newcommand{\param}{$\surd\bar{a}/K\surd\bar{l}$ }
%I really need that dot at the and of X.Y section number
\renewcommand\thesection{\normalsize \thechapter.\arabic{section}.}

\begin{document}

%Chapter title
\chapter{VERY IMPORTANT CHAPTER}
%Chapter header title
\chaptermark{IMPORTANT CHAPTER}

\section{\normalsize My new section}

\newpage

Even page- I like it.

\newpage

Odd page- I don't like the header.

\end{document}

Now, what I want to have is the section title and section number written in \normalsize in the main body of the text. At the same time, I require \tiny size for the section title and number in the header. You may also notice double dot at the end of number of the section in the header. I do not know how to get rid of that. I have tried \fancyhead[CO]{\thesection\sectionname} in the preamble, but it did not do any good.

2 Answers 2

1

Your problem comes from incorporating \normalsize to the argument of \section: it is included in rightmark, thus overwriting the \tiny specification of fancyhdr. I also took the liberty to replace your hyphen dashes with more relevant endashes.

Here is a simple solution with \titlesec:

\documentclass[12pt, a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\tiny\thepage} %Left even page, right odd page
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\space#1}{}}
\fancyhead[CE]{\tiny\leftmark} %Center even page
\fancyhead[CO]{\tiny\rightmark} %Center odd page

\newcommand{\param}{$\surd\bar{a}/K\surd\bar{l}$ }
%I really need that dot at the and of X.Y section number
\usepackage{titlesec}
\titleformat*{\section}{\normalsize\bfseries}
\titlelabel{\thetitle. }

\begin{document}

%Chapter title
\chapter{VERY IMPORTANT CHAPTER}
%Chapter header title
\chaptermark{IMPORTANT CHAPTER}

\section{My new section}

\newpage

Even page -- I like it[![enter image description here][1]][1].

\newpage

Odd page -- I like the header.

\end{document} 

enter image description here

enter image description here

4
  • Yes, we're almost there but we lost dot at the end of section numbering in the main body of the book. I want to have 1.1. My new section both in the main text and in the header, but different sizes. Nov 11, 2015 at 18:19
  • Oh! Sorry, I forgot about the dot. I'll change the code in a moment, but it's easy with titlesec. Do you want this dot in the header too?
    – Bernard
    Nov 11, 2015 at 18:23
  • Yes, but only one dot, like 8.3., not 8.3... Nov 11, 2015 at 18:29
  • Here you are, Mylord.
    – Bernard
    Nov 11, 2015 at 18:32
0

Size \tiny seems too small, but it's your document, not mine.

Don't use explicit font commands in titles, use a higher level package like sectsty. For the dot after the number, redefine \@seccntformat.

\documentclass[12pt, a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{sectsty}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\tiny\thepage} %Left even page, right odd page
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead[CE]{\tiny\leftmark} %Center even page
\fancyhead[CO]{\tiny\rightmark} %Center odd page

\sectionfont{\normalsize\bfseries}

\makeatletter
\renewcommand\@seccntformat[1]{%
  \csname the#1\endcsname.\quad
}
\makeatother

\begin{document}

%Chapter title
\chapter{VERY IMPORTANT CHAPTER}
%Chapter header title
\chaptermark{IMPORTANT CHAPTER}

\section{My new section}

\newpage

Even page- I like it.

\newpage

Odd page- I don't like the header.

\end{document}

enter image description here

You must log in to answer this question.

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