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

Citation manager stops working when copying cells in a new notebook #35

Open
baggiponte opened this issue Oct 24, 2021 · 5 comments
Open
Labels
bug Something isn't working

Comments

@baggiponte
Copy link

baggiponte commented Oct 24, 2021

Description

I am drafting my final dissertation using Jupyter Notebooks and Jupyter Book to "compile" it into LaTeX. jupyterlab-citation-manager is a godsend, but unfortunately today I encountered some minor issues that gave me some pretty decent sized headaches.

When I moved some paragraphs (containing citations) that I had written in one notebook to another one, the extension stops working in that notebook. When I alt + c to insert a citation, the search bar appears, but nothing is inserted. It took me the cell metadata inspector to find out what happened: while the cells metadata are copied over, the notebook metadata is not.

Reproduce

EDIT: the error does not occur when copying the content of the cell (like with ctrl+c ctrl+v), but only when copying over multiple cells with Jupyter default shortcuts C V or X

  • In notebook A, insert some citations (either with alt + c or the GUI) in a markdown cell. Save the file.
  • Create notebook B and copy over the cell containing the citations from notebook A.
  • Attempt to insert citations in notebook B

Context

  • Operating System and version: macOS 11.6
  • Browser and version: Brave Browser 1.31.87.0 (Chromium)
  • JupyterLab version: 3.2.1

Possible Suggestions?

  • When reloading with alt + u check whether metadata across cell and notebook match
@baggiponte baggiponte added the bug Something isn't working label Oct 24, 2021
@krassowski
Copy link
Owner

Thank you for the report and narrowing down the likely cause. I'm sorry about the bad experience you had. I will set aside some time to fix this one during next weekend.

@baggiponte
Copy link
Author

Dear Mike, do not be sorry at all! Quite the opposite, I wish I could be of greater help. I need to finish my dissertation by November 15th and then I have time to contribute. I basically just know Python (for data analytics/data science), so I do not really know how I could help. But please do let me know if there is something I could do for this project - even just writing the documentation.

@krassowski
Copy link
Owner

I was not able to reproduce the bug as described (by copying between notebooks, or cutting and pasting to another notebook). I was able to break it by copying a cell and pasting it again in the same notebook, which is a simpler case; I wonder if it could be that you tried to paste a cell copied from notebook A twice into the notebook B?

In my case I get the following error in the console in developer tools:

Screenshot from 2021-10-31 22-01-26

This is relatively simple to fix as we just need to re-assign the citation ID if it is already taken. I didn't find a paste-specific event for cells, but it probably should be triggered when catching the exception shown above, so that the manual edits give the same result.

If it happens again (or if you have time to try to reproduce it), would you be able to check if there is any error in the console, please? A GIF demonstration on two clean notebooks could also help, maybe I am just missing some less obvious step that leads to the occurrence of this bug.

@baggiponte
Copy link
Author

baggiponte commented Nov 6, 2021

Hi Mike, sorry if I could not reply to the conversation here and on the other issue - I will be more active after the 15th, I need to finish my dissertation

@eldad-a
Copy link

eldad-a commented Apr 12, 2022

@krassowski

Thank you for this wonderful extension!

I've noticed that when I copy parts of jupyterlab cells containing citations, or move entire cells, I encounter a bug that seems related (or the same?).

At the bottom toolbar of jupyterlab there appears the following (please see snapshot)

image

stdout reads

[IPKernelApp] ERROR | No such comm target registered: jupyter.widget.control

(at the terminal from which the jupyter server has been started)

Looking into the dev tools, as you kindly suggested 35#issuecomment-955800056, here's what shows up:

image

Please let me know if any further info could help resolve.

For now, once this occurs, the work around is to remove the conflicting citation.
Any other ideas?

Any suggestions how to idetify which citation is the conflicting one?

For completeness : here's the specific element that is added when trying to add a new citation when the problem occurs:
image

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants