jupyterlab-latex icon indicating copy to clipboard operation
jupyterlab-latex copied to clipboard

The equation numbers do not appear in the PDF preview

Open makoto-yamashita opened this issue 6 years ago • 6 comments
trafficstars

In the PDF preview, the equation numbers do not appear.

When the following code is compiled, the PDF preview does not show (1) but (??). However, when the PDF is opened with Acrobat Reader, it shows (1) correctly.

\documentclass{article}
\begin{document}

\begin{eqnarray}
E = mc^2 \label{eq:emc2}
\end{eqnarray}

The equation (\ref{eq:emc2}) is already known.
\end{document}

makoto-yamashita avatar Nov 06 '19 13:11 makoto-yamashita

I also have this issue. It seems as though the LaTeX extension is only compiling the document once, hence the undefined references. A workaround is to include the line:

\usepackage[backend=biber]{biblatex}

(remove the backend bit, if you are not using biber) and then creating a blank .bib file. (e.g. touch empty.bib)

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\begin{document}

\begin{eqnarray}
E = mc^2 \label{eq:emc2}
\end{eqnarray}

The equation (\ref{eq:emc2}) is already known.
\end{document}

b-trav avatar Nov 15 '19 05:11 b-trav

I also have the same problem, and the solution of using bibtex does not work, the extension needs to run pdflatex twice and then bibtex

manmoi01 avatar Jun 25 '20 20:06 manmoi01

The solution to the problem is to add the line c.LatexConfig.run_times = 3 at the end of the file jupyter_notebook_config.py

manmoi01 avatar Jun 25 '20 21:06 manmoi01

Thanks @manmoi01 for the solution. For me c.LatexConfig.run_times = 2 was enough. This should really be mentioned in the README.

tavin avatar Oct 11 '20 18:10 tavin

@tavin Happy to accept pull requests for improved documentation!

ian-r-rose avatar Oct 11 '20 19:10 ian-r-rose

Hi @manmoi01 @tavin for the solution!

@ian-r-rose I created the PR to update documentation, Binder and the sample file to demonstrate equation references working.

ktaletsk avatar Sep 30 '21 00:09 ktaletsk