It seems that Pandoc
is capable of dealing with references given in a .bib
file. Yet, I haven't been able to simply ask Pandoc
to convert a .bib
file into html
, markdown
or other formats. Is there a way to do so?
As an example of what I mean (since I am not sure I am clear enough…), I would say the following to export myfile.bib
to myfile.pdf
: Create myfile.tex
which contains
\documentclass{article}
\begin{document}
\nocite{*}
\bibliographystyle{abbrv} % or another bibliography style!
\bibliography{myfile.bib}
\end{document}
and compile it using pdflatex
and bibtex
.
Is there such a simple way to export myfile.bib
to (say) myfile.html
?
Best Answer
pandoc
cannot convert a.bib
file into another file format1. However, it can convert a.tex
file which contains references (called from a.bib
file) into a pdf, odt, html, ... If your.tex
file just contains the\nocite{*}
command, the result is similar (you will have all your references printed).Here is the magic command:
or (for pdf)
or (for html)
Note that several launches of the pandoc command could be necessary to obtain a correct result.
MWE
Files
mybib.bib
file:Outputs
Pdf
html
html generated by
pandoc test.tex -o output.html --bibliography mybib.bib
:1 The documentation is not very clear about this point. Some phrasings could lead one to believe it's possible to directly convert from .bib to .*. I tested it and it isn't working. You have to use a .tex file if you want to convert a .bib file (today).