2

How do I remove the horizontal lines at the top and bottom of the TOC of the appendix?

\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}

enter image description here

D_B
  • 389

2 Answers2

3

You can use the command provided by minitoc package

\noptcrule 

your code will be

\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}

Output: enter image description here

2

By doc of minitoc, Sec. 1.5.1, a "simpler" way is to use command \mtcsetrules as follows:

\mtcsetrules{parttoc}{off}
muzimuzhi Z
  • 26,474