Bibliography Style Unsrt Package Tracker

Introduction¶

reStructuredText Citations are ill-adapted to parenthetical referencing (a.k.a. the `Harvard System of Referencing`_).

An alternative is to (manually) use the `authorship trigraph`_ (common in older computer science texts).

The citation begins with 4 letters:

  • one author: first 4 letters of name
  • two authors: first 2 letters of author1, first 2 letters of author2
  • three authors: first 2 letters of author1, first letter of author2, first letter of author3
  • four authors: first letter of each author
  • more than four authors: first letter of first four authors

The first letter of a name is always upper case.

After the authors’ initials, put the two digits of the year (century-disambiguation is ignored).

If the symbol is exactly the same for two references, a lower case letter is attached.

To facilitate editing, citation text should be kept at the bottom of the document after a “References” rubric heading, like this:

A similar option is to use the BibTeX style:

  • one author: first 3 letters of the last name
  • two to four authors: first letters of last names concatenated
  • more than four authors: first letters of last names of first three authors concatenated and a “+” sign at the end.

For the examples above, the alpha style citation would be: [BDB79], [BB79a] and [BB79b], respectively.

..rubric:: References ..[BiDB79] Biskup, J.; Dayal, U.; Bernstein, P.A..: Synthesizing independent database schemas. In: ACM SIGMOD 1979 Int. Conf. On Management of Data Proceedings, S. 143-151. ..[BeBe79a] Beeri, C.; Bernstein, P.A.: Computational problems related to the design of normal relational schemas. ACM Trans. Database Syst., No. 1, 1979, S. 30-59. ..[BeBe79b] Beeri, C.; Bernstein, P.A.: Computers are stupid. ACM Trans. Database Syst., No. 4, 1979, S. 253-266.

Using Sphinx BibTeX extension¶

Parenthetical referencing can be produced in Sphinx using the sphinxcontrib-bibtex_ extension.

The sphinxcontrib-bibtex_ extension allows BibTeX citations to be inserted into documentation generated by Sphinx.

The extension defines a new directive and a new role.

These work similarly to the LaTeX’s environment and command.

The references are stored in a separate plain text BibTeX format file. Currently, only the and BibTeX styles are supported.

Please note that the current sphinxcontrib-bibtex_ is a beta version.

Installing the extension¶

The module is installed with:

pip install sphinxcontrib-bibtex

Including the extension in the project configuration file¶

The Sphinx project file must be altered to include:

extensions=['sphinxcontrib.bibtex']

Example¶

In the document, use the following syntax:

And place the directive at the end of the document:

The file should contain a BibTex bibliography, including an entry for:

See :cite:`Strunk1979` for an introduction to stylish blah, blah...
..bibliography:: references.bib
@BOOK{Strunk1979, title = {The Elements of Style}, publisher = {Macmillan}, year = {1979}, author = {Strunk, Jr., William and E. B. White}, edition = {Third}}

Using LaTeX directly in Sphinx¶

For advanced users, LaTeX can also be used directly in Sphinx (when only LaTeX output is required):

And insert the bibliography at the end of the document:

See :raw-tex:`\cite{Strunk1979}` for an introduction to stylish blah, blah...
..raw:: latex \bibliographystyle{plain} \bibliography{listb.bib}

Managing BibTeX bibliographies¶

The BibTeX files can be easily managed with JabRef.

JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.

JabRef runs on the Java (version 1.6 or newer), and should work equally well on Windows, Linux and Mac OS X.

Using BibTex in LATEX documents

BibTex is a program that reads entries from a database of citations based on the output of LATEX and then makes a bibliography file that LATEX can insert into the document. There is lots to say about BibTex (and some good manuals that do it well) but here are some essentials I have found useful and not covered in the books. (There is a lot to say and learn about LATEX too).

Finding the material for a BibTex database is a chapter of its own, covered at least briefly at http://www.sci.utah.edu/~macleod/litbase

There is a repository of bibtex files available for use at the SCI Institute.

