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.

I add four chapters with \addcontentsline after \bibliography, however, there are only three chapters appearing in the Table of Contents. Could you please tell me what I should do?

Sorry for my unspecification. I use \documentclass{book}, and I typed that :

\bibliography{refs.bib}

\addcontentsline{toc}{chapter}{Bibliography}

%%%%%%%%%%%

\include{Appendix 1}

\addcontentsline{toc}{chapter}{Appendix 1}

\thispagestyle{empty}

%%%%%%%%%%%%

\include{Appendix 2}

\addcontentsline{toc}{chapter}{Appendix 2}

\thispagestyle{empty}

%%%%%%%%%%%%

\include{Appendix 3}

\addcontentsline{toc}{chapter}{Appendix 3}

\thispagestyle{empty}

%%%%%%%%%%%%

\include{Appendix 4}

\addcontentsline{toc}{chapter}{Appendix 4}

\thispagestyle{empty}

But then it appears only 3 first appendices.

share|improve this question
1  
Welcome to TeX.sx! So stated the problem is not very clear. What class are you using? Can you give an example of what you're trying to do? –  egreg Jan 9 '13 at 23:47
2  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  henrique Jan 9 '13 at 23:48
    
A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  doncherry Jan 11 '13 at 0:00

1 Answer 1

up vote 9 down vote accepted

\addcontentsline is written to the toc when the page is "shipped out". If the command is on an empty page which is not written to the pdf or dvi it gets lost - it wouldn't have much sense anyway as without page there is no sensible page number.

\documentclass{article}
\begin{document}
\tableofcontents

blub 
\addcontentsline{toc}{section}{section 1}
\newpage
%empty page 
\addcontentsline{toc}{section}{section 2} %lost
\end{document}
share|improve this answer
    
I start to understand how you think your answers out while shopping! +1 :) –  yo' Jan 10 '13 at 8:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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