mcmtroffaes / sphinxcontrib-bibtex

Sphinx extension for bibtex style references.
Other
172 stars 44 forks source link

Can't jump back from a bib item to the corresponding cite. #11

Closed laishulu closed 11 years ago

laishulu commented 11 years ago

It's far beyond my expectation that it provides a feature the we can jump from a citation to the bibitem back and forth.

But I find there is a bug that I can't jump back from a bib item to the corresponding cite.

I notice the href property of the bititem node is right, but there is no corresponding id property in the cite node.

I think only a minor modification is needed, which would cost you only 5 miniutes :-)

moorepants commented 11 years ago

I've observed this too. It seems as if the citation hyperlinks are broken in the LaTeX pdf.

Back and forth might not be possible because you may have multiple citations for a single reference.

laishulu commented 11 years ago

I found it in the generated HTML pages, not LaTeX pdf.

moorepants commented 11 years ago

The backlinks from the reference list may not be possible due to the fact that you can have multiple citations for a single reference.

laishulu commented 11 years ago

aha... you have forgot it yourself. The result bibitem is in the following form:

[33] (1, 2) Kiran-Kumar .....

where 33 is not a link, but 1 and 2 in the parenthesis are links, each links to its citation.

laishulu commented 11 years ago

Hei, Mr. Troffaes, Did you see my message? because different citation of one bibitem is differentiated by a differnt number just before the author field, in the form of:

[33] (1, 2) Kiran-Kumar .....

It's absolutely possible to back link from the preceding number to each citation.

mcmtroffaes commented 11 years ago

Thanks for the report. Actually, I've also observed this problem, and it's an issue with citation nodes in general. The bug resides in either Sphinx or docutils: try to generate a document with regular Sphinx citations, and you'll see that backlinks won't work. I'll post a ticket for it upstream.

In the mean time, is there a simple workaround? How should we modify the generated citation, or citation_reference, nodes, so the backlinks work?

laishulu commented 11 years ago

I don't know, but the most naive solution I think is to add a id attribute in the genrated cite node with the value of the bibitem occurence number.

mcmtroffaes commented 11 years ago

Reported upstream here:

https://bitbucket.org/birkenfeld/sphinx/issue/972

mcmtroffaes commented 11 years ago

A fix in Sphinx was posted by Nozomu Kaneko:

https://bitbucket.org/birkenfeld/sphinx/pull-request/97

mcmtroffaes commented 11 years ago

Status update: footnote backreferences are fixed with Sphinx 1.1.3 (possibly earlier, but that's the one I tested with), however it seems that citation backreferences still do not work...

mcmtroffaes commented 11 years ago

... actually it does work with Sphinx 1.2b1! Closing.