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

Export of citation fails #45

Open
hatlafax opened this issue Jan 25, 2023 · 2 comments
Open

Export of citation fails #45

hatlafax opened this issue Jan 25, 2023 · 2 comments

Comments

@hatlafax
Copy link

Exporting a org-mode document to ipynb fails with the following error message: Unable to resolve link "citeproc_bib_item_1"

I have an org-mode document with citations and jupyter-python code blocks that I wish to export to html, latex and ipynb. Export to html and latex works fine and is used routinely. Now the export to ipynb is new and is not working perfectly. My procedure is as follows: I have first exported the org document to org via org-ref as I always do for html export and get something like is shown below. Then I either use the usual html exporter which works fine or the ipynb exporter.

First the original document:
#+title: PyTorch Test
#+category: PyTorch Test

#+include: ../../OptionsPreamble.org
#+include: ../../LatexPreamble.org
#+include: ../../HtmlPreamble.org
#+include: ../../ThemeDakrone.org

#+startup: inlineimages
#+property: header-args:jupyter-python :session jupyter-python-3a884c28cceba85e17d10f6dce2d8df7

  • Description
    Learning the basics of PyTorch[[cite:&PyTorch]].

#+begin_src jupyter-python
print("Hello")
#+end_src

#+RESULTS:
:RESULTS:
Hello
:END:

  • Bibliography

#+csl-style: apa-numeric-superscript-brackets.csl
#+csl-locale: en-US

#+begin_export org
bibliographystyle:apacite
#+end_export
bibliography:../../../bibliography/bibliography.bib

Secondly, the temporary buffer after using org-ref export to Org buffer

#+title: PyTorch Test
#+category: PyTorch Test

#+latex_class: apa7
#+latex_class_options: [a4paper, biblatex]

#+latex_header: \usepackage{physics,amsmath}
...

#+startup: inlineimages
#+property: header-args:jupyter-python :session jupyter-python-3a884c28cceba85e17d10f6dce2d8df7

  • Description

Learning the basics of PyTorch^{[[[citeproc_bib_item_1][1]]]}.

#+begin_src jupyter-python
print("Hello")
#+end_src

  • Bibliography

#+csl-style: apa-numeric-superscript-brackets.csl
#+csl-locale: en-US

bibliographystyle:apacite
<<citeproc_bib_item_1>>1. PyTorch contributors. (2022). /PyTorch - An open source machine learning framework that accelerates the path from research prototyping to production deployment./ https://pytorch.org/

When I now export this temporary buffer with ox-ipynb I get the error message. Do I something wrong or is this expected/known behavior?

An additional problem that I have with the export to the temporary buffer is that the org-babel result section is missing. Is there a simple solution?

Any help is appreciated.

@jkitchin
Copy link
Owner

I guess that could be expected. the exporter has some challenges for an example like this. I think what happens is it is trying to export the string containing that link to markdown in isolation (i.e. it does not know about the target at the end. That is a limitation of the exporter that can't be easily fixed. A solution might be to (setq org-export-with-broken-links t) which should allow it to work, although perhaps the links will not work in the notebook.

@hatlafax
Copy link
Author

org-export-with-broken-links did work for me. At least now I got the bibliography at the end of the document. The cite links
do not work as expected. Thanks for taking time.

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