# Reference to section where is label

I have these equations with one label:

\section{This is super math section}
\begin{eqnarray}
c + d \\
\label{eq:eq2}
a + b
\end{eqnarray}


But how to do if I want get the section number where is the equation placed and make reference to this section (from the number)?

Equation \eqref{eq:eq2} on page \pageref{eq:eq2} in section \???{eq:eq2} is brilliant!


EDIT: using ref to definition environmet.

\documentclass[a4paper,11pt,twocolumn]{article}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{yhmath}

\usepackage{cleveref}

\theoremstyle{definition}
\newtheorem{defi}{Definition}[section]

\begin{document}

Definition \ref{def:def1} on page \pageref{def:def1} in section \cref{def:def1} is brilliant!

\section{Definitions}
\begin{defi}\label{def:def1}
This is body of definition.
\end{defi}
\end{document}


Giving: Definition 1.1 on page 1 in section Definition 1.1 is brilliant!

Need: Definition 1.1 on page 1 in section 1 is brilliant!

-
Welcome to TeX.sx! –  Peter Jansson Mar 14 '13 at 19:52
To make a cross-reference to the section, you first need to place a separate \label statement immediately following the \section statement. E.g., you might write \section{This is a super math section} \label{sec:supermath}. Elsewhere in the document, you'd write "as is shown in Section~\ref{sec:supermath}, ..." Incidentally, don't use the eqnarray environment. Instead, learn to use the align environment provided by the amsmath package. –  Mico Mar 14 '13 at 19:58

There are many packages in CTAN to manage cross references. Unfortunately some are incompatible or must be loaded in some order. For your question a solution could be \cref from the cleverref package:

\documentclass{article}
% \usepackage{varioref} % before of hyperref and cleveref
\usepackage{amsmath}
\usepackage{cleveref}

\begin{document}

Equation
% \vref{eq:eq2}
\eqref{eq:eq2}
% \vpageref{eq:eq2}
in   \cref{eq:eq2}
named \nameref{eq:eq2}
is brilliant!
\autoref{eq:eq1} is dull.

\section{This is super math section}
\begin{eqnarray}
\label{eq:eq1}
c + d \\
\label{eq:eq2}
a + b
\end{eqnarray}

\end{document}


Edit: For the added problem to the question with a \newtheorem, another solution could be the smartref package:

\documentclass{article}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{defi}{Definition}[section]

\usepackage{smartref}

\begin{document}

Definition \ref{def:def1}
on page \pageref{def:def1}
in section \sectionref{def:def1} is brilliant!

\section{Definitions}
\begin{defi}\label{def:def1}
This is body of definition.
\end{defi}
\end{document}

-
This solution is great but if I use \cref to definition: \begin{defi}\label{def:grammer}Bla bla\end{defi}, it gives me definition instead of section number. –  Petr Přikryl Mar 14 '13 at 20:35
It is difficult to give a solution if you do not know the problem. A defi environment? That is not defined in the standard article class, for example. Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Fran Mar 14 '13 at 21:34
Editted original ask. –  Petr Přikryl Mar 14 '13 at 22:06
Smartref gives right section number but it is not clickable. –  Petr Přikryl Mar 14 '13 at 22:50
Load also the hyperref package and then change \sectionref{def:def1} by \hyperref[def:def1]{\sectionref{def:def1}} –  Fran Mar 15 '13 at 1:27