1

The refstyle package seems to break references within equations

\documentclass{article}

\usepackage{amsmath}
\usepackage{refstyle}

\begin{document}

\begin{enumerate}
  \item \label{enu:test}
\end{enumerate}

$\eqref{enu:test}$

\end{document}

enter image description here

This is what it looks like without resfstyle:

enter image description here

2
  • \eqref doesn't usually need to be within math. Also, the file needs to be processed twice for the reference number to become available,. Commented Apr 8, 2019 at 16:03
  • It does not matter how often I process it, it still looks like that. Also, I would like to have the reference within math. This is no problem if I remove refstyle. (I have added another image.)
    – Daniel
    Commented Apr 9, 2019 at 5:40

2 Answers 2

2

With \eqref a prefix eq: is automatically added to the label. If you want to use it

  1. the label must start with eq:

  2. the prefix must be left out when referencing


\documentclass{article}

\usepackage{refstyle}


\begin{document}

\begin{enumerate}
  \item \label{eq:test}
\end{enumerate}

$\eqref{test}$

\eqref{test}

\end{document}

(are you sure it is a good idea to use \eqref for something that is not an equation?)

3
  • Thanks. Unfortunately, this does not have the right result either. It says still "equation (...)". Unfortunately, I omitted that I use the amsmath package. I have added it to my question and if you remove the refstyle package, then you can see that it works well.
    – Daniel
    Commented Apr 9, 2019 at 5:43
  • @Daniel Well, of course it says "equation (...)" because \eqref is for referencing equations. If the object you are referencing is not an equation, simply don't use \eqref
    – user185220
    Commented Apr 9, 2019 at 11:29
  • That's not true in the case you use amsmath package, as I suggested. Maybe try my modified example with removed refstyle package to see what I mean.
    – Daniel
    Commented Apr 10, 2019 at 12:35
0

Probably, I need to do this manually:

\documentclass{article}

\usepackage{amsmath}
\usepackage{refstyle}

\begin{document}

\begin{enumerate}
  \item \label{enu:test}
\end{enumerate}

$(\ref{enu:test})$

\end{document}

You must log in to answer this question.

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