79

Is there any difference between \eqref and \ref? I used both of them in my document using the package classicthesis and saw no difference in the result. Is there any specific situation in which I should use \eqref or \ref?

0

1 Answer 1

106

The command \ref is defined in the LaTeX Kernel. The command \eqref is defined by amsmath. In the documentation of amsmath you will find the explanation in section 3.11.2 Cross references to equation numbers.

\eqref puts brackets around the reference number. It's also places the references in in \upshape (or \textup), to match the equation reference exactly (Thanks to Werner). This is shown in the example below.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
a^2+b^2=c^2\label{eq:1}
\end{equation}

\verb+\eqref{eq:1} vs \ref{eq:1}+: \eqref{eq:1} vs \ref{eq:1}

\verb+\textit{\eqref{eq:1} vs \ref{eq:1}}+: \textit{\eqref{eq:1} vs \ref{eq:1}}

\end{document}

enter image description here


If you use the package classicthesis, you must load amsmath before. Because the package classicthesis loads the package hyperref. However the package itself doesn't change the format of the output.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .