Featured Book

LaTeX Beginners Guide

Who is online

In total there are 9 users online :: 1 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Bing [Bot] and 8 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

List of Equations / Table of Equations (continued)

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

List of Equations / Table of Equations (continued)

Postby rlevin on Sat Mar 26th, 2011

I have been trying to come up with a convenient way to make a List of Equations in our report. The key thing to note here is that the report is already typed, and contains dozens of equations in hundreds of pages.

Using tocloft to add the List of Equations usually requires following each equation with a tag such as \myequation{Display name}. To avoid having to add this for all of our equations, I did the following:

Code: Select all  •  Open in writeLaTeX
% redefine equation to automatically include our \myequations tag
\let\oldequation = \equation
\let\endoldequation = \endequation
\renewenvironment{equation}{
    \begin{oldequation}
}{
    \end{oldequation}
    \myequations{\@currentlabelname}
}

To generate the list, I using the following code which was mostly derived from here: http://www.latex-community.org/forum/viewtopic.php?f=5&t=428

Code: Select all  •  Open in writeLaTeX
\usepackage{tocloft}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname
}

% myequation takes in its display name
\newcommand{\myequations}[1]{

% display name is printed
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

Then all \equations will appear automatically in the List of Equations. That's great, but there are two problems:

  • Each \equations displayed name in the List of Equations is not its own \label (eg. Torque) but instead is the name of the \subsection in which it appears (such that dozens of equations have the name "Brushless Motor Fundamentals", etc.
  • Equations 2.1 - 2.9 display correctly in the List of Equations but after the equation number hits 2.10 the second digit overlaps with the display name.
Any ideas? What can I replace \@currentlabelname with to drop in the name of the label for an equation? A simple one looks like this:

Code: Select all  •  Open in writeLaTeX
\begin{equation}
\tau=F\times r
\label{eq:Torque}
\end{equation
}


Note: this is also posted under the "Lyx" forum on Latex-Community since that is where I originally posted and also Lyx is ultimately the program I will use for my final implementation. http://www.latex-community.org/forum/viewtopic.php?f=19&t=12452
rlevin
 
Posts: 5
Joined: Sat Mar 26th, 2011

Return to General

Who is online

Users browsing this forum: Bing [Bot] and 8 guests