I use showkeys to manage my lablels. However, sometimes I would like to use long label names but it seems that showkeys does not like them! :)
The problem is that the labels get out of the margin. I am aware of the two other similar questions
but their solution does not seem to work in my case. Here is a MWE where the solution of David Carlisle suggested in the first question is implemented in it but the result is not satisfactory.
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage[notref]{showkeys}
\renewcommand*\showkeyslabelformat[1]{%
\fbox{\parbox[t]{\marginparwidth}{\raggedright\normalfont\small\ttfamily#1}}}
\begin{document}
These are the constraint equations
\begin{align*}
\dot{x} &= \frac{R}{2}(\dot{\varphi_1}+\dot{\varphi_2})\sin\theta \\
\dot{y} &= -\frac{R}{2}(\dot{\varphi_1}+\dot{\varphi_2})\cos\theta \\
\theta-\theta_0 &= \frac{R}{2L}(\varphi_1-\varphi_2)
\tag{1}
\label{eq:constraint:final:integrated}
\end{align*}
\ref{eq:constraint:final:integrated} but the label seems to be out the paper!
\end{document}


abcwhich is what I'd use! – David Carlisle Dec 05 '16 at 21:51