# Indentation of my list of equations

I have problems with my list of equations. The list is generated, but if I compare the list with for instance list of tables or figures, there is different indentaion of each lines. Can someone help me?

Code below:

\documentclass[oneside, 14pt]{extreport} % extreport
\usepackage{tocloft}
\begin{document}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

$$\label{rov:o} e^{\pi i} - 1 = 0$$
\myequations{}

\begin{table}[ht]
\centering
\caption{Jmena}
\label{tab:label}
\begin{tabular} {|l|l|}
\hline
name & surname \\
\hline
karel & vomacka \\
\hline
pepa & labus \\
\hline
\end{tabular} \\
\end{table}

\listoftables

\listofmyequations

\end{document}

-

## 3 Answers

According to the tocloft package documentation, entries in the list of tables are indented by 1.5em. Hence, after declaring your new list for equations, you need

\setlength\cftmyequationsindent{1.5em}

-

The question about the indent was already solved by Ian Thompson (he was a little bit quicker than me ;-)), so please do not accept my version, since he was first.

I post my solution anyway, where I slightly redefined the equation environment for an optional argument and automatically adding the toc entry, so there is no need for \myequations{} manually.

\documentclass[oneside, 14pt]{extreport} % extreport
\usepackage{tocloft}
\usepackage{letltxmacro}%
\begin{document}
\newcommand{\listequationsname}{List of Equations}
\newlistof[equation]{myequations}{equ}{\listequationsname}
\setlength{\cftmyequationsindent}{1.5em}
%\newcommand{\myequations}[1]{%
%\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\LetLtxMacro{\LaTeXEquation}{\equation}%
\let\LaTeXEndEquation\endequation%
\renewenvironment{equation}[1][]{%
\LaTeXEquation%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}%
}%
{\LaTeXEndEquation}

$$\label{rov:o} e^{\pi i} - 1 = 0$$

$$[Einstein] \label{otherlabel} E = mc^2$$

\begin{table}[ht]
\centering
\caption{Jmena}
\label{tab:label}
\begin{tabular} {|l|l|}
\hline
name & surname \\
\hline
karel & vomacka \\
\hline
pepa & labus \\
\hline
\end{tabular} \\
\end{table}

\listoftables

\listofmyequations

\end{document}


-

This is a simple solution which doesn't require knowing the lengths used; entries in a list are typeset using \l@<type>, so you can simply \let the new entry to be the one for figures, for example, and this can be done simply by:

\makeatletter
\let\l@myequations\l@figure
\makeatother


This has another advantage: if an eventual change is made to the settings used for the figure entries, then the entries for equations will also inherit those new settings.

A complete example:

\documentclass[oneside, 14pt]{extreport} % extreport
\usepackage{tocloft}

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\makeatletter
\let\l@myequations\l@figure
\makeatother

\begin{document}

$$\label{rov:o} e^{\pi i} - 1 = 0$$
\myequations{}

\begin{table}[ht]
\centering
\caption{Jmena}
\label{tab:label}
\begin{tabular} {|l|l|}
\hline
name & surname \\
\hline
karel & vomacka \\
\hline
pepa & labus \\
\hline
\end{tabular} \\
\end{table}

\listoftables
\listofmyequations

\end{document}


-
Since the tocloft package is in use one could also issue the instruction \let\cftmyequationsindent\cftfigindent, right? – Mico Jul 30 '14 at 14:19
@Mico Yes, but using the indents only will guarantee (well) just the same indents, but if, for example, the fonts attributes for figure/table entries were changed, your suggestion won't reflect the font changes for the equation entries; the \let approach I used will allow any modification (besides just indents) to be inherited. – Gonzalo Medina Jul 30 '14 at 18:13