Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of LaTex writer to create some links #6360

Closed
jmawhorter opened this issue May 12, 2020 · 1 comment
Closed

Failure of LaTex writer to create some links #6360

jmawhorter opened this issue May 12, 2020 · 1 comment

Comments

@jmawhorter
Copy link

Original observed behaviour:

A simple HTML snipet like this:

<p>
<a id="test1" href="#test2">test text1</a>
</p>
<p>
<a id="test2" href="#test1">link to text test1</a>
</p>

when converted with this command:

pandoc -s --pdf-engine=xelatex -o tmp.pdf tmp.html

fails to produce working links in the PDF.

Per JGM's helpful analysis of my problem:

The issue is in the LaTeX writer and can be shown by converting
native content:

% pandoc -f native -t latex [Link ("test2",[],[]) [Str "link",Space,Str "to",Space,Str "text",Space,Str "test1"] ("#test1","")] \protect\hyperlink{test1}{link to text test1}

So here the anchor to test2 is lost. But the LaTeX writer CAN
handle this sort of thing, as shown by:

% pandoc -f native -t latex [Span ("test2",[],[]) [Str "hi"] ] \protect\hypertarget{test2}{}{hi}

@jmawhorter
Copy link
Author

Thanks for the quick fix. I confirmed this patch fixed my original problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants