P1. This is the first paragraph, which I'd like to link to.

I'd like the following line of math to contain a reference to the first paragraph: \[ \ref{first-paragraph} \]

You can use \href to link to an anchor, but then I'd have to know which labels are defined in math mode and which in text mode. \[ \href{#first-paragraph}{\text{P1}} \]


MathJax does support referring to equations labelled in math mode, when MathJax.tex.tags = 'ams'.

This paragraph contains math with a \label: \[ \begin{equation} y \label{eq:letter-y} \tag{letter y} \end{equation} \]

Here is a link back to \(\ref{eq:letter-y}\).