Created
November 21, 2011 16:25
-
-
Save dsanson/1383132 to your computer and use it in GitHub Desktop.
Generate a bibtex file containing works cited in a given pandoc extended markdown file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
bibfile = "~/.pandoc/default.bib" | |
matches = ARGF.read.scan(/@(.*?)[\.,:;\] ]/) | |
reg = "\\(" + matches.join("\\)\\|\\(") + "\\)" | |
system 'bibtool -X \'' + reg + '\' ' + bibfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generates a bibtex file containing only works cited in a given pandoc extended markdown file. Usage
Depends on bibtool. Change the value of bibfile to point to your master bibtex database.