Giter Site home page Giter Site logo

doitex's Introduction

doitex.rb

Script to automatically parse doi citations from LaTeX documents and download the corresponding references from CrossRef.

Usage

Just cite references in your LaTeX document using the format \cite{doi:<doi>}. Then, after running latex, pdflatex, xelatex, etc., run

ruby doitex.rb <aux_file> <bib_file>

Your bib_file will automatically be augmented with the missing references. If you are compiling a LaTeX document called article.tex with a bibliography file references.bib, run

pdflatex article
ruby doitex.rb article.aux references.bib
bibtex article
pdflatex article
pdflatex article

Hopefully in the future I/you/we can incorporate this into a latexmk workflow.

Using a mapping file

You can also specify a key-to-doi mapping file in YAML format:

citekey1: doi1
citekey2: doi2
...

This might be useful if you want to use identifiable citation keys in your latex document, almost like a barebones bibtex file. Then just call doitex with the -m option:

ruby doitex.rb -m <ref_map> <aux_file> <bib_file>

Citations that don't have a DOI

No problem! doitex just adds missing references to an existing bib file, so you can have anything else in there too.

Dependencies

Installation

You need ruby (comes with macOS and generally with Linux). I've tested this on Ruby 2.4.2, but raise issues if you find compatibility problems. Then, just install the dependencies:

gem install bibtex-ruby serrano

CrossRef polite pool

CrossRef has a polite pool. To get into it, either specify your email address on the command line with the -e flag, or set the CROSSREF_EMAIL environmental variable.

Future work (contributions welcome!)

  1. Create a proper gem.
  2. Figure out how to add doitex to the latexmk workflow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.