Search code examples
markdownmathjax

\ref{} results in ??? in Typora Latex


I am using Typora as markdown editor for writing math equations. I am running into a problem where eg \ref{eqn:dnj} results in ??? when cross referencing to \label{eqn:dnj}.

Here is an extract from the text:

$$
\begin{split} \label{eqn:dnj}
\delta_{n_j}&= i_a-i_{s_j} \\
\therefore\quad i_{s_j}&=i_a-\delta_{n_j}
\end{split}
$$

followed by the cross reference:

If $\delta_{n_{j^{\prime}}} \lt i_{s_j}$ it follows from $\ref{eqn:dnj}$

This results in the output:

... it follows from ???

Using the same in a pure LaTeX editor renders correctly.


Solution

  • Further investigation:

    It would appear that the issue is that the \label{eqn:dnj} appears inside the \begin{split}...\end{split} block.

    The following implementation solves the problem:

    $$
    \label{eqn:dnj} 
    \begin{split}
    \delta_{n_j}= i_a-i_{s_j} \\
    \therefore\quad i_{s_j}=i_a-\delta_{n_j}
    \end{split}
    $$