1

I created a custom "list of appendix" using tocloft and i want to add the title of the list of appendix on the toc. How can i do that? Tocbibind only shows toc, lof, and lot, it doesn't show the custom new list. I can't use such \addcontentsline, cz it's an automatic list just like toc, lof, and lot.

So, if my custom list is

LIST OF APPENDIX

for example. It will show:

Contents ....................... 1

List of table....................... 2

List of figure ....................... 3

List of appendix ................... 5

Currently i'm using the same code i got from this link. (Answer by Mike Renfro).

Please help me. Thanks in advance.

2 Answers 2

1

As you have not provided an MWE showing what you have tried I had to make one up that I hope will help you.

% tocnewlistprob.tex  SE 564098
\documentclass{book}
\usepackage{tocloft}
\newcommand{\listanswername}{List of Answers}
\newlistof{answer}{ans}{\listanswername}
\newcommand{\answer}[1]{%
  \refstepcounter{answer}
  \par\noindent\textbf{Answer \theanswer. #1}
  \addcontentsline{ans}{answer}{\protect\numberline{\theanswer}#1}\par}
\usepackage{tocbibind}
\renewcommand{\listofanswer}{\begingroup
  \tocfile{\listanswername}{ans}
\endgroup}

\begin{document}
\tableofcontents
\listoftables
\listofanswer
\chapter{First chapter}
\begin{table}
\centering
TABULAR HERE
\caption{A table}
\end{table}

\answer{42}

\end{document}

I have no idea how you tried to create your "List of Appendices". In the MWE I have created an \answer macro that that gets listed in an \listofanswer listing which is listed in the \tableofcontents. I have used both the tocloft and tocbibind packages.

This should be a sufficient example for you to create the code to give you the result you want.

It would have been very helpful if you had shown your problem code because we might have been able to provide a more specific solution.

1
  • Actually i already mentioned that i used the same code by Mike Renfro on the link description. Turns out i just need to add \renewcommand{\listofappendix}{\begingroup \tocfile{\listappendixname}{ans} \endgroup}. Anyway thank you so much.
    – user516076
    Sep 25, 2020 at 21:27
1

I am not quite clear on what you want, but to me it seems like one of two things. Either you want to add a separate "list of appendices" (like "table of contents" or "list of figures") or add the entry "list of appendices" into the table of contents.

I added my index listing to the table of contents with \addcontentsline simply with:

\printindex
\addcontentsline{toc}{chapter}{Atriðisorðaskrá}

Where Atriðisorðaskrá is the name of my specialized index that will be marked in the style of chapter in the table of contents (toc).

If you are looking to create a custom list, I recently created an environment type called wordlist and made a list of them with \listof{wordlist}{Orðlistaskrá} (where Orðalistaskrá is the custom header for the list of wordlists).

3
  • This will add the last page of the index to the table of contents rather than the first. So it won't work if the index contains more than one page.
    – esdd
    Sep 25, 2020 at 8:27
  • @esdd well I better hope that my index will not exceed one page then :|
    – Plergux
    Sep 25, 2020 at 9:16
  • I want to "add the title list of appendix" in the table of contents. I'll edit my question. Thanks for answering my question, hope you can help me once more.
    – user516076
    Sep 25, 2020 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .