[Collab-qa-commits] r2295 - udd/udd

Andreas Tille tille at alioth.debian.org
Wed May 9 07:20:03 UTC 2012


Author: tille
Date: 2012-05-09 07:20:02 +0000 (Wed, 09 May 2012)
New Revision: 2295

Modified:
   udd/udd/bibref_gatherer.py
Log:
Do not use '.' or '+' in BibTeX keys but rather replace these by '-'
Make BibTeX run more error tolerant and build the PDF anyway.


Modified: udd/udd/bibref_gatherer.py
===================================================================
--- udd/udd/bibref_gatherer.py	2012-05-09 03:00:33 UTC (rev 2294)
+++ udd/udd/bibref_gatherer.py	2012-05-09 07:20:02 UTC (rev 2295)
@@ -55,7 +55,7 @@
         if logrow.startswith('This is BibTeX'):
           continue
         errstring += logrow + '\n'
-      return(False, errstring)
+      return(True, errstring)
   return(True, errstring)
 
 other_known_keys = ('Archive', 'Contact', 'CRAN', 'Donation', 'Download', 'Help', 'Homepage', 'Name', 'Watch', 'Webservice')
@@ -158,7 +158,7 @@
     ref['rank']    = rank
     ref['source']  = source
     ref['key']     = 'bibtex'
-    ref['value']   = bibtexkey
+    ref['value']   = re.sub('\+', '-', re.sub('\.', '-', bibtexkey)) # avoid '.' and '+' in BibTeX keys
     ref['package'] = package
     self.bibrefsinglelist.append(bibtexkey)
     self.bibrefs.append(ref)
@@ -326,6 +326,7 @@
 \usepackage[utf8]{inputenc}
 \usepackage[left=2mm,top=2mm,right=2mm,bottom=2mm,nohead,nofoot]{geometry}
 \usepackage{longtable}
+\usepackage[super]{natbib}
 \setlongtables
 \\begin{document}
 \small
@@ -338,9 +339,9 @@
 
       print >>bf, """\end{longtable}
 
-\\bibliographystyle{plain}
-% Try a bit harder ...
-%\\bibliographystyle{plainnat}
+% \\bibliographystyle{plain}
+% Try a bit harder by also including URL+DOI
+\\bibliographystyle{plainnat}
 \\bibliography{debian}
 
 \end{document}
@@ -361,9 +362,12 @@
         self.log.error("Problem in 1. PdfLaTeX run of %s.tex: `%s` --> please inspect %s.log" % (basetexfile, errstring, basetexfile))
         exit(1)
       (retcode,errstring) = open_tex_process('bibtex', basetexfile)
-      if not retcode:
-        self.log.error("Problem in BibTeX run of %s.bib: `%s`" % (basetexfile, errstring))
-        exit(1)
+      if errstring != "":
+        print "BibTeX:", retcode
+        if not retcode:
+          self.log.error("Problem in BibTeX run of %s.bib: `%s`" % (basetexfile, errstring))
+          exit(1)
+        self.log.error("Ignore the following problems in BibTeX run of %s.bib: `%s`" % (basetexfile, errstring))
       (retcode,errstring) = open_tex_process('pdflatex', basetexfile)
       if not retcode:
         self.log.error("Problem in 2. PdfLaTeX run of %s.tex: `%s` --> please inspect %s.log" % (basetexfile, errstring, basetexfile))




More information about the Collab-qa-commits mailing list