I have a main document referring to four files and want to create a ToC with the titles of these four files as well as their structure.
Here`s a MWE for my main file:
\documentclass[a4paper, 12pt, english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{natbib}
\usepackage{chapterbib}
\begin{document}
\input{./title.tex}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents
\include{Introduction}
\include{Paper1}
\include{Paper2}
\include{Paper3}
\end{document}
and here is an MWE for my included files, all similar:
\begin{center}
{\bfseries Title}
\end{center}
\section{Introduction}
\section{Conceptual Foundations}
\subsection{Topic A}
I`d like my ToC to look like:
Title file 1
Section file 1
Subsection File 1
Title file 2
….
Currently I have the problem that the titles are not shown since they have not been labeled as a section (I haven`t done that because I want them to appear as unnumbered titles and the following sections/subsections within the file to appear as section/subsection and not a level lower). The second problem is that the sections after the first file are not numbered but labelled with letters "A", "B", etc – I have an appendix in the first file, not sure whether that influences the rest.
Best Answer
Here's a sample document to get you started. I've used
titlesec
to format the chapter headings and theappendix
package to make use of its{subappendices}
environment. The reason your chapters are mislabeled is that the default\appendix
command turns\chapter
level headings into appendices. Since you want per chapter appendices you need to make appendices as section level elements. So you need to remove the\appendix
commands from your included documents and then enclose the appendix sections in the{subappendices}
environment.