General ⇒ Can I add a section to table of contents without a number
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Can I add a section to table of contents without a number
Hi.
I am using eskdx package.
Every new section in my document starts with \section{Name} command.
But according to our formating rules some sections shouldn't have numbers (e.g. Introduction or Conclusions and Recommendations)
But if I will create them with \section*{name} command, they will not appear in my TOC
The question:
How to create sections without numbers and add them to TOC (without numbers too)
Really need your help
Thanks
Oleg
I am using eskdx package.
Every new section in my document starts with \section{Name} command.
But according to our formating rules some sections shouldn't have numbers (e.g. Introduction or Conclusions and Recommendations)
But if I will create them with \section*{name} command, they will not appear in my TOC
The question:
How to create sections without numbers and add them to TOC (without numbers too)
Really need your help
Thanks
Oleg
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Can I add a section to table of contents without a number
Hi Oleg,
welcome to the LaTeX Community board! You could use \addcontentsline, for example:or even \addtocontents.
Stefan
welcome to the LaTeX Community board! You could use \addcontentsline, for example:
Code: Select all
\addcontentsline{toc}{section}{Introduction or Conclusions and Recommendations}
Stefan
LaTeX.org admin
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Re: Can I add a section to table of contents without a number
Thanks a lot! You answered so quickly!


-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Can I add a section to table of contents without a number
Please help 
I added the line but no text was added to TOC
Where the section introductions (it should be without number in TOC) sits in the \include{Intro} file
I only need to add a section without number to TOC (with the page number where it appeared)
Please help

I added the line but no text was added to TOC

Code: Select all
\begin{document}
\maketitle
\addcontentsline{toc}{section}{Introductions}
\tableofcontents
\include{Intro}
\include{Chap1}
I only need to add a section without number to TOC (with the page number where it appeared)
Please help
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Re: Can I add a section to table of contents without a number
Not sure if I am doing it correctly.
Trying to add it this way:
Directly on the file I write
\addtocontents{toc}{section*}{Introduction}
instead of \section*{Introduction}
But get this:
[1{/usr/local/texlive/2007/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./main.toc
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 ...IeC {\cyrn }\IeC {\cyrn }\IeC {\cyrii }}{6}
Trying to add it this way:
Directly on the file I write
\addtocontents{toc}{section*}{Introduction}
instead of \section*{Introduction}
But get this:
[1{/usr/local/texlive/2007/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./main.toc
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 ...IeC {\cyrn }\IeC {\cyrn }\IeC {\cyrii }}{6}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Can I add a section to table of contents without a number
Hi Oleg,
try this minimal example, compile it 2 times:
The section Introduction is not numbered and appears without number in the toc.
The error message could mean something else. Could you post your problematic code line? Do you use cyrillic symbols inside the section title? Maybe this has to be protected. Show me the line containing the error.
Stefan
try this minimal example, compile it 2 times:
Code: Select all
\documentclass[a4paper,10pt]{article}
\begin{document}
\tableofcontents
\bigskip
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
Text
\end{document}
The error message could mean something else. Could you post your problematic code line? Do you use cyrillic symbols inside the section title? Maybe this has to be protected. Show me the line containing the error.
Stefan
LaTeX.org admin
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Can I add a section to table of contents without a number
Hi!
People from the CyrTeX-ru@vsu.ru already helped me! Thanks a lot!!!
The solution is:
Directly in the section.
They also recommended me to use this in the preamble of the document
Works cool now!! Thanks!
People from the CyrTeX-ru@vsu.ru already helped me! Thanks a lot!!!
The solution is:
Code: Select all
\section*{Введение}
\addcontentsline{toc}{section}{Введение}
They also recommended me to use this in the preamble of the document
Code: Select all
% Переопределение полужирного шрифта в СОДЕРЖÐÐИИ и наÑтройка лидеров
\makeatletter
\renewcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode %\bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak
\leaders\hbox to .82em{\hss.\hss}\hfil % \hfill
\nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi}
\makeatother
%%%%%%