Skip to content

n3mo/bibtex-to-plain-text.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

bibtex-to-plain-text.el

Tools for quickly creating plain text bibliographic references from BibTeX entries

The initial purpose of this package was to enable easy conversion from BibTeX/LaTeX citations into a plain text format that can be easily pasted into other programs that are unfriendly to LaTeX (or for quickly sharing references with colleagues or friends through email, etc.).

Currently, this package allows you to easily convert either BibTeX formatted text, or latex \cite{} commands in a buffer into plain text APA formatted references. Of course, formatting such as underlining and italics will be missing from the reference string. As of now, if you plan to paste the formatted string into another program (such as M$ Word), you will need to manually add such markup. Future versions will hopefully remove this necessity.

bibtex-to-plain-text is agnostic to the referencing style used as output. The default is APA styling. Styling behavior is controlled by the variable bibtex-to-plain-text-style, which is set by default to an association list called bibtex-to-plain-text-apa-formats that contains the formatting styles for each BibTeX entry type (article, book, incollection, etc.). Additional styles (MLA, Chicago style, etc.) will be added in time. Users can also provide their own custom style rules by creating custom association lists according to those defined in bibtex-to-plain-text.el. By setting bibtex-to-plain-text-style to the custom list, the output behavior of bibtex-to-plain-text can be modified:

(setq bibtex-to-plain-text-style 
	bibtex-to-plain-text-my-custom-format-list)

Setup

This package requires that bibtex and reftex-cite are installed.

Provided bibtex-to-plain-text.el is on your load path, a simple require will get you up and running.

(require 'bibtex-to-plain-text)

To use the latex- commands below, you will need to ensure that your LaTeX/BibTeX installations are set up properly. Most importantly, your .bib file(s) specified in your LaTeX \bibliography{} statements should be on the correct path. This is not a requirement for the bibtex- commands.

Usage

The package makes several functions available. Expect these functions to be renamed soon.

bibtex-create-plain-text-reference

This converts a BibTeX entry under point (selecting a region is NOT required) to a plain text reference. The result is pushed to the kill ring. Example:

@article{petrov2011,
  title={Dissociable perceptual-learning mechanisms revealed by diffusion-model analysis},
  author={Petrov, A.A. and Van Horn, N.M. and Ratcliff, R.},
  journal={Psychonomic bulletin \& review},
  volume={18},
  number={3},
  pages={490--497},
  year={2011},
  publisher={Springer}
}

Running M-x bibtex-create-plain-text-reference with point anywhere inside the above BibTeX entry will produce the following APA reference:

Petrov, A.A. and Van Horn, N.M. and Ratcliff, R. (2011). Dissociable perceptual-learning mechanisms revealed by diffusion-model analysis. Psychonomic Bulletin & Review, 18(3), 490-497.

bibtex-convert-buffer-to-plain-text

This is a wrapper for bibtex-create-plain-text-reference described above. The current buffer is searched and all BibTeX entries are converted to plain text. The results are written to a buffer named *references*. The contents of the current buffer can contain a mixture of BibTeX markup and other text. Thus, bibtex-convert-buffer-to-plain-text will scrape your buffer of any BibTeX entries and convert them into a references list.

latex-convert-buffer-to-plain-text

This function should be run inside of a LaTeX document containing one or more \cite{} commands. Provided you have specified a bibliography file in \bibliography{} statement, the function will create a plain text reference list formatted according to the standards associated with the reference type of each citation (e.g., article, book, etc. will be treated uniquely). This should work across multi-file LaTeX documents as well (i.e., those using \input{} statements).

latex-create-plain-text-reference

Currently not working properly!!!

This function creates a plain text formatted reference of the \cite{} entry under point. The reference is pushed to the kill ring.

Future Goals

  • Add exporting options with markup text (for pasting properly formatted references into .rtf, html, etc.).
  • Convert from plain text references back into BibTeX. This is a tough problem probably not worth the timeinvolved.

Warning

This is in early development. The initial functions seem to work, but there are known bugs. For instance, the final BibTeX entry in a buffer is converted to a plain text reference twice.

About

Tools for quickly creating plain text bibliographic references from BibTeX entries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published