5 ms·
Author here, if you have any questions, feel free to ask them. It really is amazing how hard it is just to retrieve the currently opened pdf file and its page
by rcap 5y ago
Author here, if you have any questions, feel free to ask them.
It really is amazing how hard it is just to retrieve the currently opened pdf file and its page number in a pdf viewer. Some pdf viewers (Like Zathura) provide this via DBus, but even very common ones like Evince don't. I managed to find a way using gvfs, although it's a bit of a hack.
For others (e.g. Mendeley), I have no idea on how to do this... Anybody have ideas? it is Qt based, maybe I can hook into that via some debugging tool?
- dancsi 5y agoI guess it will be easier to get it working with Zotero, as it's open source, and I think it even supports custom plug-ins.
- jessriedel 5y agoYes, Zotero does support custom plug-ins ("add-ons").
- 533474 5y agoTry emacs and org-mode sometime. Configurability is off the charts and vi keybindings are easily configurable (and so are the snippets). I loved the workflow, I believe that a mind like yours will also find emacs elisp captivating and I would love to see what you could come up with in that much more flexible ecosystem (I am a former Vim evangelist)
- hollerith 5y agoWhat does org mode have to do with the problem where you have a document open in a PDF viewer and you want to retrieve the location of the document in the file system and what page is currently showing in the viewer's window?
- nonrandomstring 5y agoIf you're using Org-ref, and have used that to drill down into your pdfs then you always have the document context (and bibtex etc context) from within emacs. But I don't think that is the OPs use case, so apologies for the noise. Also careful use of unix find with pdfgrep can be handy.
- joeman1000 5y agoThe fact that pdf-tools (in emacs) makes this an utterly trivial task.
- joeman1000 5y agoThe solution is emacs. I know you’ve got a lot invested in vim already. You can get instant LaTeX rendering with AUCTeX, view the pdf in emacs with pdf-tools, which can be used with something like org-ref (there are many bibliography packages) to query a db with the DOI of the pdf. (Try saying that two times fast). This EmacsConf talk should give you a taste of what I mean: https://emacsconf.org/2021/talks/research/ https://emacsconf.org/2021/talks/research/ Your old post with instantly rendering latex snippets actually inspired me to start using vim/LaTeX. This opened up a whole new world for me. I started programming, got back into my engineering degree, started using emacs/org-mode and have nearly finished the degree. Thank you, from the bottom of my heart. I don’t know what I’d be doing if I hadn’t seen your post. It revealed a way of using computers that I had never seen before.
- jgwil2 5y agoThis one? https://castel.dev/post/lecture-notes-1/ https://castel.dev/post/lecture-notes-1/ HN thread: https://news.ycombinator.com/item?id=19448678 https://news.ycombinator.com/item?id=19448678
- joeman1000 5y agoYes, this is the one. I couldn’t help but want the same speed and beauty as in that post.
- triyambakam 5y agoWhere are you taking your degree?
- joeman1000 5y agoMonash university
- sverona 5y agoNo questions. You're a pretty swell dude and I used a lot of your advice while writing my thesis. Love your work.
- randomsilence 5y agoHave you tried contacting the developers? This seems like a feature that every pdf viewer should have.
- mixedmath 5y agoOn recent-ish versions of evince it is possible to do a bit more via dbus. For example, forward and reverse synctex search between evince and vim over dbus is done at [1]. I use this when I use evince, but I acknowledge that it has stupid flaws. [1]: https://github.com/peterbjorgensen/sved https://github.com/peterbjorgensen/sved
- mixedmath 5y agoHaving written this, I am actually completely incapable of retrieving the page number over dbus. (As you had mentioned). I'm a bit surprised that forward and reverse search can still be done.