I am playing around with a cookbook template that I found here. It works great and has some nifty features, but I am having trouble with one part. The header and footer parts that tell you about the cooking time and if it is V or F do not disappear until a new recipe is called. This means that if you have text in between two recipes, the headers just keep popping up. See images below for example.
So I would like there not to be any header/footer on pages 3 and 4, is tehre some easy way to flush those away?
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{multicol}
\usepackage[%
%a5paper,
papersize={5.5in,8.5in},
margin=0.75in,
top=0.75in,
bottom=0.75in,
%twoside
]{geometry}
\usepackage{xcolor}
\usepackage{graphicx}
\raggedcolumns
\setlength{\multicolsep}{0pt}
\setlength{\columnseprule}{1pt}
\makeatletter
\newif\if@mainmatter @mainmattertrue
%% Borrowed from book.cls
\newcommand\frontmatter{%
\cleardoublepage
@mainmatterfalse
\pagenumbering{roman}}
\newcommand\mainmatter{%
\cleardoublepage
@mainmattertrue
\pagenumbering{arabic}}
\makeatother
\newcommand{\SubItem}[1]{
{\setlength\itemindent{15pt} \item[-] #1}
}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
%% Vary the colors at will
\definecolor{vegcolor}{rgb}{0,0.5,0.2}
\definecolor{frzcolor}{rgb}{0,0,1}
\usepackage{recipes}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
Write stuff
\clearpage
\recipe[text]{Raspberry Chocolate Tiramisu}
\serves{4}
\preptime{2 hour}
\cooktime[Chill time]{11/2 hours}
\vegetarian
\freeze
\begin{ingreds}
100ml Double Strength Coffee
400g Raspberries (blitzed)
200g Mascarpone
2 tbsp Sweetener
1 tsp Vanilla Extract
700g Vanilla Yogurt
15g Dark Chocolate (finely grated) and a really long one
\columnbreak
\ingredients[For the Crumble Mixture:]
80g Wholemeal Flour
80g Plain Flour
80g Butter (diced)
70g Demerara Sugar
\end{ingreds}
\begin{method}[Preheat the oven to Gas Mark 4, Electric \temp{180}, Fan \temp{160}.]
Stir the two kinds of flour together in a bowl, add the butter and rub it into the flour. When the mixture looks like breadcrumbs, mix in the brown sugar. Lay the mixture on a shallow baking tray and bake for 25--30 minutes until golden brown. Leave on the side to cool.
Mix together the mascarpone, sweetener, vanilla extract, and three quarters of the chocolate. Put half the crumble mixture in each of the glasses and pour over half the quark mixture along with half the raspberries.
Put the other half of the crumble mixture on top, followed by the remaining quark mixture and raspberries. Sprinkle over the last of the chocolate. Chill for 3 hours before serving.
\end {method}
\showit[1.25in]{example-image-b}{This is a picture}
\clearpage
\section{a new chapter that has the same headings}
\clearpage
Same for this page!
\recipe[This is a simple headnote that describes the product for the user. A simple but elegant dessert.]{This new recipe does not have it though!}
\end{document}
recipes.sty
% Your "recipes.sty" package starts here:
%% Thanks to alephzero for the excellent start:
\newcommand{\recipe}[2][]{%
\newpage
\lhead{}%
\chead{}%
\rhead{}%
\lfoot{}%
\rfoot{}%
\subsection{#2}%
\if###1##%
\else
\begin{center}
\parbox{0.75\linewidth}{\raggedright\itshape#1}%
\end{center}
\fi
}
\newcommand{\serves}[2][Serves]{%
\chead{#1 #2}}
\newcommand{\vegetarian}{%
\rhead{\large\color{vegcolor}\textbf{V}}}
\newcommand{\freeze}{%
\lhead{\large\color{frzcolor}\textbf{F}}}
%% Optional arguments for alternate names for these:
\newcommand{\preptime}[2][Prep time]{%
\lfoot{#1: #2}%
}
\newcommand{\cooktime}[2][Cook time]{%
\rfoot{#1: #2}%
}
\newcommand{\temp}[1]{%
$#1^\circ$C}
%% Optional argument is the width of the graphic, default = 1in
\newcommand{\showit}[3][1in]{%
\begin{center}
\bigskip
\includegraphics[width=#1]{#2}%
\par
\medskip
\emph{#3}
\par
\end{center}%
}
%% Optional argument for a heading within the ingredients section
\newcommand{\ingredients}[1][]{%
\if###1##%
{\color{red}\Large\textbf{Ingredients}}%
\else
\emph{#1}%
\fi
}
%% Use \obeylines to minimize markup
\newenvironment{ingreds}{%
\parindent0pt
\noindent
\ingredients
\par
\smallskip
\begin{multicols}{2}
\leftskip1em
\rightskip0pt plus 3em
\parskip=0.25em
\obeylines
\everypar={\hangindent2em}
}{%
\end{multicols}%
\medskip
}
\newcounter{stepnum}
%% Optional argument for an italicized pre-step
%% Also use obeylines to minimize markup here as well
\newenvironment{method}[1][]{%
\setcounter{stepnum}{0}
\noindent
{\color{red}\Large\textbf{Instructions}}%
\par
\smallskip
\if###1##%
\else
\noindent
\emph{#1}
\par
\fi
\begingroup
\parindent0pt
\parskip0.25em
\leftskip2em
\everypar={\llap{\stepcounter{stepnum}\hbox to2em{\thestepnum.\hfill}}}
}{%
\par
\endgroup}
\pagestyle{fancy}
% End of "recipes.sty"

