# Insert subappendices in minitoc

I'm using the document class book for my manuscript, together with minitoc and appendix packages (in the way provided by this answer). The minitoc package documentation section 2.20 tells us to use \adjustmtc for both package to work together, but by doing so, the appendices are no longer present in the minitoc of the chapter where they belong.

Here is a MWE.

\documentclass{book}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{minitoc}
\usepackage{appendix}
\usepackage{chngcntr}
\usepackage{etoolbox}
\AtBeginEnvironment{subappendices}{%
\chapter*{Appendix}
\counterwithin{figure}{section}
\counterwithin{table}{section}
}

\begin{document}
\dominitoc
\tableofcontents
\chapter{Chapter one}
\minitoc
\section{Section one}
\section{Section two}
\begin{subappendices}
\adjustmtc     % So that appendix toc doesn't go into next chapter's minitoc
\section{First appendix}
\section{Second appendix}
\end{subappendices}
\end{document}


I've put an overview of what you get.

What I would really like is the minitoc to show a line "Appendix" in the minitoc right after "1.2 Section two", followed by the lines "First appendix" and "Second appendix" with the corresponding pages.

Any help or suggestion would be greatly appreciated ! Thanks in advance.

The usage of \chapter* and \addcontentsline in the subappendices environment confuses minitoc.

Rather add it at the section level, that seems to be a better approach!

\documentclass{book}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{minitoc}
\usepackage{appendix}
\usepackage{chngcntr}
\usepackage{etoolbox}

\AtBeginEnvironment{subappendices}{%
\clearpage
\section*{Appendices}
\counterwithin{figure}{section}
\counterwithin{table}{section}
}

\begin{document}
\dominitoc
\tableofcontents
\chapter{Chapter one}
\minitoc
\section{Section one}
\section{Section two}
\begin{subappendices}
\section{First appendix}
\section{Second appendix}
\end{subappendices}
\end{document}


• My PhD is now finished, corrected and printed, but thanks anyway :) hope it'll help others! – jchd Feb 21 '17 at 20:11
• @jchd: Well, sorry for the late answer! – user31729 Feb 21 '17 at 20:13