Jumping back from pdf reader to the library via an addon

I know that integrated pdf reader is abandoned.
But maybe writing an addon to some other reader, a button, that will do a reverse search by filename in the JabRef library and bring up the relevant record?

I don’t know about the technical considerations, but getting back to JabRef is one issue, and selecting the correct reference is another. Keeping the current entry highlighted as well as within view in the entry editor is the subject of one or two open issues (I am not able to look up the links at the moment). Is the main difficulty getting back to the window, relocating the correct entry after you return to the JabRef window, or both?

Mainly the missing part is locating the entry. It requires copy pasting the title from the pdf which is sometimes takes a few attempts, then pasting it in Jabref search, editing the search text because of extra space or some greek characters in the way and ending up not 100 percent sure that this is the very same version, opening the file from the entry, validating and going back to Jabref to copy the citation. All this could be a single bullet proof button reverse searching the file path.

Which makes me of a second button maybe even more useful - copy a citation key from inside the pdf reader.

Manually bringing to front the Jabref window is just an extra click, not important.

Thank you!!

The issue that most often causes me to to lose my place in the entry table is that the selected entry can lose its highlight when I interact with the entry editor. I discovered at one point that this occurs when the search box contains input (Keep entry highlighted after editing · Issue #10439 · JabRef/jabref · GitHub). I seem to lose my place frequently even when not using the search box, and only just realised that this might be due to a bug.

If the selected entry is in a shaded row, it remains highlighted after I interact with the editor, but if the entry is in an unshaded (white) row, the highlight disappears when I interact with the editor. This includes opening a PDF via the entry editor. In contrast, if I open a PDF using the icon in the entry table, the entry remains highlighted and visible when I close the PDF and return to JabRef.

In addition to your suggestion, here are some more ideas for potential JabRef improvements.

  • Introduce a feature where one or more entries can be “pinned” to the top, as in Outlook email.
  • Introduce a marker for flagging one or more “working” entries, like the line markers sometimes used in text editors (e.g. a dot in the row margin).
  • Introduce a “freeze” feature like Excel, where the row/column of interest can be locked in place while the rest of the table scrolls.
  • Introduce a keyboard shortcut that scrolls the entry table to the the currently selected entry if it is not within view – I don’t think this already exists – and/or a shortcut that focuses the entry table on a marked/flagged entry.

Note:

  • Consider using the citation key to re-locate entries in JabRef. Use Ctrl+Shift+K to copy the key before opening the PDF. Obviously, this can only help if the key remains in the clipboard when you return to JabRef.
  • Improve your copy-paste results by enabling “reflow”, if available, in your PDF application. The one I use most often (PDF-XChange) has an option to include or trim extra spaces. Ligatures and custom fonts are more of a challenge, I’m afraid.
  • If you use Windows and your PDF application does not have any copy-paste-improving features, here is an AutoHotkey script that can help. Don’t expect perfection.

Thanks but my scenario is different. I’m writing a paper and have a lot of references opened as tabs in the pdf reader. I double check something with a reference and want to drop a citation into the text i write, and it just takes too long.

Ah, I see what you mean. You are moving from PDF to JabRef, not necessarily from JabRef to PDF and back again, so the desired functionality is something like:

  1. Visit a PDF
  2. Get identifying information from the PDF
  3. Try to match the identifier with an entry in the currently open JabRef library.
  4. Do something with the related entry data, such as:
    (a) Change focus to the JabRef window and “go to” the entry (filter or select it)
    (b) Copy the related entry’s citation key to the clipboard, without leaving the PDF reader, for instance using a shortcut, button, or menu item in the PDF app.
    (c) Insert the citation key or formatted reference into an open document or editor.

JabRef already has the ability to get identifying info from PDFs, already links annotations within PDFs to the library entries, and already has features for copying/pushing citation keys, so accessing these capabilities from the PDF editor is the missing link (and hence, your reference to an integrated reader). I only dabble in code, so I wouldn’t be the one to implement this idea, but I would probably use it. Simply finding the related entry in JabRef would probably be good enough for me.

Note: If you use Windows, you could still use AutoHotkey to quickly grab the file name from an open PDF and paste this into JabRef’s search box.

Yes.
Thank you for the suggestion, the autohotkey indeed looks like a viable option to get the pdf filename, which is half way there already

1 Like