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!
Best Answer
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 thecleverref
package:Edit: For the added problem to the question with a
\newtheorem
, another solution could be thesmartref
package: