Для своей диссертации я работаю с несколькими главами по отдельности и включаю эти главы в свой основной .tex
файл. Я определил свое Предисловие с помощью \chapter*{Preface}
. Чтобы добавить Предисловие к Оглавлению, я использовал \addcontentsline
. Для заголовка я использовал \chaptermark
.
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chaptermark{Preface}
Это работало отлично, пока я не понял, что мое мини-оглавление других глав больше не отображается после компиляции. Я компилировал несколько раз, никаких изменений. Что мне сделать, чтобы они отображались, пока у меня есть Предисловие в Оглавлении с правильным заголовком.
\begin{document}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{3}
\dominitoc
\pagenumbering{roman}
\cleardoublepage
\parskip=2ex
\frontmatter
\begin{titlepage}
\maketitle
\end{titlepage}
\chapter{Dedication/dedication}
\chapter{Declaration/declaration}
\chapter{Acknowledgement/acknowledgement}
\chapter{Abstract/abstract}
\tableofcontents
\printnomenclature
\mainmatter
\chapter{Preface/preface}
\adjustmtc[0]
\chapter{Chapter1/chapter1}
\chapter{Chapter2/chapter2}
\backmatter
\listoffigures
\listoftables
\end{document}
Буду рад, если кто-нибудь поможет в этом вопросе.
Редактировать: Здесь я упростил свой код, чтобы сделать рабочий пример. Честно говоря, я не знаю, minitoc
работает ли это в report
классе, так как когда я комментирую часть Предисловия, minitoc
она не работает в любом случае. (Обычно я использую класс для диссертации и minitoc
работает, если я не добавляю Предисловие в Оглавление.)
\documentclass[a4paper]{report}
\usepackage{minitoc}
\begin{document}
\dominitoc
\chapter*{Dedication}
\chapter*{Declaration}
\chapter*{Acknowledgement}
\chapter*{Abstract}
\tableofcontents
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chaptermark{Preface}
\adjustmtc[0]
\chapter{Chapter 1}
We will have two sections here.
\section{AA}
Here, I have my first section.
\section{BB}
This is my second section.
\chapter{Chapter2}
\section{CC}
This is the CC section.
\chapter{Chapter 3}
\section{DD}
This is the DD section.
\listoffigures
\listoftables
\end{document}
решение1
Явные \addcontentsline
заявления для структурных единиц со звездочками путают подсчет и несколько вспомогательных файлов minitoc. Вот почему \addstarredchapter
существует:
\documentclass[a4paper]{report}
\usepackage{minitoc}
\begin{document}
\dominitoc
\chapter*{Dedication}
\chapter*{Declaration}
\chapter*{Acknowledgement}
\chapter*{Abstract}
\tableofcontents
\chapter*{Preface}
\addstarredchapter{Preface}
\chaptermark{Preface}
\chapter{Chapter 1}
\minitoc
We will have two sections here.
\section{AA}
Here, I have my first section.
\section{BB}
This is my second section.
\chapter{Chapter2}
\minitoc
\section{CC}
This is the CC section.
\chapter{Chapter 3}
\minitoc
\section{DD}
This is the DD section.
\listoffigures
\listoftables
\end{document}