I am trying to reference a subsection using \label{sth} after subsection and \ref{sth} but it is not working. I thought that it was depth's counter fault so I used \setcounter{secnumdepth}{3} because I am writing a book. My MWE is
\documentclass[11pt,a4paper]{book}
\setcounter{secnumdepth}{3}
\begin{document}
\chapter{Chapter}
This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!This is my lovely chapter which describes nothing at all!
\section{Section}
\label{sec:section}
This is about sections...
\subsection{subsection}
\label{subsec:subsection}
This is about subsection
\chapter{Chapterino}
This is yet another lovely chapter. But the best part of this document is \ref{subsec:subsection}
\end{document}
Any ideas why isn't that working?
edit: i also tried to reference a section just to check but it's not working either...
texfile...So actually this MWE is working for me too, but I am using the same code on my subfiles... – Thanos Oct 4 '12 at 8:45depth numberto 4 and it worked... It doesn't make sence to me, since 1 is for chapter, 2 for section and 3 for subsection, but I'll take it!!! – Thanos Oct 4 '12 at 8:54