Math & ScienceLabeling many equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
idanisr
Posts: 1
Joined: Wed Dec 30, 2009 1:08 pm

Labeling many equations

Post by idanisr »

Hi,
Im new to latex,and I want to know if there is an automatic way to label equation.
I write my thesis in latex and I have a lot of equations.
everytime i write an eq I label it as eq1, eq2 and etc.
but when I want to write an eq between two old eqs, I have to change manually the labels i already gave.
is there a simple way to do so?

Im using winedt or led.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

Re: Labeling many equations

Post by Stefan Kottwitz »

The equations will be numbered automatically, but the labels could be set freely. Why do you use numbers in labels? You've already noticed that there could be changes later. I suggest use meaningful labels like \label{Einstein} or \label{CantorsTheorem} etc.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Labeling many equations

Post by localghost »

Your way of labeling equations reduces LaTeX's system of automatic numbering to absurdity. Put logical labels to your equations as Stefan already suggested.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{amsmath}

\begin{document}
  \chapter{First chapter}
    \section{First section}
      \begin{equation}\label{eqn:einstein}
        E=mc^2
      \end{equation}
      as we see in equation \eqref{eq:einstein} \ldots
      \begin{subequations}\label{eqn:binomi}
        \begin{align}
          (a+b)^2 &= a^2+2ab+b^2 \label{subeqn-1:binomi} \\
          (a-b)^2 &= a^2-2ab+b^2 \label{subeqn-2:binomi} \\
          (a+b)(a-b) &= a^2-b^2 \label{subeqn-3:binomi}
        \end{align}
       The \textsc{Binomi} equations \eqref{eq:binomi} devided into equation \label{subeq-1:binomi}, \label{subeq-2:binomi} and \label{subeq-3:binomi}.
\end{document}
More stuff concerning math expressions can be found in the amsmath manual and the »Math mode« document.


Best regards
Thorsten
Post Reply