# Possible to remove section number and page number from TOC?

I would very much like that the the appendix sections of the Table of Contents doesn't have a section numbers, dots, and page numbers. If I do the following

\documentclass{article}
\usepackage{tocloft}
\renewcommand{\cftdot}{}
\begin{document}
\tableofcontents
\newpage
\section{Appendix}
\end{document}


then the section "Another Letter" is left aligned, so it doesn't look like the others.

Question

Is it possible to have "Another Letter" styled the same way as normal TOC entries, but just without section number, dots, and page number?

-
There is an error, it should be \addcontentsline{toc}{section}{Another Letter} –  karlkoeller Sep 24 '13 at 16:35
Thanks. That fixed the bold issue. –  Sandra Schlichting Sep 24 '13 at 16:42
What about sections before the appendix? –  egreg Sep 24 '13 at 16:55
@egreg They should be normal and unaffected. –  Sandra Schlichting Sep 24 '13 at 16:56
@SandraSchlichting Should \section{Appendix} in the text receive a number? –  egreg Sep 24 '13 at 17:13

I don't know whether this really answers your question. Basically, I patch the \appendix command to suppress numbering of sections; then it also issues some commands to be written in the toc file to change the behavior from that point on. The double \unexpanded trick is for avoiding several \protect in front of macro names.

As far as I know, leaders are off for section titles in the article class to begin with, so there's no need to act on \cftdot.

\documentclass{article}

\usepackage[titles]{tocloft}
\usepackage{etoolbox}

\appto\appendix{%
\setcounter{secnumdepth}{-2}
\unexpanded{\unexpanded{%
\cftpagenumbersoff{section}%
\setlength\cftsecindent{\cftsecnumwidth}%
}}%
}%
}

\begin{document}

\tableofcontents
\clearpage

\section{This has the section number also in the TOC}

\appendix
\section{Appendix}

\section{Another Letter}

\end{document}


-