# Problem with fancyref, babel and equation references

I am using fancyref and babel together in a LaTeX document and redefine the label for the equation references by \renewcommand{\frefeqname}{Eq.}, so that they look something like "Eq. (3.4)". However, when I have a foreign language section somewhere like \begin{otherlanguage}{german} ... \end{otherlanguage} then \frefeqname is reset to its default value for English, namely equation. Of course, I can redefine \frefeqname afterwards again, but is quite ugly and I would prefer a clean solution to this problem.

-

The babel package uses \caption<language> to change the caption texts. This macro is called in \selectlanguage or environment otherlanguage. Therefore the redefinitions should be placed in these language macros. It can be done by babel's \addto:

\addto\captionsenglish{%
\renewcommand*{\frefeqname}{Eq.}%
}


Or the interface of package fancyref can be used, it provides \fancyrefaddcaptions for this purpose, see the documentation of fancyref.

\documentclass{article}
\usepackage[german,english]{babel,fancyref}

\renewcommand*{\frefeqname}{Eq.}%
}
\renewcommand*{\frefeqname}{Gl.}%
}

\begin{document}
\noindent
\fref{eq:einstein} and \fref{eq:velocity}.
$$E=mc^2 \label{eq:einstein}$$
\begin{otherlanguage}{german}
\fref{eq:einstein} und \fref{eq:velocity}.
$$v=\frac st \label{eq:velocity}$$
\end{otherlanguage}
\fref{eq:einstein} and \fref{eq:velocity}.
\end{document}


-