Skip to main content

Set up Zotero Attachment File Synchronisation with Google Drive

Background

I had a ton of downloaded PDF papers. These files were unorganised and kept in a folder in my Google Drive. I learned about Zotero from a colleague and started using it. I was very impressed at the begining for its convenience and ease of use. Just drag a PDF file into Zotero, and select an option to retreive metadata from the PDF and viola! A proper citation record is ready! I can export it to bibtex format in order to use the citation in Latex, or include it in MS Word in my preferred citation style.

The most exciting feature of Zotero for me was the ability to take notes on a paper and keep them organised. I can search for a paper/topic, and open a relevant paper PDF from zotero. I can write comments on that PDF or take notes and everything will be synced to the server. However, soon I began to notice some issues. Zotero didn't use the downloaded PDF files, but included a copy of them instead. These copies were being synced to the Zotero server and soon filled my 300MB storage that came with Zotero. Therefore, new PDF files were not being synced and I couldn't access them from Zotero on my laptop. This was really inconvenient and frustrating. Sure I can open them manually from the Google Drive folder, but then what's the point of organising it in Zotero?

Things got worse when I reinstalled Windows on my laptop and installed Zotero again just to find out that many items that were included from my laptop were lost! Fortunately I had PDFs in Google Drive, but nonetheless, I lost the notes and comments. It was obvious that the loss was due to Zotero not using the PDFs from my Google Drive folder. I became frustrated and started reading through Zotero documentations. I found out that all citations, notes and tags are synced as citation data while all included files are separately synced as attached files. There is no storage limits for citation data and the 300MB limit is only applicable for attached files. I also discovered several other useful features.

I started setting up Zotero from scratch. My goal was to set up preferences so that Zotero will use the files in my Google Drive and won't make copies of them. This way, any comments made in a PDF file will be available in both my office PC and laptop through Google Drive synchronisation. I found that Zotero can use WebDAV protocol to synchronise attached files to a non-zotero server. There are some third party solutions available providing WebDAV access in Google Drive, but I didn't want to use any third-party service. After further research and several trials and errors, I managed to achieve the desired effect just by tweaking some preferences. In this post I will describe the process of setting up Zotero file synchronisation through Google Drive without using any third-party software.

Goal

  1. Synchronise citation data through Zotero
  2. Synchronise attached files through Google Drive
  3. Avoid file duplication

Set up preferences

Basically, two preferences need to be adjusted to achieve the desired effect:

  • Synchronisation: After entering credentials, several options are provided for both data synchronisation and file synchronisation. For Data Syncing, I checked both Sync automatically and Sync full-text content options since there is no storage limitation. For File Syncing, two options regarding personal and group library syncing can be checked. Initially, I unchecked both Sync attachement files in My Library using Zotero and Sync attachment files in group libraries using Zotero storage options. But in the end, I decided to check both of them after some trials. This is to enable syncing of non-PDF documents such as a web page snapshot, which are not available in my Google Drive.
  • Advanced -> Files and Folders: This tab provides the remaining option to achieve our goal. Under the Linked Attachement Base Directory, I chose the folder in my Google Drive that contains all my downloaded PDF documents as Base Directory. I tried to tinker with Data Directory Location, but for some reason Zotero couldn't access the database if I change the location and failed to start. Therefore, I decided to leave it at Default.

Adding a citation

I first download a desired PDF paper in Google Drive, then add it as a link in Zotero. This causes Zotero to create a link (shortcut) to the PDF instead of creating a copy. The Base Directory option enables relative path for the shortcut. Since the PDF files are synchronised through Google Drive, they are under the same base directory, therefore, can be accessed from Zotero on both my laptop and office PC. Adding a PDF as a link can be done by choosing Attach link to file... from context menu, or pressing Ctrl + Shift during drag-and-drop of a PDF file.

Since link attachements are considered as citation data, they are synchronised to the Zotero server. Zotero no longer creates copies of the PDF files, rather uses the files in my Google Drive. Thus the attached files are synchronised through Google Drive and no file duplication is performed. This way, all three goals are achieved without using any third party software or service.

Comments

Popular posts from this blog

DigitalOcean droplet: Repair broken Ubuntu with recovery ISO

Recently, I needed to repair a Ubuntu droplet server that was stuck in a kernel panic. The server maintainer decided to upgrade the OS from Ubuntu 16.04 to 18.04. Everything went well until the final restart after the upgrade when the dorplet was stuck during boot. The maintainer could not SSH into the system and the website was down as well. In the DO control centre, CPU usage of the droplet was showing 100% and the console was showing the kernel panic state and the system calls that caused it. I searched around and found this post that had a similar problem and solved it. Basically, these are the steps: Boot into the recovery ISO Mount and chroot into the existing filesystem Reinstall the kernel From the console commands, it was obvious that the solution was for REHL based distributions and I will need to use ' apt ' instead of ' yum ' for Ubuntu. I found the appropriate command after a bit of digging: apt-get install --reinstall linux-image-generic linux-i

Finding Optimal PDF Paper Size for Kobo Clara HD Ereader

tl;dr: Optimal page layout for Kobo Clara HD ereader: Width: 9cm, Height: 11.1cm, margins: 0.5cm. **** I have recently bought a Kobo Clara HD ereader. I used to own a Glo HD ereader by the same company, until I accidentally pushed it off the table causing its display to crack. Though I prefer EPUB format for reading on an ereader, there are many cases when a PDF format might be more convenient. However, regular PDF files are difficult to read on the ereader for their large page sizes. The PDF viewer of the device scales a page to fit its display causing tiny texts. I can zoom in a section to read, however I need to swipe and drag around to view other areas which is really not convenient due to slow response time of e-ink display. Worse is when I accidentlly tap the display, causing it  to immediately turn the next page. I need to go back to previous page and go through all the zooming and dragging before I can resume reading. Therefore I always wanted to generate a PDF optimized