# How to reference \paragraph?

It is well-known that \section environment may be assigned a label \label{refname} and then the refname may be used in order to reference this section:

\section{My nice section}
\label{sec:my-nice-section}
Definitely the section is nice!

\section{My another section}
In the section \ref{sec:my-nice-section} we have discovered that it is nice.


Is there such possibility for \paragraph that we can assign it a label and then reference it?

-

Sure - if it has a number which can be referenced:

\documentclass[10pt,twocolumn]{article}
\setcounter{secnumdepth}{6}
\begin{document}
\paragraph{blub}\label{para}
abc paragraph \ref{para}
\end{document}

-
\setcounter{secnumdepth}{6} is the answer, thanks – Tim Dec 23 '10 at 12:00

Here another approach which I find more direct, easy, and appropriate to the question posted above (source: wikibooks):

%The link location will be placed on the line below.
\phantomsection
\label{the_label}


The good thing is that \ref{} will produce the number of the section the paragraph is entailed, \pageref{} will produce the pagenumber where the paragraph is to be found and if hyperlinks are produced automatically with e.g. the hyperref-package clicking on the link beams one to the beginning of the referenced paragraph, ... so correct, consistent, and userfriendly behaviour! :-)

-
But it won’t work the way the OP wants, as long the \paragraph is without a number. – Speravir Oct 17 '12 at 17:53
Jip, but if a direct paragraph-number is needed it maybe would be wiser to go for a section / subsection / subsubsection / ... which does the numbering automatically because paragraphs are thought to be not numbered. – Peter M Oct 18 '12 at 8:22
Ultimately, wouldn't you want your text to say something like ".... as described in the 2nd paragraph in section X.Y" or "...paragraph 2 in section X.Y addresses this point...". So therefore, whilst you may not display a number like in a chapter, section or subsection, maybe define a new counter, and set the \par command to increment the counter. Resetting the counter at start of new section, subsection or chapter etc... – ADP May 16 at 11:35