如何删除目录顶部和底部的水平线?

如何删除目录顶部和底部的水平线?

如何删除附录目录顶部和底部的水平线?

\documentclass[a4paper]{article}
\usepackage[toc,page,header]{appendix}
\usepackage{minitoc}

% Make the "Part I" text invisible
\renewcommand \thepart{}
\renewcommand \partname{}


\begin{document}
\doparttoc % Tell to minitoc to generate a toc for the parts
\faketableofcontents % Run a fake tableofcontents command for the partocs

\part{} % Start the document part
%\parttoc % Insert the document TOC

\section{First}
First content.
\section{Second}
Second content.

\newpage
\appendix
\addcontentsline{toc}{section}{Appendix} % Add the appendix text to the document TOC
\part{Appendix} % Start the appendix part
\parttoc % Insert the appendix TOC

\section{Appendix First}
Appendix first content.
\section{Appendix Second}
Appendix second content.

\end{document}

在此处输入图片描述

答案1

您可以使用 minitoc 包提供的命令

\noptcrule 

你的代码将是

\documentclass[a4paper]{article}
\usepackage[toc,page,header]{appendix}
\usepackage[]{minitoc}
\noptcrule %<<<<<<<<<<<<<<<<<<< HERE
% Make the "Part I" text invisible
\renewcommand \thepart{}
\renewcommand \partname{}


\begin{document}
\doparttoc % Tell to minitoc to generate a toc for the parts
\faketableofcontents % Run a fake tableofcontents command for the partocs

\part{} % Start the document part
%\parttoc % Insert the document TOC

\section{First}
First content.
\section{Second}
Second content.

\newpage
\appendix
\addcontentsline{toc}{section}{Appendix} % Add the appendix text to the document TOC
\part{Appendix} % Start the appendix part
\parttoc % Insert the appendix TOC

\section{Appendix First}
Appendix first content.
\section{Appendix Second}
Appendix second content.

\end{document}

输出: 在此处输入图片描述

答案2

根据文档minitoc第 1.5.1 节,一种“更简单”的方法是使用\mtcsetrules以下命令:

\mtcsetrules{parttoc}{off}

相关内容