Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 23 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.