Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Centering \section* and adding them to the ToC

I've got something like

\documentclass{article}
\begin{document}
\tableofcontents
\section*{About this Article}
\section*{About this Author} 
\section{First Step}
\section{Second Step}
\end{document}

My table of contents won't show the "About this Article" and "About this Author" sections.

enter image description here

How do I retain the format of \section*{...} yet still show the section in the table of contents?

share|improve this question

marked as duplicate by Werner, topskip, percusse, Paulo Cereda, Martin Scharrer Jun 7 '12 at 10:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Possible duplicate: Centering \section* and adding them to the ToC –  Werner Jun 7 '12 at 5:04
add comment

2 Answers

up vote 7 down vote accepted

Use \addcontentsline to add the section* to the TOC:

enter image description here

Code:

\documentclass{article}
\begin{document}
\tableofcontents
\section*{About this Article}
\addcontentsline{toc}{section}{About this Article}

\section*{About this Author} 
\addcontentsline{toc}{section}{About this Author}

\section{First Step}
\section{Second Step}
\end{document}
share|improve this answer
add comment

The whole point of a \section* is not affecting running headers and table of contents. In this case, this means that "About this Article" and "About this Author" will be be given running headers of "Table of Contents". So the main question here appears to be "Do you know what you are doing?".

The KomaScript classes offer \addsec commands for creating unnumbered but otherwise identical sectional commands.

share|improve this answer
4  
I think you should remove the last sentence of the first paragraph. –  Peter Grill Jun 7 '12 at 5:09
1  
Sure, because people vote me down. But not being a registered user, I can't make use of those points anyway, and the original poster of this question (and readers of it) will eventually run into this problem. Sure it earns points to give people what they ask for, but I don't see the point in encouraging them to shoot themselves in the foot because of some award system. –  user9588 Jun 7 '12 at 5:15
    
I don't know about the "unregistered" issue, but you could post a question on Meta.TeX.SE to get that resolved. Also, I do not see any down votes on this question, and was not suggesting you remove the answer, just that the last sentence as I don't see how that adds value to your answer. –  Peter Grill Jun 7 '12 at 5:23
    
I am unregistered by choice. And rest assured, I did observe the drop in reputation and answer score. And answers, in contrast to comments, can't be removed. You can "edit" them leaving a single character in place, but that's all. The best I could do is to flag it as inappropriate content (or you could) and have a moderator remove it. Go ahead if you think it worth the trouble. –  user9588 Jun 7 '12 at 5:33
    
It seems that there has been a miscommunication. I was only suggesting removing the comment So the main question here appears to be "Do you know what you are doing?" I was not suggesting you delete the answer. There is no problem in answering a question with recommending that they not do something. BTW, there is NO down on this answer that I can see. Not sure how much rep you need to see the up/down votes. –  Peter Grill Jun 7 '12 at 5:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.