Directly accessing PDFs from BibSonomy in TeXlipse

I am using BibSonomy for my for managing my references and TeXlipse as my LaTeX editor. While the latter is arguably a little outdated, it still works well and provides some features which other editors seem to lack (e.g., partial compilation not supported by TeXstudio or TeXmaker). Anyways, what I wanted was a way to directly access my PDFs from TeXlipse. It turned out there is an easy (if hacky) way of achieving this (of course there are other, cleaner ways such as writing an extension or plug into the existing BibSonomy extension). So here is what is possible now:

Highlight the Bib-Key (such as becker2016sparktrails) and hit F9 (or any custom shortcut). Voilà the PDF opens up.

As I mentioned the process to achieve this is a little hacky, and has some caveats:

  1. It is based on the External Tools functionality built into Eclipse, i.e., we take advantage of the shortcut  (F9) for the last used external tool meaning that if we use another external tool, we need to manually run our “Open PDF” external tool once, before the (F9) shortcut works again.
  2. We need to manually trigger the process of downloading the PDFs from BibSonomy (which need to be stored there in the first place, obviously).

Nevertheless, I found the process quite useful, so here is how to do it:

Howto

We will store our PDFs in a folder within our LaTeX project. I use build/papers . Then we use an external tool which uses the currently selected Bib-Key to open the appropriate PDF.

Downloading PDFs

For downloading the PDFs I use a Python 3 script which I have placed into a folder in my LaTeX project. I call this folder build . Paper are downloaded to build/papers . The python script is called as follows:

Here is the Python 3 source code. Note that this code currently only supports downloading up to 999 publications due to limitations in the BibSonomy API. This could be fixed by implementing a recursive downloading procedure.

 

Open PDFs

The configuration of the external tool ( Run -> External Tools -> External Tools Configuration ) is pretty easy, here my configuration using Okular as PDF viewer:

To configure a shortcut for this external tool, we use the Key Run Last Launched External Tool , which I set to F9. Here is a screenshot of my config:

Future Work

Here is some future work which may prove interesting, but I will probably never come around to do 😉

  • Shortcuts for specific external tools (probably needs an extension) in order to replace the usage of the “last used external tool” key
  • An extension for automatically downloading missing PDFs since we currently need to start this process by hand
  • Extending the already existing BibSonomy plug-in for TeXlipse to create an integrated experience
  • Adding something like this to TeXstudio or TeXmaker via JavaScript extension points, in order to support more recent TeX-editors

i3: Fast switching named workspaces

i3 is a tiling window manager which allows to work nicely with named workspaces. For example, I have a messaging/social workspace, a calendar and TODO workspace, two browser workspaces, my code workspaces and so forth. However, as the number of projects I work on increases, it becomes more difficult to keep track of the different workspaces. To solve this, it would be necessary to create new named workspaces. However, to do this, the config needs to be updated which I am usually to lazy to do.

Now, the core idea to solve this is based on the  i3-input  directive. This lets the user type the name of the desired workspace in order to easily create, rename and move to workspaces with very specific names on the fly. However, this becomes cumbersome when workspace names are longer than two or three characters. To solve this I came up with a little Python script which allows so “shortcode” workspaces. In the following I introduce the Python script as well as the corresponding i3 config entries.

The Python script

The Python script takes three parameters “prefix”, “query”, and “postfix”. It will then pick a workspace from the list of existing i3 workspaces if the query is a prefix of that workspace name (priority 1) or if the workspace contains the query (priority 2). Also, the script supports an “index”, i.e., you can append something to query using a . which is then appended to the name chosen by the script. For example is the workspaces project and project2 exists, then the query is p.2 will choose project2.  Then the script executes a command built from the prefix, the chosen workspace and the postfix: <prefix><chosen name><postfix> .

The i3 config

The Python script introduced above is then used in the i3 config as follows:

This allows to rename a workspace using MOD+Ctrl+m . For example using the name project2 . Then using MOD+m and typing p or  p.2 will take you to that workspace. Similarly, MOD+Shift+m and typing p or  p.2 will move the active container to the project workspace.

Conclusion

This made my life a lot easier since now it is possible to quickly create, rename, and move to arbitrarily named workspaces. I hope this helps a few people making their lives easier 😉 Finally, let me know if you have alternative or better solutions!

BibSonomy Scholar: A Chrome browser extension for BibSonomy

A while ago I was working on a Chrome browser extension for integrating BibSonomy, a social bookmarking and publication management platform, with the Google Chrome browser. The idea was to directly manage publication on the Google Scholar page without the cumbersome process of getting the BibTex, opening BibSonomy, pasting the BibTex, downloading the PDF, uploading the PDF … you get my point.

Google Scholar

Anyways,  the extensions now directly integrates with Google Scholar allowing to manage publications without ever leaving the current page. This includes marking already posted publications, directly posting and deleting publications, automatic upload of PDFs, etc.. Here is a little screenshot:

BibSonomy Scholar integrating with Google Scholar.
BibSonomy Scholar integrating with Google Scholar.

Managing Bookmarks

After a while, I came across the issue of choosing a new laptop, having a million tabs open, clicking through them again and again, trying to remember which laptop an which page was the one I was interested in and why. So I thought that adding tags to URLs for a better categorization of my reviewed laptops and leaving notes on each page would be a tremendous help. While I know that Firefox supports tagging of bookmarks and I guess that there are quite a few browser extensions to support leaving notes, I did not want to get started with yet another system for managing things. So, since BibSonomy actually supports adding tags and descriptions for bookmarks, I added a “Quick Bookmark Button” to the BibSonomy Scholar extension.

Similar to the usual bookmark button in Chrome, this “Quick Bookmark Button” indicates whether the currently viewed URL has already been bookmarked. It also supports posting, deleting and updating bookmarks by clicking on the button or using a keyboard shortcut (CTRL+B). Furthermore, for leaving notes, it renders Markdown directly in the posting dialog. Here is a screenshot:

BibSonomy Scholar - Quick Bookmark Button
BibSonomy Scholar – Quick Bookmark Button

 Conclusion

Overall, I think that the BibSonomy Scholar extension can be quite helpful and allows for a very “integrated” experience of BibSonomy. Of course I see many things which can still be improved and even more features which would be nice to implement. For example, all publications and bookmarks posted are public for now. Especially for bookmarks, this might not always be the desired option. Concerning additional features, I think it would be nice to handle pages from publishers containing publications differently than regular bookmarks, i.e., indicating if the corresponding publication has already been posted, or directly posting this publication instead of a bookmark. There are many more ideas floating around. I hope to find the time to add them at some point.

Finally, if you want to try out the extension have a look in the chrome web store and let me know about your experience with the extension. Also do not hesitate to post bug reports or feature requests or contribute yourself. The extension is open source and can be forked on Bitbucket. I will be happy to accept push request.