GeneralRemoving a page number in the TOC

LaTeX specific issues not fitting into one of the other forums of this category.
tdc
Posts: 34
Joined: Fri Sep 12, 2008 1:52 am

Removing a page number in the TOC

Post by tdc »

Hi,

Does anyone know how to remove a page number from the righthand side of the table of contents so it just displays the chapter title?

Cheers, Tim

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Removing a page number in the TOC

Post by gmedina »

Hi,

add

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{empty}}
somewhere in the body of your document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Removing a page number in the TOC

Post by localghost »

I think that wasn't meant with removing the page number. The request was for removing the according referencing page number for an entry (here chapter).
tdc wrote:[...] Does anyone know how to remove a page number from the righthand side of the table of contents so it just displays the chapter title? [...]
It could work like the following.

Code: Select all

\addtocontents{toc}{\bfseries Dummy}
\chapter*{Dummy}
Formatting of the entry can differ from your ideas. Adapt it to your needs.


Best regards
Thorsten¹
tdc
Posts: 34
Joined: Fri Sep 12, 2008 1:52 am

Re: Removing a page number in the TOC

Post by tdc »

hmmm, neither of those seemed to work.

I'm attempting to create an abstract before the table of contents (which is produced via \tableofcontents) and as such I wish for it not to have a page number.

I have achieved this on the page itself with \thispagestyle{empty} however it still appears in the TOC with a page number.

I'm using \chapter*{abstract} to generate a numberless chapter.

Cheers, Tim
tdc
Posts: 34
Joined: Fri Sep 12, 2008 1:52 am

Removing a page number in the TOC

Post by tdc »

and yes its the page number shown in the TOC i want to remove :)

eg

Code: Select all

Abstract                                          i
Table of figures                                  iii
should read

Code: Select all

Abstract 
Table of figures                                  iii
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Removing a page number in the TOC

Post by gmedina »

Yes, my mistake; I misunderstood the original question. Anyway the suggestion given by localghost should work; if not, can you please post some of the actual code you are using (in the sense of a minimal working example)?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
tdc
Posts: 34
Joined: Fri Sep 12, 2008 1:52 am

Removing a page number in the TOC

Post by tdc »

I'll try and form a minimal working example later but in the mean time i'm using the amsbook class, \tableofcontents to make the contents and my abstract currently looks like

Code: Select all

%\frontmatter
%--Abstract--
%\chapter*{Abstract}
%\label{Abstract}
%\thispagestyle{empty}
%aaaaaaa
Cheers :)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Removing a page number in the TOC

Post by localghost »

tdc wrote:I'll try and form a minimal working example later but in the mean time i'm using the amsbook class, \tableofcontents to make the contents and my abstract currently looks like [...]
The information about the used document class is very important and should have been given right at the beginning in your initial post.

Code: Select all

\documentclass[11pt,english]{amsbook}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{blindtext}

\parindent0em
\title{Abstract in ToC}
\author{tdc}
\date{\today}

\begin{document}
  \tableofcontents
  \addtocontents{toc}{\bfseries Abstract}
  \begin{center}
    \large\bfseries Abstract
  \end{center}

  \bigskip\bigskip
  \blindtext
  \newpage
  \Blinddocument
\end{document}
Issues are caused by the fact that the amsbook class handles \chapter* commands different from the standard classes and puts them automatically without numbering into the ToC.
tdc
Posts: 34
Joined: Fri Sep 12, 2008 1:52 am

Removing a page number in the TOC

Post by tdc »

Code: Select all

\documentclass[a4paper,12pt,reqno,oneside]{amsbook}
\begin{document}

\frontmatter
%--Abstract--
\chapter*{Abstract}
\label{Abstract}
\thispagestyle{empty}
aaaaaaaa

%
%
%
%
%

%--prebody--
\frontmatter
%--Contents--
	\tableofcontents
	

\end{document}
This is the minimal example.... i'd like to lose the page number next to the abstract :)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Removing a page number in the TOC

Post by localghost »

tdc wrote:[...] i'd like to lose the page number next to the abstract [...]
You can't use the \chapter* command. See the explanation and the code example in my last reply.
Post Reply