Just as it says in the title, my header and footer randomly disappear after my second numbered page.
This is my preamble:
% !TeX spellcheck = hr_HR
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[
backend=bibtex % biber or bibtex
,style=numeric-comp % numerical-compressed
,sorting=none % no sorting
,sortcites=true % some other example options ...
,block=none
,indexing=false
,citereset=none
,isbn=true
,url=true
,doi=true % prints doi
,natbib=true % if you need natbib functions
]{biblatex}
\addbibresource{bibliografija.bib}
\nocite{*}
\usepackage{fancyhdr}
\usepackage{indentfirst}
\usepackage{setspace}
\usepackage[croatian]{babel}
\ifx\l@croatian\@undefined
\@nopatterns{Croatian}
\adddialect\l@croatian0\fi
\captionscroatian
\usepackage{graphicx}
\graphicspath{ {img/} }
\renewcommand{\contentsname}{Sadržaj}
\title{MVC arhitektura unutar AngularJS razvojnog okvira}
\author{Marko Klobučar}
\date{Lipanj, 2017.}
The commands I issued to start the header and footer are as follow:
\pagestyle{fancy}
\fancyhf{}
\lhead{Sveučilište Sjever - Multimedija, oblikovanje i primjena}
\rhead{Marko Klobučar}
\rfoot{Stranica \thepage~od~\pageref{lastpage}}
\pagenumbering{arabic}
And all is well for a whole two pages. And then suddenly the header and footer vanish on my 6th actual, but 3rd numbered page.
I am terribly sorry if this has been answered before, I searched for an hour now and I couldn't find what I was looking for. I am also a complete beginner with Latex, and would appreciate any help.
Thank you in advance! Please, let me know if I should include something I forgot.
EDIT: Here's the small-ish document.
% !TeX spellcheck = hr_HR
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
%\usepackage[
% backend=bibtex
%]{biblatex}
% \addbibresource{bibliografija.bib}
% \nocite{*}
\usepackage{fancyhdr}
\usepackage{indentfirst}
\usepackage{setspace}
\usepackage[croatian]{babel}
\ifx\l@croatian\@undefined
\@nopatterns{Croatian}
\adddialect\l@croatian0\fi
\captionscroatian
\usepackage{graphicx}
\graphicspath{ {img/} }
\renewcommand{\contentsname}{Sadržaj}
\title{Title}
\author{Me}
\date{Now}
\begin{document}
\pagestyle{empty}
\pagenumbering{gobble}
\begin{titlepage}
\maketitle
\end{titlepage}
\newpage
\tableofcontents
\newpage
\begin{spacing}{1.5}
\section*{Lorem ipsum.}
Lorem ipsum.
\newpage
\pagestyle{fancy}
\fancyhf{}
\lhead{Header left}
\rhead{John Doe}
\rfoot{Page \thepage~of~\pageref{lastpage}}
\pagenumbering{arabic}
\section{Sažetak}
Lorem ipsum dolor sit amet.
\newpage
\section{Uvod}
Lorem ipsum dolor sit amet.
\newpage
\section{Trouble!}
\subsection{This part is messed up.}
This section is where the header and footer disappear.
\subsection{Lorem ipsum.}
Lorem ipsum.
\end{spacing}
\newpage
\section{Popis literature}
\label{lastpage}
\vspace*{-1cm}
% \printbibliography[title=~]
\end{document}
Best Answer
Here are two possible simple codes:
{spacing}{1.5}
environment, and you have to put the last\newpage
command just before\end{spacing}
, and repeat\pagestyle{fancy}
right after,\onehalfspacing
command, and replace\end{spacing}
with\singlespacing
.Here are the codes for the relevant part:
With the environment:
With the commands: