2
from plugins import TexModule
3
from bibtex import BibTex
7
def __init__(self, doc, bibaux, bibfiles, bibstyle):
8
self.bibfiles = bibfiles.split(",")
9
self.bibstyle = bibstyle
11
BibTex.__init__(self, doc, {}, bibaux)
12
for bib in self.bibfiles:
15
self.set_style(self.bibstyle)
17
class BibNull(BibSect):
19
Null biblio section having no bibfile
21
def __init__(self, doc, bibaux):
24
def pre_compile(self):
27
def post_compile(self):
31
class Bibtopic(TexModule):
32
def __init__(self, doc, dict):
35
doc.parser.add_hook("begin{btSect}", self.add_sect)
37
# If loaded from a sect, register this sect too
38
if dict["name"] == "begin{btSect}":
41
def add_sect(self, dict):
42
bibaux = "%s%d" % (self.doc.src_base, len(self.btsects) + 1)
44
btsect = BibSect(self.doc, bibaux, dict["arg"], dict["opt"])
46
btsect = BibNull(self.doc, bibaux)
47
self.btsects.append(btsect)
49
def pre_compile(self):
51
for bib in self.btsects:
52
rc += bib.pre_compile()
55
def post_compile(self):
57
for bib in self.btsects:
58
rc += bib.post_compile()
62
class Module(Bibtopic):
64
Module to load to handle bibtopic