Quick Links:

  1. Usage Conventions
  2. Teaching Bibtex to find your bibtex files
  3. BibTex, PMCID, and the NIH
  4. Editing BibTex files
  5. Additional BibTex tools

1 Usage Conventions

There are a suggestions when using BibTex:

  1. The standard way to show citations in the text is as ``484'' where N is the reference number in the bibliography. We often use a style and a package called as in the LaTeX file that writes them as superscripted numbers. This style is also smart enough to find sequences of numbers and compress them, e.g., text1,2,3,4,5,9 becomes text1-5,9.
  2. Enter refs as you go and do not leave them all to the last minute! This makes for unnecessary stress when we need it least. Give us your refs in whatever form you have and we can get them entered now.
  3. If you are part of SCI (or otherwise smart and organized), please note the key naming conventions we use. You can find these in the SCI Bibtex tips web page.

2 Teaching Bibtex to find your bibtex files

The default location for the Bibtex files for a document are in the same directory as that document. A slightly better solution is to have a directory that holds all your Bibtex files and then hard-wire the commands in LateX to find those files.

A better way (the best way?) is to store all your Bibtex files in one place in your computer, ideally managed through a system like Subversion, and then to tell the Bibtex program where to look. How this works depends on the operating system and the Bibtex application, of course, but here are some typical examples. I found a lot of this information at this web site by Julien Dutant .

  • Unix, in all its flavors.
    This is the simplest but not the most common, sadly. The solution requires, of course, on an Environmental variable, which users typically set in a start script like .bashrc (for the Bash shell). # Set up the TeX environmentals TEXINPUTS=.:${HOME}/tex/latex: export TEXINPUTS BIBINPUTS=.:${HOME}/litbase/bibtex: export BIBINPUTS This bit of code also sets the TEXINPUTS environment variable, which is also helpful when one has some style files that are stored in a common directory and need to be available to all LaTeX files. ${HOME} is a built in variable that is set to be a user's home directory so this bit of code sets my LaTeX directory to ~macleod/tex/latex and my Bibtex directory to ~macleod/litbase/bibtex.
  • TexShop on the Mac (OSX)
    TexShop is based on TexLive and TeXLive requires a pre-set location, i.e., you cannot adjust this location and must store all .bib files in this place. The files go in
    ~/Library/texmf/bibtex/bib or subfolders of this directory.

    Of course, this directory is not directly visible in the modern versions of Mac OSX and the Finder, thus protecting users from all this tedious detail? To access the ~/Library directory, either use a terminal or use the "Go" command in the Finder but hold down the the option key to see this directory in the list. Here is what the result should look like:

    Once visible, you can maneuver to the texmf/ directory and then add the necessary bibtex/bib directories and store bibtex files there.

    I like to keep things in the same (visible) place for all programs that use bibtex so I have created a link between this standard location and the place TexShop wants to see things. This is a Terminal command so use with the usual care:

    cd ~/Library/tex/bibtex ln -s ~/litbase/bibtex bib You should then see something like the following (again from a terminal window): ls -l bib -> /Users/macleod/litbase/bibtex A above, this assumes my bibtex files are all in my ~/libtase/bibtex directory.
  • WinEdt
    In the control menu: Menu > Options > Executions Modes...
    A window opens with several tabs. In the "Console Applications" tab, you find a list of commands. Select bibtex, and add to the "Switches" field: --include-directory="F:\my bibliography folder"

3 BibTex, PMCID, and the NIH

NIH requires public disclosure of journal articles supported by NIH funding and all such articles receive a code called the PMCID as part of the PubMed system. As an NIH funded researcher, you MUST include this code every time you cite such a reference, especially in progress reports, proposals, and biosketches.

To support this code in BibTeX, I have created a slightly modified version of one of the most common BibTeX style files (.bst), which is available here.

To use this new style file,

  1. Add a field called "pmcid" to each BibTeX reference that contains the PMCID string, which you can locate by searching for the papers in the PubMed system.
  2. Modify your command to look (something) like this: \bibliography{strings,biglit,crj,rtw,jgs,md,cdh,dhb,jaw,crb,sci} \bibliographystyle{nihunsrt}

4 Editing BibTex files

To edit a BibTex file, you can use any editor but emacs has lots of great support for this process. The ones I like are Nelson Beebe's emacs tools found at www.math.utah.edu/pub/emacs/, in particular and .

Here is what my contains to access these:

;;; Add bibtex mode unconditionally; it is already bound to text-mode ;;; and we can do better than that. (delq (assoc "\\.bib$" auto-mode-alist) auto-mode-alist) (setq auto-mode-alist (cons (cons "\\.bib$" 'bibtex-mode) auto-mode-alist)) (autoload 'bibtex-mode "~/emacs/lisp/bibtex/bibtex" ;(autoload 'bibtex-mode "bibtex" "Enter BibTeX mode for bibliography editing." t nil) (setq bibtex-mode-hook '(lambda () (setq comment-end "") (setq comment-start "%% ") (setq comment-start-skip "%+ *") (setq bibtex-include-OPTcrossref nil) (setq bibtex-include-OPTkey nil) (setq bibtex-include-OPTannote nil) (setq bibtex-include-robnote t) (load "~/emacs/lisp/bibtex/bibtex-support") (load "~/emacs/lisp/bibtex/bibtools") ))

Note that these commands assume a subdirectory called in which the require lisp code ( or files) is available.

5 Additional BibTex tools

There are some other fun software tools that can make life easier with BibTex. Most are in the public domain in one form or another and I have included links where I had them--if the links fail, use Google and please let me know (macleod@sci.utah.edu).

5.1 EndNote

EndNote is not really a program that works on BibTexfiles but it does manage citations well and it has some support for BibTex that can make it useful.

See endnote.html for more details on how to convert between Endnote and BibTex.

5.2 bibclean

The goal of bibclean is to clean up syntax and layout errors in BibTex files so that all entries have a nice, clean look that is consistent. The program will also reveal some errors in the file, which can be very helpful! To get bibclean, surf on over to
and thank Nelson Beebe for making this available.

Here are some direct links that might be helpful

One of the many arguments to bibclean essential for SCI databases, if only because it is the convention we had adopted:

bibclean -no-fix-names which I actually alias to bibclean so that I don't forget!

5.3 Mendeley

The free literature databased program Meddeley has support for Bibtex output.

5.4 Converting from Word bibliography to BibTex

This is truly amazing! There is a website called hubmed.org that will convert from Word document text that you copy to the web page into Bibtex files! It actually works.

This program is some sort of search engine interface to Pubmed and it manages to parse the text and propose matches for each entry in the bibliography. I am really impressed with this tool!

5.5 Testing a BibTex file

There is a simple way to test a BibTex file for completeness using LATEX and the bibtex commands from your own computer. Testing is a good plan, especially if you do it after editing the file and not when you are in a hurry and have to build a document using the file.

To test a BibTex file, make a LaTeX file, call it with the following contents:

\documentclass[]{article} \begin{document} Some text. \nocite{*} \bibliography{sci} \bibliographystyle{unsrt} \end{document} where ``sci'' is the name of the BibTex file to test.

Then run

latex testbib bibtex testbib and the output will list all the errors or warnings resulting from trying to parse the file . Some of the output will be warnings that you can ignore but other errors can be fatal the next time you use the file.

5.5 BibDesk

BibDesk is a Mac OSX program to edit and manage your bibliography. It will keep track of both the bibliographic information and the associated files or web links for you. Read more at .

5.6 JabRef

JabRef is a new cross platform, open source program to edit and manage your bibliography. It performs searches and downloads articles (assuming they are open access) and seems to have a lot of customlization options. It claims to integrate well with many LaTeX systems/editors, including eXstudio, LyX, Kile, LatexEditor, Emacs, Vim, and WinEdt.


Last modified: Sat Mar 25 08:37:38 MDT 2017

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *