[Tugindia] Figure ref. numbering

Jitender Singh jsinghdrdo at gmail.com
Tue May 31 11:36:44 CEST 2011


Given below is test file as requested by S Venkatraman,
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\section{This is section}
\subsection{This is sub-section}
Figure 1 Label~\ref{fig:1} \\ Figure 2 Label~\ref{fig:2}
\begin{figure}[htpb]
\includegraphics{a.png}
\caption{fig 1}
\label{fig:1}
\end{figure}
\begin{figure}[htpb]
\includegraphics{a.png}
\label{fig:2}
\caption{fig 2}
\end{figure}
\end{document}

What I am claiming is a fact which following links also supports. But I
request you to try it yourself and get convinced,
http://stefaanlippens.net/latexcaptionlabel
http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
 (See section on Label and Cross-referencing)


<http://stefaanlippens.net/latexcaptionlabel>

On Tue, May 31, 2011 at 9:58 AM, S. venkataraman <svenkat at ignou.ac.in>wrote:

> On Mon, May 30, 2011 at 5:58 PM, Jitender Singh <jsinghdrdo at gmail.com
> >wrote:
>
> > Position of label w.r.t. caption does change format of printed label. I
> > just
> > cross-checked it, you may try it yourself:
> >  \begin{figure}[htbp]
> >  \includegraphics[width=0.5\textwidth]{fileName.png}
> >  \caption{figure caption}
> >  \label{fig:tiger}
> >  \end{figure}
> >
> > results in figure 3 whereas,
> >
> >  \begin{figure}[htbp]
> >  \includegraphics[width=0.5\textwidth]{fileName.png}
> >  \label{fig:tiger}
> >  \caption{figure caption}
> >  \end{figure}
> >
> > gives figure 2.1.3. (section number)
> >
> > Regards,
> > Jitender SIngh
> >
> >
> >
> > --
> > Regards!
> > Jitender Singh
> > _______________________________________________
> > Home:        http://www.tug.org.in/
> > TeX FAQ:     http://www.tex.ac.uk/faq
> > unsubscribe: http://tug.org/mailman/listinfo/tugindia
> >
> I checked out the following combinations.
> article
> book
> article+amsmath
> book+amsmath
> Here is the small test file
> I used.   I changed filename.png to the name of my
> graphics file.
>
> \documentclass{article}
>
> %\documentclass{book}
>
> \usepackage{amsmath}
>
> \usepackage{graphicx}
>
> \begin{document}
>
> \begin{figure}[htbp]
>
> \includegraphics[width=0.5\textwidth]{filename.png}
>
> \caption{figure caption}
>
> \label{fig:tiger}
>
> \end{figure}
>
> results in figure 3 whereas,
>
>  \begin{figure}[htbp]
>
> \includegraphics[width=0.5\textwidth]{filename.png}
>
> \label{fig:tiger}
>
> \caption{figure caption}
>
> \end{figure}
>
> \end{document}
> Can you send a small test file like
> this which produces the effect you
> claim, namely different postions of
> the \label command leading to
> different labels?
> Best,
> S. Venkataraman
> _______________________________________________
> Home:        http://www.tug.org.in/
> TeX FAQ:     http://www.tex.ac.uk/faq
> unsubscribe: http://tug.org/mailman/listinfo/tugindia
>



-- 
Regards!
Jitender Singh


More information about the tugindia mailing list