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.

Is it possible to automatically reference a figure and equations in text? I meant sth like bibliography references. Moreover, by changing the place of the figures or equations relevant figure or equation number can be changed automatically in text. Exp.:

In remote sensing Equation 1. is applied widely.

Equation 1. x= a+b

share|improve this question
3  
+1 because it's something newbies would want to know but you should really read a LaTeX introduction e.g. "A not so short introduction to LaTeX". It will provide this and many other things that you don't even know you need :) –  recluze Dec 6 '12 at 13:41
1  
@recluze I will just add that that you can find this document in many languages: ctan.org/pkg/lshort –  tohecz Dec 6 '12 at 13:44

3 Answers 3

up vote 6 down vote accepted

Do you mean something like

\documentclass{article}
\begin{document}

\begin{equation}\label{eq:abc}
  a^2+b^2=c^2
\end{equation}

The Theorem of Pythagoras says that as soon as equation \ref{eq:abc} is satisfied, ...
\end{document}

If this is what you mean, the preferred variant for cross-referencing equations is the one provided by the amsmath package:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}\label{eq:abc}
  a^2+b^2=c^2
\end{equation}

The Theorem of Pythagoras says that as soon as equation~\eqref{eq:abc} is satisfied, ...
\end{document}
share|improve this answer

Be smart and use some smart package :-):

\documentclass{article}
\usepackage{cleveref}
\begin{document}
  In remote sensing \cref{eq:myeqn} is applied widely. \Cref{eq:myeqn} is my equation.

\begin{equation}\label{eq:myeqn}
x = a + b
\end{equation}
\end{document}

For details refer the documentation (run texdoc cleveref from command prompt). With hyperref loaded, the links can be made click-able. You may also be interested in varioref and prettyref. Please go through their documentation and also refer to this answer by @cmhughes.

share|improve this answer

To complete the answers by adding solutions for figures and tables. When you add figures and tables with their respective environments \begin{figure} ... \end{figure} and \begin{table} ... \end{table} you can add a label to each using the \label{} command inside the \begin{} ... \end{}. A minor point but one I find useful is to add something to the label that identifies the kind. Hence, I add start the labels with eq: fig: and tab:. A reference to a figure in a figure object would then be made with \ref{fig:xxx} and th eobject defined as

\begin{figure}[ht]
\includegraphics{filename}
\caption{figure caption text}\label{fig:xxx}
\end{figure}
share|improve this answer
    
Yes, good point –  Peter Jansson Dec 6 '12 at 16:49

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.