Created
May 5, 2013 04:13
-
-
Save jrsmith3/5519665 to your computer and use it in GitHub Desktop.
Get a list of bibTeX keys from a LaTeX document using plasTeX.
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
from plasTeX.TeX import TeX | |
# The following can be a problem if you are using revtex. | |
doc = TeX(file="filename.tex").parse() | |
refs = doc.getElementByTagName("cite") | |
cites = [] | |
for ref in refs: | |
cites += ref.attributes["bibkey"] | |
# Remove duplicate entries. | |
cites = list(set(cites)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment