我已经花了大约 3 天时间研究整个 minitoc 问题。为什么它不起作用?
我的意思是,我希望在报告文档的每一章开头都有一个简单的迷你目录。
让我给你展示一些代码示例。
\documentclass{report}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{minitoc}
\usepackage{sectsty}
\usepackage{tabularx}
\usepackage{caption}
\usepackage[table,dvipsname]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage[flushleft]{threeparttable}
%%%%%%%% FOR TESTING %%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{blindtext}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Initializing Minitoc
\dominitoc[n]
\nomtcpagenumbers
\begin{document}
\chapter{A}
\label{Chap.A}
\minitoc % GENERATE THE MINITOC?
\section{A.1}
\label{A:sec:1}
Minitoc, what is wrong with you please tell me!
\section{A.2}
\label{A:sec:2}
\blindtext
\newpage
\chapter{B}
\label{Chap.B}
\minitoc % ????
\section{B.1}
\label{B:sec:1}
\Blindtext
\section{B.2}
\label{B:sec:2}
\blindtext
\end{document}
当我编译它时,我得到
显然我做错了什么。是什么问题?
答案1
该包在日志中发出了非常明确的警告,如果没有\tableofcontents
Package minitoc Warning: W0010
(minitoc) No file bb599.toc.
(minitoc) MINITOCS NOT PREPARED on input line 17.
和
Package minitoc(hints) Warning: W0068
(minitoc(hints)) You have used \minitoc but not
(minitoc(hints)) \tableofcontents
(minitoc(hints)) nor \faketableofcontents.
如果你在得到\tableofcontents
之后添加\begin{document}
还有其他关于包裹订购的警告,我在这里没有提到,例如
Package minitoc(hints) Warning: W0037
(minitoc(hints)) The sectsty package should be
(minitoc(hints)) loaded BEFORE the minitoc package.