# My equation's referencing not working

I can't reference my equations, I've labeled all my equations, and am referencing them with \ref{}, but only two question marks appear. I've tried everything and can't for the life of me understand why it doesn't work. I have been able to reference figures, but not equations. An excerpt of the code is:

\documentclass{scrartcl}
\usepackage{etex}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{cleveref}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{fancyref}
\usepackage{amssymb}
\usepackage[utf8x]{inputenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{floatrow}
\usepackage{imakeidx}
\usepackage{indentfirst}
\makeindex

\begin{document}

...
$$\label{eq:funcao_dif} v_1 = K v_i + \frac{v_2}{Q} - v_3 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 + \frac{1}{sT} v_2 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 - \frac{1}{s^2T^2} v_1$$
...

{\par A primeira parte é logo um circuito subtractor que simula a equação
\ref{eq:funcao_dif}}

\end{document}

• Welcome to TeX.SX! Please remove any unnecessary package and make your document fragment compilable (MWE). Oct 18 '17 at 7:37
• unrelated to \label, but why do you have \par and a {...} group around your paragraph? Oct 18 '17 at 7:44
• do not use etex package with current latex, don't load blindtext or lipsum in real documents, most likely you should use [utf8] rather than [utf8x] unless you really need some of the non standard features of the utf8x version. Oct 18 '17 at 7:47

You are loading a lot of un-needed packages in your preamble and experiencing a clash of redefinitions. In particular the cleverref manual explains that it must be loaded last (and in particular, after hyperref).

This version works

\documentclass{scrartcl}

\usepackage{amsmath}

%\usepackage{cleveref}
%\usepackage{fancyref}
\usepackage[utf8]{inputenc}

\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}

...
$$\label{eq:funcao_dif} v_1 = K v_i + \frac{v_2}{Q} - v_3 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 + \frac{1}{sT} v_2 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 - \frac{1}{s^2T^2} v_1$$
...

{\par A primeira parte é logo um circuito subtractor que simula a equação
\ref{eq:funcao_dif}}

\end{document}


\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[nosumlimits,nointlimits,nonamelimits]{amsmath}
\usepackage[onehalfspacing]{setspace}
\usepackage{footmisc}
\usepackage[round,authoryear,longnamesfirst]{natbib}
\usepackage{xcolor}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{darkblue}{rgb}{0,0,0.5}
\definecolor{purple}{rgb}{0.5,0,0.5}
\usepackage{appendix}
\usepackage{subfig}
\usepackage{framed}
\usepackage{caption}
\usepackage{tikz}
\usepackage[inline]{enumitem}
\usepackage[thmmarks]{ntheorem}


It turns out that I had to move ntheorem before amsmath. There is probably some conflict between these two packages, and ntheorem must come first.

• I also had this problem, and while your solution works, the ntheorem documentation suggests otherwise. According to section 3.2.1, when using the thmmarks option with ntheorem, if also using amsmath, amsmath should be loaded first and ntheorem should be included as \usepackage[thmmarks,amsmath]{ntheorem}. May 13 at 22:32

You should use the package \usepackage{hyperref} to try with \eqref{eq:funcao_dif} or \ref{eq:funcao_dif}. I think this will work.

Output of following shown in image.

\usepackage{cleveref}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{fancyref}
\usepackage{amssymb}
\usepackage[utf8x]{inputenc}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{floatrow}
\usepackage{imakeidx}
$$\label{eq:funcao_dif} v_1 = K v_i + \frac{v_2}{Q} - v_3 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 + \frac{1}{sT} v_2 = K v_i - \frac{1}{sT}\frac{1}{Q} v_1 - \frac{1}{s^2T^2} v_1$$

You should to try with \eqref{eq:funcao_dif} or \ref{eq:funcao_dif}. I think this will work.
• I am sorry but this answer is wrong, you do not need hyperref to use \ref and \label. Oct 18 '17 at 7:45
• @alphy hyperref adds hyperlinks but \label and \ref work fine without the package Oct 18 '17 at 7:49