0

i ve got an issue with Figure counting and, i think, labeling. Though I set the counter for figures at 0, my first figure, that I d like to have counted as 'Fig.1' and that is labeled as \label{graf1}, appears in Chapter 2, Subsubsection 2.2.3.1 and is captioned when compilated as 'Fig 2.1'. Moreover, while it is referred to in the text as '(\ref{graf1})' the reference looks as 'figure (2.2.3.1)', that is the subsubsection number...

Does anybody see what seems to be the problem? My header is below. Many thanks!

\documentclass[12pt]{thesis}%{book}%{%

\usepackage[numbers]{natbib}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath} 
\usepackage{amssymb} 
\usepackage{makeidx} 
\usepackage{graphicx}
\usepackage{epigraph}
\usepackage{pdfpages}
\usepackage{url} 
\usepackage{breqn}
\usepackage{setspace}
\usepackage{dsfont}
\usepackage{eurosym}
\usepackage{setspace}

\onehalfspacing

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\setcounter{figure}{0}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}%[section]
\newtheorem{defin}{Definition}
\newtheorem{prop}{Proposition}

\newcommand{\eqbydef}{\overset{def}{=}}

\begin{document}
 .....
 \begin{figure}[htb]\label{graf1}
 \begin{center}
 \includegraphics[height=8cm,width=11cm]{c3.eps}
 \caption{This shuould be Figure 1}
 \end{center}
 \end{figure}

 \end{document}
agozar
  • 61
  • 3
    Put the label after the caption. –  Feb 09 '13 at 15:27
  • The figure makes use of the counter figure but it prints the number after the value of the chapter counter. So you'll have 2.1. From report.cls we found \newcounter{figure}[chapter]. – Sigur Feb 09 '13 at 15:29
  • Welcome to TeX.sx! Your problem is a rather common one; look at the question I linked in the previous comment that explains why your numbers were incorrect. Don't worry to much about having asked this and keep using the site for other questions or, maybe, answers. – egreg Feb 09 '13 at 16:17
  • Hello, thanks. If i, following Harish Kumar's advice, do \caption{}\label{}, it does show it as Figure 2.1. So far it s ok, i can accept it. However, what should I do in order to render it Fugure 1? Thanks egreg, i'll take a look. – agozar Feb 09 '13 at 16:24
  • @agozar For future questions: Please always minimalize your code before posting it here. I wrote up some tips on how to do that on our meta site: I’ve just been asked to write a minimal example, what is that? (In your case, it’s mostly the packages, I would assume.) – doncherry Feb 09 '13 at 17:13

0 Answers0