jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.72k stars 564 forks source link

Anchor link broken when converting to PDF #790

Open NickMacro opened 6 years ago

NickMacro commented 6 years ago

A Jupyter notebook markdown cell with the following input:

[link](#tag)

# HEADER<a name="tag"></a>

produces the following PDF output:

Section ??
1 HEADER

with the corresponding LaTeX output:

Section \ref{tag}

\section{HEADER}\label{header}

EDIT:

It appears the problem is due to the LaTeX that generates the PDF containing \label{header} instead of \label{tag}. However, there is still the issue of not having the correct link text.

I have generated a LaTeX file that produces a PDF with functionality similar to that in the Jupyter Notebook using the hyperref package in LaTeX as seen below.

\hyperlink{tag}{link}

\hypertarget{tag}{\section{HEADER}}

Is this an issue with nbconvert or pandoc?

Alcampopiano commented 6 years ago

I'm experiencing the same issue.