Philip McGrath writes: > For a general solution, I'd take a look at the Citation Style Language ( > https://citationstyles.org/), which is an XML language for defining how to > render citations and bibliographies. A major advantage is that it has libre > style definitions for a dizzying variety of house styles, including AJA ( > https://github.com/citation-style-language/styles/blob/master/american-journal-of-archaeology.csl), > many of which seem to be maintained by the relevant publishers. It also > integrates with Zotero and its competitors, as well as many other tools.
I might also want to explain what we did about moving from Zotero, where Morgan originally managed her citations, over to a more Racket/Scribble-centric approach. This was motivated by Zotero breaking in some mysterious way between Debian releases and us shrugging our shoulders and saying "ok, let's just define this in Racket-land". - I wrote some code that walked through the Zotero XML export to write out some Racket code that represented the citations instead. It's pretty gnarly. - The outputted citations look like: (define-bibitem Piranomonte2002 (ref-type "Book") (contributors (authors (author "Piranomonte, Marina."))) (titles (title "Il santuario della musica e il bosco sacro di Anna Perenna")) (dates (year "2002") (pub-dates (date "2002"))) (pub-location "Milano") (publisher "Electa") (isbn "88-370-2126-7 978-88-370-2126-9") (remote-database-name "http://worldcat.org") (language "Italian")) (define-bibitem Pensabene-et-al2001 (ref-type "Book") (contributors (authors (author "Pensabene, Patrizio.") (author "Falzone, Stella.") (author "Angelelli, Claudia."))) (titles (title "Scavi del Palatino I : l'area sud-occidentale del Palatino tra l'età protostorica e il IV secolo a.C., scavi e materiali della struttura ipogea sotto la cella del Tempio della Vittoria")) (dates (year "2001") (pub-dates (date "2001"))) (pub-location "Roma") (publisher "\"L'Erma\" di Bretschneider") (isbn "88-8265-119-3 978-88-8265-119-0") (remote-database-name "http://worldcat.org") (language "Italian")) So basically we converted the entire Zotero file over like this, and Morgan then started maintaining this Racket file instead for her Bibliography instead. - The above "citations" include a bunch of fields that don't always exist in Scribble's system (eg "language" or "isbn" above). These are actually then stored in an sxml-like alist for now (for historical intermediate purposes of converting from the Zotero stuff to this) but a different structure would be better. - I then have utilities like "record-sxml->bib-entry" that convert these sxml'ish structures over to a bib entry... it's a lossy conversion, but this allows Morgan to maintain fields she needs that aren't currently handled by Scribble's bibliography tools. It's a mess, but it does work and did provide us a path from Zotero -> maintaining stuff directly in Racket. Of course the main problems right now are that converting to bib-entry is lossy / doesn't render to the right format, but the fact that we still have the data before that conversion means we can just swap out that code once we have something better. I'm posing this not as "this is the right way to do it" but as an opening for a conversation... especially in that right now, the auto-bib struct makes some very specific assumptions about what fields are available: (define-struct auto-bib (author date title location url note is-book? key specific)) The right solution is to provide something more open-ended / extensible to the needs of the particular domain the user is coming from. This is what makes me unsure about how to convert scriblib's existing code... it's making a lot of assumptions. How to un-assume? I'm not sure yet though. Thoughts welcome, of course. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/877dzgb68h.fsf%40dustycloud.org.