0

I am trying to write a document with bibliography (bibliografia) and thanks (ringraziamenti) into two different chapters. The thing is, titles inside the headers are wrong but I don't know why.

Can you help me please?

Here's my code:

\addcontentsline{toc}{chapter}{Bibliografia}
\begin{thebibliography}{9}
\label{cap:bibliografia}

\bibitem{bk} 
blablabla

\bibitem{con} 
blablabla

\bibitem{decu} 
blablabla

\end{thebibliography}




\addcontentsline{toc}{chapter}{Ringraziamenti}
\chapter*{Ringraziamenti}
\label{cap:ringraziamenti}

Thank you to who can help me :)

The result should be "Bibliografia" upon the bibliography page and "Ringraziamenti" upon the thanks page, but I get "Bibliografia" upon the bibliography page and (again!) "Bibliografia" upon the thanks page

5
  • \addcontentsline add something to the table of content, not to the header. You need a \markboth command for this. And better add a \clearpage or \cleardoublepage before \addcontentsline if you don't want it to point to the wrong page. Jun 25, 2020 at 15:06
  • Did you try writing \addscontentsline{toc}[chapter}{Ringraziamenti}` after \chapter*{Ringraziamenti}?
    – Bernard
    Jun 25, 2020 at 15:07
  • Hi! I tried both your suggestions, but didn't work. Also, if I look at the table of the contents page, it puts the wrong page number to both my chapters... Jun 25, 2020 at 15:16
  • @hellomynameisA check my answer bellow.
    – Pedro
    Jun 25, 2020 at 15:58
  • \usepackage[nottoc]{tocbibind} will do the job with no \addcontentsline.
    – egreg
    Jun 25, 2020 at 16:28

1 Answer 1

1

Here is a solution and the MWE:

enter image description here

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}

\begin{document}

\chapter*{Ringraziamenti}
\label{cap:ringraziamenti}
I want to thank...

\tableofcontents{}

\chapter{Editing compile}

\section{First Compile}

how to compile basic hello world into a pdf.

Write your favorite text editor create file and copy/paste the following (with hello.tex):

\subsection{Output formats}

different output formats (dvi, pdf)

The output of this command \$latex hello.tex will be a dvi 
file (hello.dvi). This file (.dvi) can be converted by \$dvipdf 
hello.dvi The get an pdf file from tex file, run this 
command \$texi2pdf hello.tex

\chapter{Document Structure}

\section{Reserved Characters}

The following symbols characters are reserved by LATEX because 
they introduce a command and have a special meaning.

\begin{thebibliography}{9}
\label{cap:bibliografia}
    \bibitem{bk} 
    First bibitem
    
    \bibitem{con} 
    Second bibitem

    \bibitem{lamport94}
    Leslie Lamport,
    \textit{\LaTeX: a document preparation system},
    Addison Wesley, Massachusetts,
    2nd edition,
    1994.

    \bibitem{decu} 
    Last bibitem
\end{thebibliography}


\end{document}
1

You must log in to answer this question.

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