[Tex/LaTex] How to move amsmath equation label into LHS margin

amsmathequationslabelspositioning

I am using amsmath and I would like to move the equation label into the left hand side margin aligned with the top of the equation. I have looked through the documentation but I can't find anything on label position. Please could let me know how to do this, or even better where to find the information. Also if there is a reason that LaTeX does this as default then could let me know why.

As a small side question how do you get the label to say Eq(1.1) rather than (1.1)

EDIT(1):

Currently equation looks as following:
enter image description here

EDIT(2): Based on egregs advice used:

\begin{equation}
\begin{split}
\text{P(consequence)} & =  \text{P(hazard occuring)}
                     \\& \times \text{P(exposure of agent|hazard occuring)} 
                    \\& \times \text{E(Damage|hazard and exposure)} 
\end{split}
\end{equation}

To gain the following:

enter image description here

This looks much nicer, so last question is there any way to get the label in the equation to read Eq.2.2 or is there a good reason for why I shouldnt do this

Best Answer

For adding Eq. use cleveref. For the equation numbers in the margin:

\documentclass[leqno]{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage{lipsum}

\makeatletter
% detach \eqref processing from \tag processing
\let\tagform@ref\tagform@
\let\maketag@@@ref\maketag@@@
\patchcmd{\eqref}{\tagform@}{\tagform@ref}{}{}
\patchcmd{\tagform@ref}{\maketag@@@}{\maketag@@@ref}{}{}
% redefine \maketag@@@
\def\maketag@@@#1{\llap{\m@th\normalfont#1\quad}\kern1sp}
\makeatother

\begin{document}

\lipsum*[2]
\begin{align}
X&=Y\\
Z+Z'&=W
\end{align}
\lipsum*[3]
\begin{equation}\label{x}
a+b=c
\end{equation}
Now we cite equation \eqref{x} to see all's right.

\end{document}

But don't do it, please.

enter image description here

However, I believe yours is an “XY question”. The example equation you show should be treated with split, not by pushing the number in the margin.

\documentclass[leqno]{article}
\usepackage[tbtags]{amsmath}
\usepackage{etoolbox}
\usepackage{cleveref}

\usepackage{lipsum} % this is just for mock text

\DeclareMathOperator{\prob}{P}
\DeclareMathOperator{\expec}{E}
\newcommand{\tevent}[1]{\textup{#1}}
\crefname{equation}{Eq.}{Eqs.}

\begin{document}

\lipsum*[2]
\begin{equation}\label{x}
\begin{split}
\prob(\tevent{consequence})={}
  & \prob(\tevent{hazard occurring}) \\
  & \times \prob(\tevent{exposure of agent}\mid\tevent{hazard occurring}) \\
  & \times \expec(\tevent{damage}\mid\tevent{hazard and exposure})
\end{split}
\end{equation}
Here we cite the equation: \cref{x}.
\end{document}

enter image description here

Here's a further version where Eq. is added also in the equation number. I'd never use this in a document; figures and tables are a different thing: “Figure” and “Table” are used in the caption as identifiers with respect to the object they refer to; for equations it's completely clear what the number is about.

\documentclass[leqno]{article}
\usepackage[tbtags]{amsmath}
\usepackage{etoolbox}
\usepackage{cleveref}

\usepackage{lipsum} % this is just for mock text

\makeatletter
% detach \eqref processing from \tag processing
\let\tagform@ref\tagform@
\let\maketag@@@ref\maketag@@@
\patchcmd{\eqref}{\tagform@}{\tagform@ref}{}{}
\patchcmd{\tagform@ref}{\maketag@@@}{\maketag@@@ref}{}{}
% redefine \tagform@
\def\tagform@#1{\maketag@@@{(Eq.\ \ignorespaces#1\unskip\@@italiccorr)}}
\makeatother

\DeclareMathOperator{\prob}{P}
\DeclareMathOperator{\expec}{E}
\newcommand{\tevent}[1]{\textup{#1}}
\crefname{equation}{Eq.}{Eqs.}

\begin{document}

\lipsum*[2]
\begin{equation}\label{x}
\begin{split}
\prob(\tevent{consequence})={}
  & \prob(\tevent{hazard occurring}) \\
  & \times \prob(\tevent{exposure of agent}\mid\tevent{hazard occurring}) \\
  & \times \expec(\tevent{damage}\mid\tevent{hazard and exposure})
\end{split}
\end{equation}
Here we cite the equation: \cref{x}.
\end{document}

enter image description here

Related Question