I'm need to make a list of equation in my document. I found and use the modified version of Lev Bishop's code from here. Everything work until there's an accent in the equation label. I got this error message :
! TeX capacity exceeded, sorry [input stack size=5000].
\@latex@warning #1->\GenericWarning {\space \space \space \@spaces \@spaces ...
l.38 \label{eq:équation}
I'm currently using TeXnicCenter on Windows 7 but I tried others and they all gave me the same error... Do you have any solution ?
Example in Latex
\documentclass[pdftex,a4paper,11pt,twoside]{report}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xstring}
\usepackage{tocloft}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\oldequation = \equation
\let\endoldequation = \endequation
\AtBeginDocument{\let\oldlabel = \label}
\newcommand{\mynewlabel}[1]{
\fullexpandarg
\StrBehind{#1}{eq:}[\Str]
\myequations{\Str}\oldlabel{#1}}
\renewenvironment{equation}{
\oldequation
\let\label\mynewlabel
}{\endoldequation}
\newcommand{\listequationsname}{Liste d'équations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations{\hspace{15pt}\protect\numberline{\theequation}#1}}
\setlength{\cftmyequationsnumwidth}{3em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\listofmyequations
\begin{equation}
2+2=4
\label{eq:équation}
\end{equation}
\end{document}