1

I was asked to have my Introduction and Summary section uncounted. However, if I use \section* it doesn't appear in the Table of Contents which is undesired.

EDIT: The proposed solution doesn't work: enter image description here

I have no idea what the 'List of figures' stands for in there.

I have implemented it just like this:

\tableofcontents
\addcontentsline{toc}{Úvod}{\vspace{10pt}}
\rule[0pt]{0mm}{10pt}

Also the compilator tells me:

! Missing \endcsname inserted.

EDIT2: Of course it doesn't work. I am an idiot. Should be:

\tableofcontents
\addcontentsline{toc}{section}{Úvod\vspace{0pt}}
\rule[0pt]{0mm}{10pt}
SlowerPhoton
  • 153
  • 4

1 Answers1

0

If I understood you correctly then this is what you need:

% not needed for lof b/ it produces its own heading, but for your summary:
%\section*{List of Figures}
% here just skip this and add your text:
\listoffigures
% this adds the line to your toc:
\addcontentsline{toc}{section}{List of Figures\vspace{0pt}}
% \rule[Offset]{width}{height} %  play around to meet your needs:
\rule[0pt]{0mm}{10pt}

Good luck. (Sorry for the editing but my code was not displayed correctly)

MaK
  • 94
  • 1
    This will add the page number of the very last page of the list in the toc. – Johannes_B Feb 16 '16 at 09:37
  • Out of curiosity, what are the spaces for? – Johannes_B Feb 16 '16 at 09:37
  • Oh, really? I never came across a multi-pager there. Well I actually just tried and cannot confirm. This setting adds the BEGINNING page of the list to my toc! – MaK Feb 16 '16 at 09:39
  • Concerning the spaces I used that in case of very short contents to see what looks best. Not really a core feature. – MaK Feb 16 '16 at 09:40
  • 1
    @MaK: There's no indication that the LoF should be added to the ToC (if this would be the case, I would use tocbibind package however) –  Feb 16 '16 at 09:47
  • Indication from where? ;) ... well if you want your lof or whatever to appear in your toc (which is what OP wants) then what I posted works. I use it. – MaK Feb 16 '16 at 09:57
  • (@ChristianHupfer: just fyi: I use a "global" toc comprising all parts with roman and arabic page numbers ...) – MaK Feb 16 '16 at 10:04
  • Indication by the question. The O.P. just wants to add the \section*{Summary} to the ToC, not the \listofsomething. –  Feb 16 '16 at 10:06
  • 2
    @MaK: Actually I don't care whether you use \Roman, \roman, Klingon or whatever numbers for your ToC ;-) –  Feb 16 '16 at 10:06
  • 2
    @MaK Just a suggestion, maybe the answer would be clearer if it would not introduce unnecessary code, e.g. \section*{Summary} \addcontentsline{toc}{section}{Summary} would imho be sufficient. Otherwise someone will copy&paste it without thinking and we will see a question à la "why is the spacing after my \section*{} wrong?" – samcarter_is_at_topanswers.xyz Feb 16 '16 at 17:59
  • @samcarter yes you're right, I just thought to give what I have, to cover all, but you're right, I see the point. – MaK Feb 16 '16 at 18:15
  • This didn't work at all. Please see my EDIT. – SlowerPhoton Feb 16 '16 at 18:42
  • 1
    Since the question is asking to get Introduction as an unnumbered section into the toc, which isn't answered in this answer (it generates confusion), but is answered in the FAQ, i suggest to remove this answer. It is completely misleading. – Johannes_B Feb 16 '16 at 18:47
  • Well OP just came up with exactly what I had proposed. But I will make sure the next time I stick closer to the desired endstate. – MaK Feb 16 '16 at 18:58