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
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Can I add a section to table of contents without a number
welcome to the LaTeX Community board! You could use \addcontentsline, for example:
Code: Select all
\addcontentsline{toc}{section}{Introduction or Conclusions and Recommendations}
Stefan
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Re: 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

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
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: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Can I add a section to table of contents without a number
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
-
- Posts: 9
- Joined: Thu May 15, 2008 2:02 pm
Can I add a section to table of contents without a number
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
%%%%%%