Skip to content

pjotrp/racket-bibtex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bibtex with Racket

Introduction

This little program uses pandoc to output JSON for bibtex inputs. Next we transform this to html and org markdown (or is it markup?).

Table of Contents

Bibtex-conv

Features:

  • Generate simple output from bibtex (.bib)
  • Use keyword filter

Bibtex is an extremely useful format for generating literature references. This little program takes the JSON output generated by pandoc-citeproc, e.g.

pandoc-citeproc --bib2json test/data/biblio.bib | ./bin/bibtex-conv -k bio1

or the later

pandoc --to=csljson test/data/biblio.bib | racket ./bin/bibtex-conv

and print it out in useful ways with racket-bibtex. Use it to generate specialised HTML references on grant proposals, biosketches, home pages etc. In earlier days I used the Ruby bibtex parser, but with pandoc there is no longer a need for that. E.g.

pandoc-citeproc --bib2json biblio.bib|bibtex-conv --keyword group

generates Org-mode style output

1. [[https://www.ncbi.nlm.nih.gov/pubmed/31278683][Scalable Workflows and
   Reproducible Data Analysis for Genomics]] by F. Strozzi, R. Janssen,
   R. Wurmus, M. R. Crusoe, G. Githinji, P. Di Tommaso, D. Belhachemi,
   S. Moller, G. Smant, J. Ligt and _P. Prins_,
   @@html:<span class="journal">@@Methods Mol Biol@@html:</span>@@
   (@@html:<span class="year">@@2019@@html:</span>@@) Vol 1910
   p. 723-745, DOI: 10.1007/978-1-4939-9074-0_24

which can be turned into HTML via emacs org-mode. To generate LaTeX directly it is also possible to use the –latex switch

pandoc-citeproc --bib2json biblio.bib|bibtex-conv --keyword group --latex

renders

\item Arends D, {\ul Prins P}, Jansen RC, Broman KW (2010),
  \emph{R/qtl: high-throughput multiple QTL mapping.}
  \uline{Bioinformatics}, {\bf 26}(23), 2990-2992.

Bib file manipulations

Note that both bibtool and biber have support for manipulating bib databases. Check those first before attempting to roll your own.

Install

Dependencies:

  1. racket
  2. pandoc
  3. pandoc-citeproc

Using GNU Guix

guix shell -C racket ghc-pandoc ghc-citeproc
pandoc --to=csljson test.bib

Generate my CV in org markdown:

pandoc --to=csljson pjotr.bib | racket ./bin/bibtex-conv -k cv

LaTeX output:

pandoc --to=csljson pjotr.bib | racket ./bin/bibtex-conv -k cv -l

Copyright

Copyright (c) 2020-2022 Pjotr Prins. This code is published under the GPL3, see LICENSE for details.

About

Bibtex mangler in Racket (uses Pandoc json)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published