TransWikia.com

While using fancy header, when using chapter*, header takes previous chapter heading

TeX - LaTeX Asked on March 7, 2021

I want to change the font style of right header. while using chapter*, right header show the chapter heading of the previous chapter.

documentclass[12pt]{scrreprt}

usepackage{booktabs}
usepackage[explicit]{titlesec}
usepackage{tikz}
usetikzlibrary{calc}

DeclareFixedFont{chapternumberfont}{T1}{ppl}{m}{n}{1.5in}

newcommandbrectangles{%
begin{tikzpicture}[overlay, remember picture]
fill[red!60!blue!50!green!120]%[red!60!blue!50!green!150]% 
  (current page.north west) rectangle ( $ (current page.north east) + (0,-7cm) $);
fill[red!60!blue!50!green!120]%[red!60!blue!50!green!150]% 
  (current page.south west) rectangle ( $ (current page.south east) + (0,3cm) $);
end{tikzpicture}%
}

titleformat{chapter}[display]
  {Largebfseriesssfamilycolor{white}}%scshape
  {thispagestyle{empty}brectangles}
  {-2in}
  {%
  vskip-4exfilcenter {smallMakeUppercase{Project on Compilation of...}}[2ex]
  parbox[b]{.65linewidth}{#1}%
  raisebox{0.8in}{parbox{.15linewidth}{largechaptertitlename}}%
  parbox[b]{.2linewidth}{chapternumberfontthechapter}%
  }
  [vspace*{1in}]

titleformat{name=chapter,numberless}[display]
  {Hugebfseriescolor{white}} %sffamily
  {thispagestyle{empty}brectangles} 
  {-2in}
  {parbox[b]{.65linewidth}{#1}}
  [vspace*{1in}]


% for fancy header & footer
usepackage{xcolor}%
usepackage{fancyhdr}
pagestyle{fancy}
lhead{Statistics}
lfoot{ LHS }
rfoot{includegraphics[width=20pt]{logo}}
renewcommand{headrulewidth}{1pt}
renewcommand{footrulewidth}{1pt}


%for quotes
usepackage{csquotes}

% for hyperrefrences
usepackage{url}
usepackage[linktoc=all]{hyperref}
hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=blue
}

% for line spacing
renewcommand{baselinestretch}{1.15}

%for indenting paragraphs
setlength{parskip}{1em}

%for drop caps
% works with pdfLaTeX
usepackage{type1cm} % scalable fonts
usepackage{lettrine}

% FOR CALLIGRAPHIC FONTS
usepackage{calligra}
usepackage[T1]{fontenc}

renewcommand{arraystretch}{2}

begin{document}

tableofcontents

pagenumbering{roman}

pagestyle{empty}% no page numbers

pagestyle{plain}

pagestyle{fancy}

pagenumbering{arabic}

chapter {Introduction}

clearpage

section{Right header is in capitals, how to change in normal font}

section {Background}

chapter*{Appendicies}

addcontentsline{toc}{chapter}{Appendicies}

section*{Appendix-W.R}

addcontentsline{toc}{section}{Appendix-Workers' Remitances}

clearpage

newpage

section{Ahmad}

end{document}

2 Answers

You're using appendices in the wrong way, and this is causing you problems, hence the need for all your addcontentsline faff. When you've finished your normal chapters, put the appendix command. Then carry on making more chapters and sections as before. Chapters in the appendix will be labelled as A, B, etc, and the sections will be labelled A.1, A.2, B.1 and so on.

Code

chapter {Introduction}

clearpage

section{Right header is in capitals, how to change in normal font}

section {Background}

appendix

chapter{Appendix-Workers' Remitances}

section{Ahmad}

section{Ahmad again}

chapter{Ahmad yet again}

section{Ahmad once more}

Output

enter image description here

Correct answer by John Wickerson on March 7, 2021

Late answer, just simply add:

chapter*{Introduction}
markboth{}{Introduction}

Answered by Edgar on March 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP