<div dir="ltr"><div style>It seems to me that I'd want to use those other functions so that I can write new citations with 'make-bib' but still keep old citations around that I've not yet translated. No?</div>
<div style><br>Robby</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 25, 2013 at 9:19 AM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Your bib database is fine. You're just using the library wrong.<br>
<br>
The only interface you should use is 'define-bibtex-cite'. The ~cite<br>
and citet functions that are generated create the 'bib' structure for<br>
entries in the BibTex database as you use them. They are then cached<br>
in bibdb-bibs (because autobib requires them to be eq on different<br>
uses.)<br>
<br>
The other functions/structures are just documented in case someone<br>
wants to process BibTex files for some purpose other than using them<br>
in Scribble documents.<br>
<br>
At the time I wrote this, define-cite had no options. I've updated the<br>
define-bibtex-cite to support given options to define-cite. This<br>
should allow you to use the #:style option with define-bibtex-cite.<br>
<br>
Jay<br>
<div><div class="h5"><br>
<br>
On Sun, Mar 24, 2013 at 12:13 PM, Joe Gibbs Politz <<a href="mailto:joe@cs.brown.edu">joe@cs.brown.edu</a>> wrote:<br>
> Hi! I'm trying to use path->bibdb and/or bibtex-parse on a bibtex file, and<br>
> I'm getting a bibdb where bibdb-raw looks good, but bibdb-bibs is an empty<br>
> hash. I'm not missing some initialization step, am I? Am I supposed to be<br>
> constructing the bib structs on my own or something? A little confused...<br>
><br>
> (Note: Alternatively, if I could use #:number-style with define-bibtex-cite,<br>
> I'd be all set as well, because *that* seems to parse and generate the right<br>
> bibliography and ~cite works, but doesn't format the citations the way I<br>
> want.)<br>
><br>
> Code:<br>
><br>
> ======<br>
> #lang racket/base<br>
><br>
> (require scriblib/autobib scriblib/bibtex)<br>
><br>
> (provide generate-bib ~cite)<br>
><br>
> (define-cite _~cite citet generate-bib #:style number-style)<br>
><br>
> (define db (bibtex-parse (open-input-file "joe.bib")))<br>
><br>
> (define (~cite key)<br>
> (_~cite (hash-ref (bibdb-bibs db) key (λ () (error 'cite (format "No bib<br>
> entry: ~a\n" key))))))<br>
><br>
> ======<br>
><br>
>> (bibdb-bibs db)<br>
> #hash()<br>
>> (bibdb-raw db)<br>
> '#hash((... lots of stuff ...))<br>
><br>
><br>
> Here's joe.bib (could certainly be ill-formed, I notice some encoding issues<br>
> viewing it in my browser, but I use it with bibtex just fine. Maybe some<br>
> sadness in the formatting is causing a bad parse? But I'd expect an error<br>
> message if that's the case...)<br>
><br>
> <a href="http://cs.brown.edu/~joe/public/joe.bib" target="_blank">http://cs.brown.edu/~joe/public/joe.bib</a><br>
><br>
> Thanks!<br>
><br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</font></span></blockquote></div><br></div>