Add "Eq." to Equation numeration but not to reference
What you have done so far is to change the definition of \theequation
so that it contains Eq.
. This means that any reference created using \label
and \ref
will also contain Eq.
, which you don't want. As described in Changing the appearance of equation numbers with amsmath, you need to modify the \tagform@
macro. Since this command contains an at character @
, which is a special character for (La)TeX so you need to do this inside \makeatletter....\makeatother
. The following redefinition of \tagform@
does what you want:
\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces\textit{Eq.~#1}\unskip\@@italiccorr)}}
\makeatother
Notice that I have used Eq.~#1
rather than Eq. #1
. This just adds Eq.
to the original definition of \tagform@
from amsmath.sty
, which is
\def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}}
As the Eq
. is now added by \tagform@
your redefinition of \theequation
is no longer needed. You still want the equations numbered inside sections, however, so this has to be taken care of. Rather than redefining \theequation
it is better to use \numberwithin{equation}{section}
because this will cause the equation counter to be reset whenever the section counter is incremented.
With these changes your MWE becomes:
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\numberwithin{equation}{section}
\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces\textit{Eq.~#1}\unskip\@@italiccorr)}}
\makeatother
\begin{document}
\section{Vogelpohlsche Volumenformel}
\begin{equation}
n = \frac{10^{-8} F}{6 C \cdot \eta \cdot V}
\label{eq:Example}
\end{equation}
A reference to the equation \ref{eq:Example} is helpful.
\end{document}
and the output is:
Is this what you need?
\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\makeatletter
\def\tagform@#1{\maketag@@@{(\ignorespaces\textit{Eq.\ #1}\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{{\normalfont(\ref{#1}}\normalfont)}}
\makeatother
\begin{document}
\section{Vogelpohlsche Volumenformel}
\begin{equation}
n = \frac{10^{-8} F}{6 C \cdot \eta \cdot V}
\label{eq:Example}
\end{equation}
A reference to the equation \eqref{eq:Example} is helpful.
\end{document}
You can do it in a fairly general way:
\documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{section}
\makeatletter
% detach tags and references
\renewcommand{\eqref}[1]{\textup{\eqrefform@{\ref{#1}}}}
\let\eqrefform@\tagform@
\newcommand{\changetag}[1]{%
\renewcommand\tagform@[1]{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}}%
}
\makeatother
\begin{document}
\section{Normal}
Here is an equation
\begin{equation}
a=b\label{normal}
\end{equation}
In \eqref{normal} we see something.
\changetag{\textit{Eq.\ #1}}
\section{Changed}
Here is an equation
\begin{equation}
x=y\label{changed}
\end{equation}
In \eqref{changed} we see something.
\end{document}
Of course in a normal document you'd choose a single format for the tags.
The argument to \changetag
is the formatting you want, where #1
stands for the equation number.
\documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{section}
\makeatletter
% detach tags and references
\renewcommand{\eqref}[1]{\textup{\eqrefform@{\ref{#1}}}}
\let\eqrefform@\tagform@
\newcommand{\changetag}[1]{%
\renewcommand\tagform@[1]{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}}%
}
\makeatother
\changetag{\textit{Eq.\ #1}}
\begin{document}
\section{First}
Here is an equation
\begin{equation}
a=b\label{a}
\end{equation}
In \eqref{a} we see something.
\section{Second}
Here is an equation
\begin{equation}
x=y\label{b}
\end{equation}
In \eqref{b} we see something.
\end{document}