Zotero

From Remeis-Wiki
Jump to navigation Jump to search

Zotero - a reference manager

Why use a reference manager?

When doing research, you will very quickly amass a large number of papers and other publications that are useful for your research (as a rule of thumb, if you're reading less than 1-2 papers per day, you are not reading enough). While you may think that you will remember where you read something, this is not true, and therefore you will soon need some way to store all of that information. While online services such as the ADS provide you with some way to collect papers in "libraries", they provide little flexibility, often cannot be fine tuned to your needs (e.g., having hierarchical structures of libraries), often do not provide a way to annotate the publication or leave other notes with the paper, and they do not work when you are offline (e.g., on the train between Wuerzburg and Frankfurt, or on a plane). In addition, keeping other publication lists such as files for bibtex up to date is difficult with these online sources.

A reference manager such as zotero is a very good way to solve all of these problems.

On this page I (J. Wilms) explain how I structure my zotero collection.

Installing zotero and its plugins

General Installation

  • If it is not available, download zotero for your operating system from the Zotero web pages. On the Remeis cluster, just activate it with module load zotero.
  • On the zotero download page, it will also offer you to install the Zotero Connector for your browser. Install it and give it permission to access the pages you are browsing. The connector is a browser plugin that provides a one-click download of pdf and the bibliographic information from any online source that it recognizes, as well as getting information from PDFs and normal webpages. It only works while zotero is running as well.
  • For a smooth experience that works well in astronomy, download the following plugins from the list of zotero plugins: Better BibTex, ZotFile, and optionally the Storage Scanner for Zotero.

Zotero configuration

To configure zotero, go to Edit->Preferences. The following Image shows my General setup, I have left the other values at their default settings (although you might want to change the data directory location in Advanced->Files and Folders ).

recommended general options for zotero


ZotFile Configuration

Next, configure ZotFiles. This plugin can automatically recognize new PDFs in a Source folder and it can also copy new files to a pdf library that is outside of zotero. This is advantageous since it keeps the zotero storage small such that you can use zotero's online library to move the zotero database around. It also makes your life easier since it is also possible to access PDFs directly if necessary. For ZotFile I use the following settings:

  • Source Folder for Attaching New Files: I use ~/Downloads
  • Location of Files: Use "Custom Location" and set it to the path where you want to store the PDFs.
  • Tick on "User subfolder defined by" and set the field to /%y . This will sort your media according to the year of publication into subfolders.
  • On the tab "Renaming Rules":
    • switch off "User Zotero to Rename"
    • change "Format for all Item Types except Patents to %a_%y_%t . This gives filenames consisting of the first author, year of publication, and the abbreviated title of the publication (I find leaving the year in the filename useful in case I need to use the file elsewhere).
    • In the additional settings I have _ as the Delimiter between multiple authors and I have ticked "Change to lower case", "Replace blanks", "Truncate title after . or : or ?". Maximum length of title 30 (you might want to shorten this!), maximum number of authors at 1, and I switch off "Add suffix when authors are omitted".
  • On the tab "Advanced Settings" I set:
    • Automatically rename new attachments to "Always Rename"
    • ask for batch rename for 2 or more attachments
    • remove special characters from filename

Better BibTex Configuration

Better BibTex will automatically generate unique bibtex tags. It also contains code to output bib-files from zotero libraries and to keep these updated whenever a new item is added to a library.

In the Better BibTeX configuration, I suggest the following:

  • Citation keys:
    • Citation key formula: I suggest ```auth.fold.lower+year. This generates citation keys consisting of the first author name and a year (postfixed with a, b, c etc. if there are multiple media from the same author in the year. I recommend using lower case names only for simplicity.
    • Switch on "Force citation key to plan text"
    • I do not use enable citation key search.
    • Set Automatically pin citation key after 0 seconds (this ensures that citation keys are fully under control of the plugin)
  • Export:
    • BibTeX tab:
      • switch on "Export unicode as plain-text latex commands"
      • all other check boxes are off.
      • add urls to bibtex export: "in the url field"
    • BibLaTex:
      • I recommend not using BibLaTeX. This is a bit unfortunate, since BibLaTeX is a good idea in principle, but it does not scale to larger libraries and it cannot produce reference lists in the way needed by journals in astronomy and astrophysics.
    • Fields:
      • export language as langid
      • when an item has both a DOI and a URL, export both
      • fields to omit from export: ```abstract,file,urldate,keywords,issn,language,url,shorttitle,copyright (although you might want to leave the url in the bibtex)
      • Include JabRef-specific metadata: no
    • Quick-Copy:
      • I do not use this, so I left things at their default values
    • postscript
      • This is javascript code that is used to manipulate the generated bibfile. The following code will generate journal fields with LaTeX-commands appropriate for astrophysical journal styles.
if (Translator.BetterBibTeX) {
   if (reference.has.journal) {
       switch(item.publicationTitle) {
          case "Acta Astronomica":
               reference.add({name: 'journal', value: "\\actaa", enc: 'raw'});
               break;
          case "Advances in Space Research":
               reference.add({name: 'journal', value: "Adv.\ Space Res.", enc: 'raw'});
               break;
          case "The Astronomical Journal":
               reference.add({name: 'journal', value: "\\aj", enc: 'raw'});
               break;
          case "Annual Review of Astronomy and Astrophysics":
               reference.add({name: 'journal', value: "\\araa", enc: 'raw'});
               break;
          case "Astrophysical Letters and Communications":
               reference.add({name: 'journal', value: "\\aplett", enc: 'raw'});
               break;
          case "Astrophysical Journal":
          case "The Astrophysical Journal":
          case "The Astrophysical Journal Letters":
          case "The Astrophysical Journal, Letters":
               reference.add({name: 'journal', value: "\\apj", enc: 'raw'});
               break;
          case "The Astrophysical Journal Supplement Series":
          case "The Astrophysical Journal, Supplement":
               reference.add({name: 'journal', value: "\\apjs", enc: 'raw'});
               break;
          case "Applied Optics":
               reference.add({name: 'journal', value: "\\ao", enc: 'raw'});
               break;
          case "Astrophysics Letters":
               reference.add({name: 'journal', value: "\\aplett", enc: 'raw'});
               break;
          case "Astrophysics and Space Physics Research":
               reference.add({name: 'journal', value: "\\apspr", enc: 'raw'});
               break;
          case "Astrophysics and Space Science":
               reference.add({name: 'journal', value: "\\apss", enc: 'raw'});
               break;
          case "Astronomy and Astrophysics":
          case "Astronomy & Astrophysics":
               reference.add({name: 'journal', value: "\\aap", enc: 'raw'});
               break;  
          case "Astronomy & Astrophysics Reviews":
          case "The Astronomy & Astrophysics Reviews":
               reference.add({name: 'journal', value: "\\aapr", enc: 'raw'});
               break;    
          case "Astronomy & Astrophysics Supplement":
          case "Astronomy and Astrophysics Supplement Series":
               reference.add({name: 'journal', value: "\\aaps", enc: 'raw'});
               break;         
          case "Astronomicheskii Zhurnal":
               reference.add({name: 'journal', value: "\\azh", enc: 'raw'});
               break; 
          case "Bulletin of the AAS":
               reference.add({name: 'journal', value: "\\baas", enc: 'raw'});
               break; 
          case "Bulletin of the Astronomical Institutes of Czechoslovakia":
               reference.add({name: 'journal', value: "\\bac", enc: 'raw'});
               break; 
          case "Bulletin of the Astronomical Institute of the Netherlands":
               reference.add({name: 'journal', value: "\\bain", enc: 'raw'});
               break; 
          case "Chinese Astronomy and Astrophysics":
               reference.add({name: 'journal', value: "\\caa", enc: 'raw'});
               break; 
          case "Chinese Journal of Astronomy and Astrophysics":
               reference.add({name: 'journal', value: "\\cjaa", enc: 'raw'});
               break; 
          case "Fundamental Cosmic Physics":
               reference.add({name: 'journal', value: "\\fcp", enc: 'raw'});
               break; 
          case "Geochimica Cosmochimica Acta":
               reference.add({name: 'journal', value: "\\gca", enc: 'raw'});
               break; 
          case "Geophysics Research Letters":
               reference.add({name: 'journal', value: "\\grl", enc: 'raw'});
               break; 
          case "IAU Circular":
               reference.add({name: 'journal', value: "\\iaucirc", enc: 'raw'});
               break; 
          case "Icarus":
               reference.add({name: 'journal', value: "\\icarus", enc: 'raw'});
               break; 
          case "Journal of Cosmology and Astroparticle Physics":
               reference.add({name: 'journal', value: "\\jcap", enc: 'raw'});
               break; 
          case "Journal of Chemical Physics":
               reference.add({name: 'journal', value: "\\jcp", enc: 'raw'});
               break; 
          case "Journal of Geophysics Research":
               reference.add({name: 'journal', value: "\\jgr", enc: 'raw'});
               break; 
          case "Journal of Low Temperature Physics":
          case "J Low Temp Phys":
               reference.add({name: 'journal', value: "J.\\ Low Temp.\\ Phys.", enc: 'raw'});
               break;
          case "Journal of Quantitative Spectroscopy and Radiative Transfer":
               reference.add({name: 'journal', value: "\\jsqrt", enc: 'raw'});
               break; 
          case "Journal of the Royal Astronomical Society of Canada":
               reference.add({name: 'journal', value: "\\jrasc", enc: 'raw'});
               break; 
          case "Memoirs of the Royal Astronomical Society":
               reference.add({name: 'journal', value: "\\memras", enc: 'raw'});
               break; 
          case "Monthly Notices of the Royal Astronomical Society":
               reference.add({name: 'journal', value: "\\mnras", enc: 'raw'});
               break; 
          case "Monthly Notices of the Royal Astronomical Society: Letters":
               reference.add({name: 'journal', value: "\\mnras", enc: 'raw'});
               break;           
         case "Memorie Societa Astronomica Italiana":
               reference.add({name: 'journal', value: "\\memsai", enc: 'raw'});
               break; 
          case "New Astronomy":
               reference.add({name: 'journal', value: "\\na", enc: 'raw'});
               break; 
          case "Nuclear Physics A":
               reference.add({name: 'journal', value: "\\nphysa", enc: 'raw'});
               break; 
          case "Physical Review A":
               reference.add({name: 'journal', value: "\\pra", enc: 'raw'});
               break; 
          case "Physical Review B":
               reference.add({name: 'journal', value: "\\prb", enc: 'raw'});
               break; 
          case "Physical Review C":
               reference.add({name: 'journal', value: "\\prc", enc: 'raw'});
               break; 
          case "Physical Review D":
               reference.add({name: 'journal', value: "\\prd", enc: 'raw'});
               break; 
          case "Physical Review E":
               reference.add({name: 'journal', value: "\\pre", enc: 'raw'});
               break; 
          case "Physical Review Letters":
               reference.add({name: 'journal', value: "\\prl", enc: 'raw'});
               break; 
          case "Publications of the Astronomical Society of the Pacific":
               reference.add({name: 'journal', value: "\\pasp", enc: 'raw'});
               break; 
          case "Publications of the Astronomical Society of Japan":
               reference.add({name: 'journal', value: "\\pasj", enc: 'raw'});
               break; 
          case "Publications of the Astronomical Society of Australia":
               reference.add({name: 'journal', value: "\\pasa", enc: 'raw'});
               break; 
          case "Physics Reports":
               reference.add({name: 'journal', value: "\\physrep", enc: 'raw'});
               break; 
          case "Physica Scripta":
               reference.add({name: 'journal', value: "\\physscr", enc: 'raw'});
               break; 
          case "Planetary Space Science":
               reference.add({name: 'journal', value: "\\planss", enc: 'raw'});
               break; 
          case "Proceedings of the SPIE":
               reference.add({name: 'journal', value: "\\procspie", enc: 'raw'});
               break; 
          case "Quarterly Journal of the Royal Astronomical Society":
               reference.add({name: 'journal', value: "\\qjras", enc: 'raw'});
               break; 
          case "Revista Mexicana de Astronomia y Astrofisica":
               reference.add({name: 'journal', value: "\\rmxaa", enc: 'raw'});
               break; 
          case "Sky and Telescope":
               reference.add({name: 'journal', value: "\\skytel", enc: 'raw'});
               break; 
          case "Solar Physics":
               reference.add({name: 'journal', value: "\\solphys", enc: 'raw'});
               break; 
          case "Soviet Astronomy":
               reference.add({name: 'journal', value: "\\sovast", enc: 'raw'});
               break; 
          case "Space Science Reviews":
               reference.add({name: 'journal', value: "\\ssr", enc: 'raw'});
               break; 
          case "Zeitschrift für Astrophysik":
               reference.add({name: 'journal', value: "\\zap", enc: 'raw'});
               break; 
       }
   }
}

(NB you can also set individual journal abbreviations in the entries for individual articles; this is recommended for journals not in the above list)

  • Tab list continued
    • Miscellaneous
      • switch off "automatically abbreviate journal title" and "include comments about potential problems"
      • turn on "include automatic tags in export"
      • when converting to plan text latex: "Minimize the number of switches between math-mode and text-mode"
      • switch on apply title-casing to titles
      • switch on apply case-protection to capitalized words by enclosing them in braces"
  • Automatic export: set "on change" to no - this will keep your bibfiles updated

General recommendations

These are a few additional comments on how I use zotero:

  • When writing a paper I generate a new library and copy the references there. This is mainly because my zotero library is very large (more than 6000 individual papers). In most cases, keep things that belong together in the same library (e.g., all neutron star papers in a "neutron star" library, all AGN papers in an "AGN" library).
  • Use sublibraries to structure things (e.g., I have libraries for individual sources)
  • papers can be in multiple libraries (so if a paper is, e.g., on accretion in a specific source but also contains interesting thoughts about accretion in general, it will be in both, the "accretion library" and the source specific library.
  • keep bibfiles in sync for those libraries pertinent to a project you're working on. You do this by pressing the right mouse button and export the collection using "Better Bibtex". Enable "use journal abbreviation", "keep updated", and "background export". Do NOT enable "Export notes" and "Export Files".
  • SPIE papers are not exported correctly from the ADS. Go to the journal page at SPIE and get the PDF from there. You might want to check that the editors and conference are set correctly. If not, add them by hand (add a new author and then switch from "Author" to "Editor".