I'm writting a document with appendices, I use the "appendix" package.
I'd like to have a table of content in the begining of my document with all the section of the document and only the "Appendix" title section (providing the page number where appendix starts) and not the details of the sections in the appendix.
Then, when appendix starts, I'd like another table of content, but this time with only the sections appearing in the appendix.
Here is a MWE:
Code: Select all
\documentclass[a4paper]{article}\usepackage[toc,page,header]{appendix}\begin{document}\tableofcontents % How to limit this TOC to main document sections ????\newpage\section{First}First content.\section{Second}Second content.\newpage\appendix\appendixpage% How to insert here a TOC concerning only the appendix sections ????\section{Appendix First}Appendix first content.\section{Appendix Second}Appendix second content.\end{document}
I searched in the minitoc, tocloft, appendix packages (and even some homemade TeX code) but they don't provide me what I want.
I was thinking about modifying the \tableofcontents command so that I can pass as argument the ".toc" file to use to generate the TOC, and I could separate by hand from the original ".toc" file lines for document or for appendix TOCs.
\tableofcontents command could also be changed to automatically stop reading the ".toc" file after the "Appendix" keyword for the Document TOC, and start from there for the Appendix TOC.
Does anybody knows a way to not have to modify this command (because, I'm not sure to have sufficient knowledge to do so) ?
If not, can anybody tell me where I can find the sources of the \tableofcontents command ? (I can have a try to adapt it to my needs...)
Thanks for your help.