<div dir="ltr">Hi! I'm trying to use path->bibdb and/or bibtex-parse on a bibtex file, and I'm getting a bibdb where bibdb-raw looks good, but bibdb-bibs is an empty hash. I'm not missing some initialization step, am I? Am I supposed to be constructing the bib structs on my own or something? A little confused...<div>
<br></div><div>(Note: Alternatively, if I could use #:number-style with define-bibtex-cite, I'd be all set as well, because *that* seems to parse and generate the right bibliography and ~cite works, but doesn't format the citations the way I want.)<br>
<div><br></div><div>Code:</div><div><br></div><div>======</div><div><div>#lang racket/base</div><div><br></div><div>(require scriblib/autobib scriblib/bibtex)</div><div><br></div><div>(provide generate-bib ~cite)</div><div>
<br></div><div>(define-cite _~cite citet generate-bib #:style number-style)</div><div><br></div><div>(define db (bibtex-parse (open-input-file "joe.bib")))</div><div><br></div><div>(define (~cite key)</div><div>
(_~cite (hash-ref (bibdb-bibs db) key (λ () (error 'cite (format "No bib entry: ~a\n" key))))))</div></div><div><br></div><div>======</div><div><br></div><div style>> (bibdb-bibs db)</div><div style>#hash()</div>
<div style>> (bibdb-raw db)</div><div style>'#hash((... lots of stuff ...))</div><div style><br></div><div><br></div><div>Here's joe.bib (could certainly be ill-formed, I notice some encoding issues viewing it in my browser, but I use it with bibtex just fine. Maybe some sadness in the formatting is causing a bad parse? But I'd expect an error message if that's the case...)</div>
<div><br></div><div><a href="http://cs.brown.edu/~joe/public/joe.bib">http://cs.brown.edu/~joe/public/joe.bib</a><br><div style><br></div><div style>Thanks!</div><div style>Joe</div></div></div></div>