Thanks — that was super helpful.

In case anyone is interested in a proof-of-concept JavaScript hack showing how 
it’s possible to convert natbib-style text citations, in a webpage, into a 
properly formatted bibliography (with tooltips!), see here:

https://jmckalex.org/software/bibtex-in-webpages.html

This uses citation.js, released under the MIT license.  Maybe this is old news 
to everyone, but I couldn’t find anything that worked quite like this. (I 
wanted something I could use for writing reveal.js presentations.)

At the moment, the code on that page isn’t easily useable elsewhere because 
it’s all embedded in <script> tags, but it shouldn’t be too hard to factor out 
into a proper bundle.  If anyone would like to help, let me know!

Best wishes,

Jason

On 16 Jun 2024, at 02:22, Nathan <[email protected]> wrote:

On Jun 15, 2024, at 6:39 PM, Alexander,J wrote:

Is there a way to export a bibliography with all of the cross-references 
removed, so that each individual entry is a complete, stand-alone entry with no 
dependencies?

I ask because I’ve been writing some JavaScript to automatically create and 
format bibliographies in webpages using citation.js, but it seems 
cross-references make things much more complicated — so it would be much more 
convenient to be able to save a version with the crossrefs removed.

Best wishes,

Jason

I do this with bibtool, a command-line tool by Gerd Neugebauer. The relevant 
argument in bibtool is expand.crossref. After installing bibtool (with 
Homebrew, MacPorts, etc.), run a command of the form:

bibtool -- expand.crossref=on -i input.bib -o output.bib

There are also many other arguments/commands in bibtool. For example, there are 
commands for sorting entries, deleting fields, renaming fields, and rewriting 
fields with regular expressions. You can list many commands in a separate text 
file called a resource file and instruct bibtool to read and execute them all 
at once, with the following command form (where options.rsc, for example, is 
the name of a resource file with a list of commands):

bibtool -r options.rsc -i input.bib -o output.bib

It's a very fast and useful tool. Let me know if you have any questions about 
it; I can probably help.

Some links for bibtool:
CTAN: https://ctan.org/pkg/bibtool
GitHub: https://github.com/ge-ne/bibtool



_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to