Tobias Mueller  committed 6e9d419

Taking the basename of the BibTeX file only because it is copied anyway

If you reference a file outside your local dir, it would fail. Now it
doesn't anymore, because the BibTeX file is copied to the build
directory and we just reference it locally.

  • Participants
  • Parent commits 36da5d1

Comments (0)

Files changed (1)

 from docutils import nodes
 from docutils.parsers.rst.directives import unchanged
+import os
 from sphinx.util.compat import Directive
     def run(self):
         style = self.options['style']
         bibdb = self.arguments[0]
+        localfile = os.path.basename(bibdb) # We only take the basename, because the .bib file is copied into the build dir
         bibfile = bibdb + '.bib'
         attributes = {'format': 'latex'}
         style_node = nodes.raw('', "\\bibliographystyle{%s}" % style,
-        bibdb_node = nodes.raw('', "\\bibliography{%s}" % bibdb,
+        bibdb_node = nodes.raw('', "\\bibliography{%s}" % localfile,
         return [style_node, bibdb_node]