3

I want to name a figure and an equation by referring to a label which I have set. So for example, I would like to say: "In Eq.(~\ref{Eq:1}) it is defined" or "In Fig.(~\ref{Fig:1}) it can be seen". So, when I do that, the result is: "In Eq.( 1)..." or "In Fig.( 1)". But I want the ( 1) to look exactly as given in the equation-mode.

Here's the example LaTeX-code:

\documentclass[11pt,a4paper, oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[free-standing-units]{siunitx}
\usepackage[numbers,round]{natbib}

\begin{document}
For a two-tone input, the common choice of reference is the third order intermodulation distortion as defined in Eq.(~\ref{Eq:3}): 
 \begin{equation} 
  D_3 = -10 \log \left(\frac{P_2(2 f_{1,2} \pm f_{2,1})}
     {P_2(f_1,f_2)}\right)
\label{Eq:3}
\end{equation}
\end{document}

I hope my question is clear: There is a space to much in the text.

  • 1
    \eqref{...} is available from amsmath to refer to equations. – user94293 Feb 5 '17 at 21:54
  • Remove the ~ in the (~\ref{...}) – user31729 Feb 5 '17 at 21:55
  • 2
    note it is best not to use numbers in labels otherwise you get the situation shown here where equation 1 has \label Eq;3 which works fine for latex but confuses any human reading the source. – David Carlisle Feb 5 '17 at 22:11
3

The space is asked for by you: (~\ref{Eq:3}) means for LaTeX that it shall insert a pair of parentheses containing a protected space character (~) and then the reference. Just remove ~ and the space will disappear.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy