Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I finally managed to include a "List of Equations" in my LaTeX-Template. I use the Example from Lev Bishop here on Stackexchange .

The code looks like this:

\documentclass[english]{article}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}

\usepackage{amsmath}
\usepackage[unicode=true, pdfusetitle,  bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,  breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]  {hyperref} 

\makeatletter
\numberwithin{equation}{section} 

% 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]{\myequations{#1}\oldlabel{#1}}
\renewenvironment{equation}{%
\oldequation
\let\label\mynewlabel
}{\endoldequation}

% try to make a List of Equations,
% error is most likely in the @currentlabelname above
\usepackage{tocloft}
\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}
\tableofcontents{}
\listofmyequations

\section{Brushless Motor Fundamentals}
\subsubsection{DC Motor Operation} Torque is generated in DC motors from the magnetic force, also known as the Lorentz force, which is produced when an electric current is passed through a coil in a magnetic field. This force is given by \ref{eq:Force}.

\begin{equation} 
F=q[E+(v\times B)]
\label{eq:Force}
\end{equation}

where F is the force perpendicular to the coil, E is the electric field in the coil, v is the velocity of the charged particles in the coil, and B is the magnetic field. From mechanics, torque is  

\begin{equation}
\tau=F\times r\label{eq:Torque}\end{equation}
If the electrical force in \ref{eq:Force} is ignored, and the remaining magnetic force is used in \ref{eq:Torque}, with the assumption that v is perpendicular to B, we find that
\begin{equation}
\tau=qvBrsin\theta
\label{eq:Magnetic}\end{equation}

\end{document} 

But it still does not fit my problem perfectly:

I do use Chapter Enumerations up to 3-4 Sublevels, like this:

  1. Chapter

    1.1 Subchapter

    1.1.1 Subsubchapter

etc.

Unfortunately in this case, my Equations do get the same enumeration. So any equations in Chapter 1.1.1 are numbered (1.1.1.1), (1.1.1.2), (1.1.1.x) etc.. I'd prefer an enumeration, that only counts within the Chapter: (1.1), (1.2), (1.x), etc.. No matter what subchapter I am in.

Anyone knows how to do that? Unfortunately I'm already a little overwhelmed by the used code for a List of Equations.

share|improve this question
    
If I change article into chapter and add a \chapter command, equations are numbered (1.1.1), (1.1.2) and so on. With your code they are, as expected, (1.1), (1.2) and so on. –  egreg Jan 24 '12 at 13:09
    
A general reference is tex.stackexchange.com/questions/28333/… –  lockstep Jan 24 '12 at 17:41
add comment

1 Answer

up vote 2 down vote accepted

You need to put \numberwithin{equation}{chapter} in your document preamble. This command changes the command \theequation and sets the equation counter to zero with every \chapter.

share|improve this answer
    
embarassingly easy, Thanks a lot ;) –  EliteTUM Jan 24 '12 at 15:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.