I'm using this solution to generate a list of equations.
Running my minimal example below, there are two points I want to change:
[A] Using the standard "list of" style, means: using the same spaces after the caption and indent the entries like the list of figures.
[B] Use a seperate variable as the Caption instead of the label
\documentclass[
pdftex,
listof=totoc,
]{scrreprt}
\usepackage{amsmath}
\usepackage{xstring}
\usepackage{tocloft}
\usepackage{blindtext}
\usepackage[demo]{graphicx}
\makeatletter
\numberwithin{equation}{chapter}
% we use this for our refernces as well
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
% redefinition of \equation for convenience
\let\oldequation = \equation
\let\endoldequation = \endequation
\AtBeginDocument{\let\oldlabel = \label}% \AtBeginDocument because hyperref redefines \label
\newcommand{\mynewlabel}[1]{%
\StrBehind{#1}{eq:}[\Str]% remove "eq:" from labels
\myequations{\Str}\oldlabel{#1}}
\renewenvironment{equation}{%
\oldequation
\let\label\mynewlabel
}{\endoldequation}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}}
\setlength{\cftmyequationsnumwidth}{3em}
\makeatother
\begin{document}
\begin{figure}[!htb]
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{figure 1}
\label{fig:1}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{figure 2}
\label{fig:2}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{figure 3}
\label{fig:3}
\end{figure}
\blinddocument
\begin{equation}
1 + 1 = 2
\label{eq:first}
\end{equation}
\begin{equation}
2 + 2 = 4
\label{eq:second}
\end{equation}
\begin{figure}[!htb]
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{figure 4}
\label{fig:4}
\end{figure}
\begin{figure}[!htb]
\centering
\includegraphics[width=5cm,height=4.5cm]{image1}
\caption{figure 5}
\label{fig:5}
\end{figure}
\listoffigures
\listofmyequations
\end{document}
Best Answer
This approach answers only your question [A] (see below for a complete solution).
Replace the line
with
so to match the corresponding definitions for
\listoffigures
intocloft.sty
:MWE:
Output:
A different approach can be used to achieve both [A] and [B].
I don't like this one very much, but here it is.
We use the package
float
and declare theEquation
environment to be a new floating environment.So, replace all the stuff between
\makeatletter ... \makeatother
with:At this point you can use equations inside
Equation
in this way:and to print the List of Equations you have to write the line:
instead of
MWE:
Output: