[racket] [Scribble] bibdb-bibs empty, bibdb-raw isn't

From: Joe Gibbs Politz (joe.politz at gmail.com)
Date: Sun Mar 24 13:50:50 EDT 2013

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...

(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.)

Code:

======
#lang racket/base

(require scriblib/autobib scriblib/bibtex)

(provide generate-bib ~cite)

(define-cite _~cite citet generate-bib #:style number-style)

(define db (bibtex-parse (open-input-file "joe.bib")))

(define (~cite key)
  (_~cite (hash-ref (bibdb-bibs db) key (λ () (error 'cite (format "No bib
entry: ~a\n" key))))))

======

> (bibdb-bibs db)
#hash()
> (bibdb-raw db)
'#hash((... lots of stuff ...))


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...)

http://cs.brown.edu/~joe/public/joe.bib

Thanks!
Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130324/ab307b06/attachment.html>

Posted on the users mailing list.