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

Allow to embed citations using Jupyter Book syntax #15

Open
krassowski opened this issue Jul 18, 2021 · 5 comments
Open

Allow to embed citations using Jupyter Book syntax #15

krassowski opened this issue Jul 18, 2021 · 5 comments

Comments

@krassowski
Copy link
Owner

https://jupyterbook.org/content/citations.html

@krassowski
Copy link
Owner Author

Additional discussion on gitter: https://gitter.im/jupyterlab/jupyterlab?at=61057eae6ccf813819e9f6a3

@baggiponte
Copy link

Hi, adding one footnote to this issue.

As one should expect, with Jupyter Books if I store my bibliography in a .bib file but insert the citations with the citation-manager, these won't be inserted because Jupyter Book does not recognize the format.

The converse, however, is also true: if I insert the bibliography with the citation-manager at the end of a chapter with alt - B and then build the book, no references will be added. Perhaps this is because the <div class="csl-entry"> ... </div> tags cannot be parsed?

Also, how do you see this being implemented? I would love to help out on this one, because of the crazy synergy. Could the citation manager retrieve citations from a .bib file? Is this just a matter of citation keys not matching? Could the metadata in the ipynb notebook be rewritten in a format that could be used in the md:myst notebook to build a book?

@baggiponte
Copy link

The converse, however, is also true: if I insert the bibliography with the citation-manager at the end of a chapter with alt - B and then build the book, no references will be added. Perhaps this is because the

...
tags cannot be parsed?

I can confirm removing the <div>...</div> tags solves the issue. To be fair, I removed all <div>, <i> and comment <!--...--!> tags (the italic was not parsed). A script that removes these should be easily implemented, even simply using sed. Then, to have the reference list at the end of the book I simply cut-pasted these into a references.md file that I added as the last chapter, here.

I believe the better place to put this should be closer to jupytext, shouldn't it? This is easier said than done, I guess... But as far as to make sure that people using jupytext/jupyter book and the citation-manager, this seems a viable short-term solution.

The real deal of this thing should be to have the citation-manager use the same reference keys that appear in the .bib file, so that the bibliography is automatically generated like this. Then, it should just be a matter of replacing the html tags with the MyST syntax.

@krassowski
Copy link
Owner Author

counterpoint: if the div tag is a problem, shouldn't it be fixed in nbconvert/jupyter book?

@baggiponte
Copy link

that makes a lot of sense xD I am new to these things, would you ping some maintainer of jupyterbook or shall I open the issue there?

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

No branches or pull requests

2 participants