3

I have a problem with the tocloft package. Whenever I try to include it in my document, the first page (only) of the table of contents contains a page number, even so I don´t want any page numbers at all for the toc. When I remove the \usepackage{tocloft} call, the toc is displayed without a page number, so somehow it must be messing up the layout...

Is there a way to tell tocloft to not adjust anything in the table of contents?

\pagestyle{empty} and \thispagestyle{empty}

don´t solve the problem.

Note: I am using the tocloft package only so I can create a list of equations (via \newlistof command from tocloft). So I would also be glad about way to get the \newlistof command without the tocloft package.

EDIT: Example:

Thank you for considering my problem: Here is a code example:

\documentclass[12pt,a4paper]{article}
\usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox
\usepackage{tocloft}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[T1]{fontenc}
...
//the part responsible for creating creating the listofequations
\newcommand{\listequationsname}{} 
\newlistof{myequations}{equ}{\listequationsname} 
\newcommand{\myequations}[1]{% 
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\hfill} 
...
//sample equation
\begin{equation}\label{eq:Eq1}
a^{2}+b^{2}=c^{2}
\end{equation}
\myequations{Satz des Pythagoras \ref{eq:Eq1}}
...
//displaying the list of equations
\subsection{Equations}
\renewcommand{\listequationsname}{}
\listofmyequations 

Thanks in advance!

SOLUTION:

The command posted by Andrew Swann as a comment solved the issue for me. I only had to add \renewcommand{\cftaftertoctitle}{\thispagestyle{empty}} before \tableofcontents

Thank you alot!

7
  • Welcome to TeX.SX. Please show us a complete and small example which shows your problem. Include only the documentclass, the needed package, the toc and one list of equations.
    – LaRiFaRi
    Jun 5, 2014 at 12:10
  • The manual suggests \renewcommand{\cftafterZtitle}{\thispagestyle{empty}} where Z is the list type. Jun 5, 2014 at 12:19
  • thx @Andrew Swann: adding \renewcommand{\cftaftertoctitle}{\thispagestyle{empty}} before \tableofcontents solved the issue!
    – Philipp
    Jun 5, 2014 at 12:30
  • @Philipp: And if you answer your question yourself, you might obtain the selflearner badge too ;-)
    – user31729
    Jun 5, 2014 at 12:31
  • @Christian: yeaaa :D
    – Philipp
    Jun 5, 2014 at 12:32

1 Answer 1

2

The manual suggests \renewcommand{\cftafterZtitle}{\thispagestyle{empty}} where Z is the list type. In your case Z is equ so you should add

\renewcommand{\cftafterequtitle}{\thispagestyle{empty}} 

to your preamble.

By the way, your command \myequations should end with \ignorespaces instead of \hfill so that following text doesn't necessarily start a new paragraph.

\documentclass[12pt,a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[export]{adjustbox}
\usepackage{tocloft}
\usepackage{amsmath,amsthm,amssymb}

% the part responsible for creating creating the listofequations
\newcommand{\listequationsname}{} 
\newlistof{myequations}{equ}{\listequationsname} 
\newcommand{\myequations}[1]{% 
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\ignorespaces} 
\renewcommand{\cftafterequtitle}{\thispagestyle{empty}} 

\numberwithin{equation}{section}

\begin{document}

\section{A section}

If the sides of a right-angle triangle in the Euclidean plane have
lengths \( a \), \( b \), \( c \) with \( c \) the length of the
hypotenuse, then they are related by
\begin{equation}
  \label{eq:Pyth}
  a^{2} + b^{2} = c^{2}.
\end{equation}
\myequations{Pythagoras' Theorem} Note that this equation has integer
solutions such as \( (a,b,c) = (3,4,5) \).  This should be contrasted
with Fermat's equation
\begin{equation}
  \label{eq:Fermat}
  a^{n} + b^{n} = c^{n},\quad\text{for \( n\geqslant 3 \).}
\end{equation}
\myequations{Fermat's equation}

%displaying the list of equations
\clearpage
\subsection{Equations}
\listofmyequations 

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .