byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

Bibtex support #7

Closed idontgetoutmuch closed 10 years ago

idontgetoutmuch commented 11 years ago

pandoc supports bibtex e.g.

pandoc -s NeuralNet.lhs -o NeuralNet.html --bibliography=Neural_networks.bibtex --mathjax

and one can say:

We follow [@rojas1996neural;@Bishop:2006:PRM:1162264]. We are given a training set:

in the literate Haskell and the references from the bibtex file are rendered at the end of the document.

Is this supported in BlogLiterately? The above is just rendered as is afaics.

byorgey commented 10 years ago

Well, it looks like I came back to this ticket at precisely the right time! It seems that there is some active change going on with the way pandoc handles citations. See

https://groups.google.com/d/msg/pandoc-discuss/-SajbqoPX8k/QDiHZNcoLaUJ https://github.com/jgm/pandoc/commit/deb59b62354e38df9c85ce6985e5c28dd2301ee7 https://github.com/jgm/pandoc-citeproc

I'll try integrating pandoc-citeproc into BlogLiterately.

byorgey commented 10 years ago

@idontgetoutmuch , if you get a chance, can you try this out and see if it works as you expect? There's still a bit of work to do adding some documentation, a BlogLiterately option to turn it on and off, and so on, but it seems to work and the new pandoc-citeproc stuff makes it super easy.

idontgetoutmuch commented 10 years ago

@byorgey I am not sure how to do this. In your example you have a .md file and the reference is included in it. I have a .lhs file and a .bib file. How do I tell BlogLiterately to use the .bib file? I tried the obvious

~/.cabal/bin/BlogLiterately NeuralNet.lhs --bibliography=Neural_networks.bibtex
byorgey commented 10 years ago

Sorry, this is why I need to add documentation (almost done now, actually). At the top of your .lhs. file put

---
bibliography: Neural_networks.bibtex
---
byorgey commented 10 years ago

I could probably add a --bibliography flag too. But I think including the bibliography in the .lhs file itself makes more sense anyway.

idontgetoutmuch commented 10 years ago

Works like a charm :+1: thanks

byorgey commented 10 years ago

Great, thanks! Released as BlogLiterately-0.7.