1

I am very new to LaTex. I started by using a template in Lyx. In this template, chapters,sections etc are written in table of contents and only chapter names for the appendices are written to list of appendices (page 3 and 6 approximately). The LaTex code that causes this is as follows:

\bibliographystyle{unsrt}
\bibliography{aliThesisBibliography}

\part*{APPENDICES\thispagestyle{empty}}
\renewcommand*{\chapterheadendvskip}{\vspace{2cm}} 
\renewcommand*{\chapterheadstartvskip}{\vspace{1cm}}

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{loa}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{loa}{chapter}{#1}%
\fi
\else
\addcontentsline{loa}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\makeatother

\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}

I think this last line is set to exclude sections. If I remove the code and macro above, everything will be shown in toc and my loa page will be empty. If I change the number in braces in the last line above, (I tried many numbers) the Appendices chapter names will be written to list of appendices but their corresponding sections will be shown as sections of "References" in the table of contents.

How can I change the code above so that both chapters and sections in the appendices part are shown only in the list of appendices page?

closed as unclear what you're asking by user31729, Johannes_B, Martin Schröder, user11232, Paul Gaborit Oct 4 '15 at 14:48

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you provide a minimal working example that lets helpers reproduce the behaviour, saves time and give the perfect for you test suite? – Johannes_B Feb 8 '15 at 12:03