Skip to content

Commit

Permalink
Tweak citekey_regex to recognize "normal" citations
Browse files Browse the repository at this point in the history
  • Loading branch information
lianos committed Aug 20, 2012
1 parent 6b65f0e commit 007944d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions papers.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Requires Python >= 2.5 and Papers >= 2.0.8
Copyright 2011 Steve Lianoglou, all rights reserved
Copyright 2011-2012 Steve Lianoglou, all rights reserved
License: GPL
"""
Expand Down Expand Up @@ -253,6 +253,11 @@ class BibtexOptionParser(PapersOptionParser):

def __init__(self):
super(BibtexOptionParser, self).__init__(usage=BibtexOptionParser.usage)
# self.add_option('-m', '--modify', dest="modify", default=None,
# help="A *.bib file you want to update. You might " \
# "bibtex entries for things that are not Papers " \
# "that you want to incorporate")

self.infiles = []

def parse_args(self, args=sys.argv[2:], values=None):
Expand All @@ -273,7 +278,7 @@ def parse_args(self, args=sys.argv[2:], values=None):
class BibtexGenerator(object):
"""Generats bibtex file from input"""

citekey_regex = re.compile(r"""\\cite(?:t|p|alp|alt|year|yearpar|author)(?:\[.*?\])?\{(.*?)\}""", re.MULTILINE)
citekey_regex = re.compile(r"""\\cite(?:t|p|alp|alt|year|yearpar|author)?(?:\[.*?\])?\{(.*?)\}""", re.MULTILINE)

def __init__(self, app, infiles, author_style="default"):
self.app = app
Expand Down

0 comments on commit 007944d

Please sign in to comment.