\addcontentsline{toc}{chapter} 不起作用

\addcontentsline{toc}{chapter} 不起作用

我正在尝试将包含参考书目 (bibliografia) 和致谢 (ringraziamenti) 的文档分成两个不同的章节。问题是,页眉中的标题是错误的,但我不知道原因。

你能帮我吗?

这是我的代码:

\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 :)

结果应该是参考书目页面上的“Bibliografia”和致谢页面上的“Ringraziamenti”,但我在参考书目页面上得到的是“Bibliografia”,在致谢页面上(再次!)得到的是“Bibliografia”

答案1

这是一个解决方案和 MWE:

在此处输入图片描述

\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}

相关内容