![Minitoc 錯誤章節](https://rvso.com/image/327778/Minitoc%20%E9%8C%AF%E8%AA%A4%E7%AB%A0%E7%AF%80.png)
我正在寫我的論文,我想要文件開頭的總目錄和每章開頭的每章目錄。為此,我使用該minitoc
包。
如果我將\tableofcontents
命令放在文件末尾,一切都會正確。如果我把它放在文件的開頭,則第一章的 minitoc 不會被列印,而接下來的章節會被移動。第二章有第一章的小故事,第二章的第三章等等。
\documentclass[a4paper,11pt,twoside]{memoir}
\usepackage{minitoc}
\dominitoc
\begin{document}
\tableofcontents
\listoffigures
\chapter{first}
\minitoc
\section{first first}
\section{first second}
\chapter{second}
\minitoc
\section{second first}
\section{second second}
\chapter{third}
\minitoc
\section{third first}
\section{third second}
\end{document}
答案1
memoir
對 ToC 功能進行了一些重新定義,顯然minitoc
對此感到困惑。
不過,有一個解決方案:minitoc
提供\adjustmtc[...]
命令,可選參數用於調整 minitoc 的數量,預設為 1。
\adjustmtc
在第一個出現之前說出來\minitoc
可以解決問題。
minitoc
當我試圖找到這個問題的解決方案時,我發現這個很好的命令隱藏在文件中:如何在對開頁上的章節之前放置 minitoc?。
請注意,minitoc
自從其作者 JP Drucbert 於 2009 年去世以來,該軟體包基本上已無人維護。
\documentclass[a4paper,11pt,twoside]{memoir}
\usepackage{minitoc}
\dominitoc
\begin{document}
\tableofcontents
\adjustmtc
\listoffigures
\adjustmtc
\chapter{first}
\minitoc
\section{first first}
\section{first second}
\chapter{second}
\minitoc
\section{second first}
\section{second second}
\chapter{third}
\minitoc
\section{third first}
\section{third second}
\end{document}