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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Seperate List of Appendices
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}
Seperate List of Appendices
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}
Seperate List of Appendices
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}
Re: Seperate List of Appendices
Thanks in advance
Seperate List of Appendices
Code: Select all
\setcounter{secnumdepth}{3}
Code: Select all
\setsecnumdepth{subsubsection}
Re: Seperate List of Appendices
Best regards
Seperate List of Appendices
Code: Select all
\addcontentsline{toc}{chapter}{List of Appendecies}.