当我尝试通过命令 addcontentsline 将未编号的章节简介添加到目录中时,结果很差。LaTeX 将页码放在文本“简介”的旁边,结果就像我在图片中显示的“简介1”一样。我提供了最小可编译示例,它给出了该结果。如果我添加其他普通章节,它们会正常显示在目录中。
\documentclass[12pt,a4paper,oneside,openright]{book} %oneside versione segreteria
\usepackage[english,italian]{babel}
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
%-------------------------------------------------------------------------------------
\frontmatter
\pagestyle{plain}
\tableofcontents
%-------------------------------------------------------------------------------------
\mainmatter
\pagestyle{plain}
%Primo Capitolo
\addcontentsline{toc}{Chapter}{Introduzione}
\chapter*{Introduzione}
\end{document}
答案1
作为Christian Hupfer 指出,问题是分区划分Chapter
未知。可能你的意思是chapter
:
\documentclass[12pt,a4paper,oneside,openright]{book} %oneside versione segreteria
\usepackage[english,italian]{babel}
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\frontmatter
\pagestyle{plain}
\tableofcontents
\mainmatter
\pagestyle{plain}
%Primo Capitolo
\addcontentsline{toc}{chapter}{Introduzione}
\chapter*{Introduzione}
\end{document}