I think \paragraph, but to be more confident let us say \subparagraph.gmedina wrote:Hi,
yes, that line causes the appendices to be included in the standard ToC. To solve this problem, please tell me which is the first sectional unit that you are sure that you won't use in your document; I mean, obviously you use \chapter and \section, but which one of the following is the first one you won't use: \subsection, \subsubsection, \paragraph, \subparagraph?
General ⇒ Seperate List of Appendices
Seperate List of Appendices
NEW: TikZ book now 40% off at Amazon.com for a short time.

Seperate List of Appendices
Edit: please read the next post first
The new code:
Now the previous problem with the appendices appearing in the standard ToC should be solved.
The new code:
Code: Select all
\documentclass[a4paper,12pt,openany]{memoir}
\usepackage{titlesec}
\makeatletter
\newcommand\listappname{List of Appendices}
\newcommand\listofappendices{%
\chapter*{\listappname
\@mkboth{%
\MakeUppercase\listappname}{\MakeUppercase\listappname}}%
\@starttoc{app}}
\newcounter{myapp}
\newcommand*{\l@myappendix}[2]{%
\stepcounter{myapp}%
\ifnum \c@tocdepth >\m@ne
\vskip \cftbeforechapterskip
{\leftskip \cftchapterindent\relax
\rightskip \@tocrmarg
\parfillskip -\rightskip
\parindent \cftchapterindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima \cftchapternumwidth\relax
\let\@cftbsnum \cftchapterpresnum
\let\@cftasnum \cftchapteraftersnum
\let\@cftasnumb \cftchapteraftersnumb
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{\cftchapterfont\Alph{myapp}\enspace #1}\nobreak
\cftchapterfillnum{#2}}
\fi}
\makeatother
\begin{document}
\tableofcontents
\listofappendices
\chapter{A regular test chapter}
\section{A regular test section}
\chapter{Another regular test chapter}
\section{Another regular test section}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of main chapters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{secnumdepth}{5}
\titleformat{\subparagraph}[display]
{\normalfont\huge\bfseries}{\appendixname\ \Alph{subparagraph}}{20pt}{\Huge}
\titlespacing*{\subparagraph}
{0pt}{20pt}{20pt}
\clearpage
{\centering\LARGE\bfseries Appendices\par\vskip20pt}
\subparagraph{Case 1}
\markboth{}{}
\addcontentsline{app}{myappendix}{Case 1}
\subparagraph{Case 2}
\addcontentsline{app}{myappendix}{Case 2}
\end{document}
Last edited by gmedina on Sat Aug 22, 2009 5:04 am, edited 1 time in total.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Seperate List of Appendices
I apologise for the obvious double post.
The code I just posted will produce undesired results if the appendices include sections or subsections created with \section or \subsection (those will be listed in the standard ToC, which is not desirable).
To correct this situation I used dome of the features of the titletoc package; the standard ToC now won't be generated by \tableofcontents, but by \startcontents[toc]\printcontents[toc]{...}{...}{...}...\stopcontents[toc].
If the appendices won't include sections nor subsections, the code that I posted in my previous response will work; if the appendices include sections or subsections, here's the code to be used (the code contains some explanatory comments):
The code I just posted will produce undesired results if the appendices include sections or subsections created with \section or \subsection (those will be listed in the standard ToC, which is not desirable).
To correct this situation I used dome of the features of the titletoc package; the standard ToC now won't be generated by \tableofcontents, but by \startcontents[toc]\printcontents[toc]{...}{...}{...}...\stopcontents[toc].
If the appendices won't include sections nor subsections, the code that I posted in my previous response will work; if the appendices include sections or subsections, here's the code to be used (the code contains some explanatory comments):
Code: Select all
\documentclass[a4paper,12pt,openany]{memoir}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{chngcntr}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% definition of the "List of Appendices"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand\listappname{List of Appendices}
\newcommand\listofappendices{%
\chapter*{\listappname
\@mkboth{%
\MakeUppercase\listappname}{\MakeUppercase\listappname}}%
\@starttoc{app}}
\newcounter{myapp}
\newcommand*{\l@myappendix}[2]{%
\stepcounter{myapp}%
\ifnum \c@tocdepth >\m@ne
\vskip \cftbeforechapterskip
{\leftskip \cftchapterindent\relax
\rightskip \@tocrmarg
\parfillskip -\rightskip
\parindent \cftchapterindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima \cftchapternumwidth\relax
\let\@cftbsnum \cftchapterpresnum
\let\@cftasnum \cftchapteraftersnum
\let\@cftasnumb \cftchapteraftersnumb
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{\cftchapterfont\Alph{myapp}\enspace #1}\nobreak
\cftchapterfillnum{#2}}
\fi}
\makeatother
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use the following lines to produce a standard Table
% of Contents (don't forget the \stopcontents[toc] just before the appendices)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{\contentsname}
\markboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\startcontents[toc]
\printcontents[toc]{}{0}{\setcounter{tocdepth}{4}}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% place the following two lines where the List of Appendices must be typeset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\listofappendices
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Main chapters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{A regular test chapter}
\section{A regular test section}
\subsection{A regular test subsection}
\subsubsection{A regular test subsubsection}
\chapter{Another regular test chapter}
\section{Another regular test section}
\subsection{Another regular test subsection}
\subsubsection{Another regular test subsubsection}
\stopcontents[toc]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of main chapters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preparations for the Appendices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{secnumdepth}{5}
\titleformat{\subparagraph}[display]
{\normalfont\huge\bfseries}{\appendixname\ \Alph{subparagraph}}{20pt}{\Huge}
\titlespacing*{\subparagraph}
{0pt}{20pt}{20pt}
\renewcommand\thesubparagraph{\Alph{subparagraph}}
\renewcommand\thesection{\Alph{subparagraph}.\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\counterwithin{section}{subparagraph}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Appendices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
{\centering\LARGE\bfseries Appendices\par\vskip20pt}
\subparagraph{Case 1}
\addcontentsline{app}{myappendix}{Case 1}
\markboth{}{}
\section{A test section in the first appendix}
\subsection{A test subsection in the first appendix}
\section{Another test section in the first appendix}
\subparagraph{Case 2}
\addcontentsline{app}{myappendix}{Case 2}
\markboth{}{}
\section{A test section in the second appendix}
\subsection{A test subsection in the second appendix}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Seperate List of Appendices
That is great. So, I don't have to use the standard Table of Contents? But in that case how can I add unreferenced lines to the ToC like using this line
and I want to include appendices in the ToC, without details. Like this:
Table of Contents
...
...
...
Appendices ....................................................... 50
References ....................................................... 60
Thank you gmedina, you really helped me. Your code with the code of writting chapters in words will almost complete the rquired. But I still don't know how to write the chapter title and chapter number in the same line.
Code: Select all
\addcontentsline{toc}{chapter}{DEDICATION}
Table of Contents
...
...
...
Appendices ....................................................... 50
References ....................................................... 60
Thank you gmedina, you really helped me. Your code with the code of writting chapters in words will almost complete the rquired. But I still don't know how to write the chapter title and chapter number in the same line.
Seperate List of Appendices
My code doesn't use the standard \tableofcontents command, but you still can use something likeS_David wrote:That is great. So, I don't have to use the standard Table of Contents? But in that case how can I add unreferenced lines to the ToC like using this line
and I want to include appendices in the ToC, without details. Like this:Code: Select all
\addcontentsline{toc}{chapter}{DEDICATION}
Table of Contents
...
...
...
Appendices ....................................................... 50
References ....................................................... 60
Code: Select all
\addcontentlene{toc}{chapter}{NAME}
Code: Select all
\resumecontents[toc]
\addcontentlene{toc}{chapter}{NAME}
\stopcontents[toc]
You are welcome. To format the chapter headings, you can use the titlesec package. The following code contains this feature and examples on how to introduce information manually into the ToC:S_David wrote:...Thank you gmedina, you really helped me. Your code with the code of writting chapters in words will almost complete the rquired. But I still don't know how to write the chapter title and chapter number in the same line.
Code: Select all
\documentclass[a4paper,12pt,openany]{memoir}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{chngcntr}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% definition of the "List of Appendices"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand\listappname{List of Appendices}
\newcommand\listofappendices{%
\chapter*{\listappname
\@mkboth{%
\MakeUppercase\listappname}{\MakeUppercase\listappname}}%
\@starttoc{app}}
\newcounter{myapp}
\newcommand*{\l@myappendix}[2]{%
\stepcounter{myapp}%
\ifnum \c@tocdepth >\m@ne
\vskip \cftbeforechapterskip
{\leftskip \cftchapterindent\relax
\rightskip \@tocrmarg
\parfillskip -\rightskip
\parindent \cftchapterindent\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima \cftchapternumwidth\relax
\let\@cftbsnum \cftchapterpresnum
\let\@cftasnum \cftchapteraftersnum
\let\@cftasnumb \cftchapteraftersnumb
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{\cftchapterfont\Alph{myapp}\enspace #1}\nobreak
\cftchapterfillnum{#2}}
\fi}
\makeatother
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use the following lines to produce a standard Table
% of Contents (don't forget the \stopcontents[toc] just before the appendices)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter*{\contentsname}
\markboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\startcontents[toc]
\printcontents[toc]{}{0}{\setcounter{tocdepth}{4}}
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% place the following two lines where the List of Appendices must be typeset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\listofappendices
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Main chapters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}
{\normalfont\LARGE\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\LARGE}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\chapter*{Dedication}
\addcontentsline{toc}{chapter}{DEDICATION}
\chapter{A regular test chapter}
\section{A regular test section}
\subsection{A regular test subsection}
\subsubsection{A regular test subsubsection}
\chapter{Another regular test chapter}
\section{Another regular test section}
\subsection{Another regular test subsection}
\subsubsection{Another regular test subsubsection}
\stopcontents[toc]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End of main chapters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preparations for the Appendices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{secnumdepth}{5}
\titleformat{\subparagraph}[display]
{\normalfont\huge\bfseries}{\appendixname\ \Alph{subparagraph}}{20pt}{\Huge}
\titlespacing*{\subparagraph}
{0pt}{20pt}{20pt}
\renewcommand\thesubparagraph{\Alph{subparagraph}}
\renewcommand\thesection{\Alph{subparagraph}.\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\counterwithin{section}{subparagraph}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Appendices
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\resumecontents[toc]
{\centering\LARGE\bfseries Appendices\par\vskip20pt}
\addcontentsline{toc}{chapter}{Appendices}
\stopcontents[toc]
\subparagraph{Case 1}
\addcontentsline{app}{myappendix}{Case 1}
\markboth{}{}
\section{A test section in the first appendix}
\subsection{A test subsection in the first appendix}
\section{Another test section in the first appendix}
\subparagraph{Case 2}
\addcontentsline{app}{myappendix}{Case 2}
\markboth{}{}
\section{A test section in the second appendix}
\subsection{A test subsection in the second appendix}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Seperate List of Appendices
That is great. But I noticed that the subsections and subsubsections are not numbered. Why?
Thanks in advance
Thanks in advance
Seperate List of Appendices
By default, the memoir document class assigns numbers to sectional units up to level 1 (sections); this behaviour is controlled by the secnumdepth counter. If you want numbering up to subsubsections (level 3) then you have to add this line to your document (in all LaTeX classes):
or (in the memoir class)
The memoir documentation (pages 146 and 147) contains an explanation about secnumdepth and \setsecnumdepth
Code: Select all
\setcounter{secnumdepth}{3}
Code: Select all
\setsecnumdepth{subsubsection}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Seperate List of Appendices
Thank you friend, you rescued me, because I have to deliver my thesis to my professor in 10 days, and I am not familiar with Latex till now. All things are now just fine except a little thing. I will try to solve it by myself to learn more about Latex.
Best regards
Best regards
Seperate List of Appendices
Execuse me, but now how can I refer to the created page "List of Appendecies" in the table of content? This page does not exist in the document to just use:
Thanks in advance
Code: Select all
\addcontentsline{toc}{chapter}{List of Appendecies}.
Re: Seperate List of Appendices
Ok, I figured it out, we must place the above command after \listofappendecies.