1

As we $\label{eq01}$ equations and $ref{eq01}$, after inserting a image where I mention the label? and how to refer the FIG?

A code I inserted in LaTeX for inserting Fig is:

\begin{figure}
 \centering
 \includegraphics[scale=0.40]{d2spherical.png}
 % d2spherical.png: 800x300 pixel, 72dpi, 18x8 cm, bb=0 0 1142 479
 \caption{Solution of the spherical equation for $D=2$}
 \label{Fig:5}
\end{figure}

Please mention, where to refer and label.

  • 2
    your code should work fine- you can refer to it using \ref{Fig:5}. provided you keep the \label after the \caption, everything will be fine. it's good practice to make your labels descriptive rather than numeric. For example, you might be better served using \label{fig:sperical}. Also, you can (and probably should) omit the file extension in your includegraphics command. – cmhughes Aug 29 '13 at 2:38
  • 1
    You would \ref just the same as you would an equation. See Why does an environment's label have to appear after the caption? – Werner Aug 29 '13 at 2:59
  • 1
    a better syntax for cross-referencing an equation is \eqref{eq01}. (the code shown in the question won't work, as no command is given. probably a typo.) – barbara beeton Aug 29 '13 at 14:45
4

Referencing is done as in my MWE below.

Some remarks on your example:

  • as mentioned by @cmhughes, you should omit the ".png" in your \includegraphics command. It will search the best file extension by itself. If you are doing some graphic conversions later on, you don't have to change that. (But it is of course not a mistake...)
  • In your text you are labeling inside $$. That doesn't make sense as you don't have any equation number to refer to.

% arara: pdflatex
% arara: pdflatex

\documentclass{article}
\usepackage[%
    ,demo
    ]{graphicx}

\begin{document}
This is my reference to the figure \ref{fig:Figure} and this the reference to the equation \ref{eq:Equation}.
%
\begin{figure}
 \centering
 \includegraphics[scale=0.40]{d2spherical}
 \caption{Solution of the spherical equation for $D=2$}
 \label{fig:Figure}
\end{figure}
%
\begin{equation}
a^2+b^2=c^2
\label{eq:Equation}
\end{equation}
%
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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