<div dir="ltr">I haven't used this library yet (I've just been manually porting my bibtex files because I somehow missed this option), but if I were to use it, I'd definitely want to use it to pull in some bibs that I hadn't ported yet and not give up the ones I've already rewritten (as they are actually much better than the ones I have in bibtex already).<div>
<br></div><div>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 25, 2013 at 9:27 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">If this is a desired interface, then I should expose the<br>
'generate-bib' function, because the whole thing is fairly useless<br>
without it. Should I do that?<br>
<span class="HOEnZb"><font color="#888888"><br>
Jay<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mon, Mar 25, 2013 at 8:25 AM, Robby Findler<br>
<<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>> wrote:<br>
> It seems to me that I'd want to use those other functions so that I can<br>
> write new citations with 'make-bib' but still keep old citations around that<br>
> I've not yet translated. No?<br>
><br>
> Robby<br>
><br>
><br>
><br>
> On Mon, Mar 25, 2013 at 9:19 AM, Jay McCarthy <<a href="mailto:jay.mccarthy@gmail.com">jay.mccarthy@gmail.com</a>><br>
> wrote:<br>
>><br>
>> 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>
>><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>><br>
>> wrote:<br>
>> > Hi! I'm trying to use path->bibdb and/or bibtex-parse on a bibtex file,<br>
>> > and<br>
>> > I'm getting a bibdb where bibdb-raw looks good, but bibdb-bibs is an<br>
>> > empty<br>
>> > hash. I'm not missing some initialization step, am I? Am I supposed to<br>
>> > be<br>
>> > constructing the bib structs on my own or something? A little<br>
>> > confused...<br>
>> ><br>
>> > (Note: Alternatively, if I could use #:number-style with<br>
>> > define-bibtex-cite,<br>
>> > I'd be all set as well, because *that* seems to parse and generate the<br>
>> > 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<br>
>> > 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<br>
>> > issues<br>
>> > viewing it in my browser, but I use it with bibtex just fine. Maybe<br>
>> > some<br>
>> > sadness in the formatting is causing a bad parse? But I'd expect an<br>
>> > 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>
>> > ____________________<br>
>> > Racket Users list:<br>
>> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>> ><br>
>><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>
><br>
><br>
<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>
</div></div></blockquote></div><br></div>