[Tex/LaTex] Label and Reference Fig

cross-referencing

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.

Best Answer

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}
Related Question