\include{}s are not followed
Tested with Pybtex 0.10:
$ cat test.tex documentclass{report}
begin{document}
include{part}
bibliographystyle{unsrt} bibliography{test}
end{document}
$ cat part.tex cite{strunk-and-white}
$ cat test.bib @BOOK{strunk-and-white, author = "Strunk, Jr., William and E. B. White", title = "The Elements of Style", publisher = "Macmillan", edition = "Third", year = 1979 }
$ latex test.tex > /dev/null
$ cat test.aux relax @input{part.aux} bibstyle{unsrt} bibdata{test} bibcite{strunk-and-white}{1}
$ bibtex test > /dev/null
$ cat test.bbl begin{thebibliography}{1}
bibitem{strunk-and-white} William Strunk, Jr. and E.B. White. newblock {em The Elements of Style}. newblock Macmillan, third edition, 1979.
end{thebibliography}
$ pybtex test
$ cat test.bbl begin{thebibliography}{}
end{thebibliography}
Comments (3)
-
Account Deleted -
Thanks, fixed in revision 604.
-
- status: open --> closed-fixed
- Log in to comment
Simplest solution is: --- auxfile_old.py 2009-08-20 17:23:39.000000000 +0400 +++ auxfile.py 2009-09-04 21:46:36.000000000 +0400 @@ -54,13 +54,23 @@ action = getattr(self, 'add_%s' % datatype) action(value)
+def read_file( filename, encoding ): + content = "" + f = codecs.open( filename, encoding = encoding ) + inputs = re.compile( r'~~@input{(.*)}') + for i in f.readlines(): + if inputs.findall(i): + for fname in inputs.findall(i): + content += read_file( fname, encoding ) + else: + content += i + return content
def parse_file(filename, encoding): """Parse a file and return an AuxData object."""
command_re = re.compile(r'~~~~(citation|bibdata|bibstyle){(.*)}') - with codecs.open(filename, encoding=encoding) as f: - s = f.read() + s = read_file(filename, encoding) data = AuxData(filename) for datatype, value in command_re.findall(s): data.add(datatype, value)