I use
\renewcommand{\theequation}{{\hspace*{-3.05cm}\thesection.\arabic{equation}}}
to move my equation numbers into the margins (corporate design), it looks like this:
The problem is that apparently this command is also used to make references in the text, so when doing (\ref{equation:label})
I get this:
As you can see, everything behind the (
gets pulled to the left by 3.05cm, as defined above. Is there any way to get the references and equation environment to use different commands for the equation numbers so I can define them the way I need them?
Edit
Here is a MWE:
\documentclass[leqno,11pt,parskip,oneside]{scrartcl}
\usepackage[left=5.6cm,right=2.2cm,top=5.5cm,bottom=3.55cm,headsep=1.9cm]{geometry}
\usepackage{mathtools}
\usepackage[hyperref]{xcolor}
\usepackage{chngcntr}
\counterwithin*{equation}{section}
% remove brackets from equation numbers
\newtagform{brackets}{}{}
\usetagform{brackets}
% Equation numbers
\renewcommand{\theequation}{{\fontsize{8bp}{8bp}\selectfont\hspace*{-3.05cm}\thesection.\arabic{equation}}}
\begin{document}
\section{TestSection}
\begin{equation}
a = b+c
\label{test}
\end{equation}
This is a reference (\ref{test})
\end{document}
Best Answer
As you are using
mathtools
you alredy have all the tools(!) you need. You even invoked the right macro,\newtagform
-- in which you can specify how your tags should be formatted:Doing so, you need to take care
\eqref
(as it uses\tagform@
which like in the solution of @DavidCarlisle gets redefined; only with less effort ;)You can use the patch of Davids solution to fix this or define a custom command:
which omits
\tagform@
. Alternatively you could also\renewcommand\eqref
itself to this form (shouldn't be harmfull, but I can't say this for sure now).Complete code