Skip to content
Philip Cooksey edited this page Jun 27, 2019 · 20 revisions

Installing BibTeX-js

Load javascript, add this to your html code (the source BibTex file below may not be the most recent):

<script type="text/javascript" src="https://cdn.rawgit.com/pcooksey/bibtex-js/5ccf967/src/bibtex_js.js"></script>

Place BibTeX file link(s) into <bibtex> tag(s) or insert bibtex text into a (hidden) textarea with id="bibtex_input". They will all be combined together if you choose to use multiple inputs:

<bibtex src="test.bib"></bibtex>
<bibtex src="text1.bib"></bibtex>

<textarea id="bibtex_input" style="display:none;">
@book{book1,
  author = "Donald Knuth",
  title = "Concrete Mathematics"
}
</textarea>

Output will be displayed in the element with id="bibtex_display", add this to HTML:

<div id="bibtex_display"></div>

That's it!

Unless you want to only display a few bibtex entries. Then see the next section. If you would like finer control or search abilities check out the last section.

Selecting BibTeX Entries

Use the class attribute instead of id for multiple displays. Then use any BibTex field to select the entries with the format field="regex value".

Include all BibTex keys you want displayed with bibtexkey="key1|key2|...|keyN":

<div class="bibtex_display" bibtexkey="sammet2003programming|bauer1998ubersetzung"></div>
<div class="bibtex_display" bibtexkey="parr1995antlr"></div>
<div class="bibtex_display" bibtexkey="wiki:chomskyh|sammet2003programming|parr1995antlr"></div>

Select only certain authors to be displayed:

<div class="bibtex_display" author="Tim Smith"></div>
<!-- or use regex `|` to search for all types -->
<div class="bibtex_display" author="Tim Smith|Smith, T.|Smith, Tim"></div>
<!-- or use regex to limit the display to first author -->
<div class="bibtex_display" author="^(Tim Smith)"></div>

Unless you want to get fancy

Customize how publications are displayed using templates.

Search entries, hide certain bibtex entries, additional bibtex variables, and more with extra functionality.

Clone this wiki locally