2
votes

I need help with page headers in latex. I'm using fancyhdr to define page header. That works on all pages except first page of bibliography(references). Since there are three pages of references, only first is missing the header, the other two are ok. I'm generating references like so:

%\clearpage
%\pagestyle{plain}
%\thispagestyle{fancy}
\renewcommand{\bibname}{Literatura in viri}
\bibliographystyle{abbrv}
\bibliography{library}
%\pagestyle{fancy}

I have tried all possible permutations of lines that are commented out to no avail.

library is bib file auto generated by Mendeley.

If I use

\begin{thebibliography}{99}
   \thispagestyle{fancy}
     \bibitem{Blum}  somethingorother
\end{thebibliography}

the problem dissapears, but I don't want to add 30+ references manually.

Can anyone help me?

2

2 Answers

2
votes

problem has been solved like so:

\fancypagestyle{plain}{}
\renewcommand{\bibname}{Literatura in viri}
\bibliographystyle{abbrv}
\bibliography{library}

For some reason, Latex uses special pagestyles for some commands, for example bibliography uses pagestyle{plain}, and function \fancypagestlye{arg1}{arg2} lets you modify style arg1 with arg2. I dunno if that made any sense but more info can be found at this link under chapter 7. Redefining plain style

0
votes

The answer of Tawcharowsky worked for me. Offroad gave a similar answer on https://latex.org/forum/viewtopic.php?t=22727 which helped me. I added some comments to the proposed code snippets:

\bibliographystyle{abbrv} % I used apalike instead
\fancypagestyle{plain}{}
\renewcommand{\bibname}{Bibliography} % "Bibliography" will be the title
\bibliography{library} % "library.bib" is your bib file