BibTeX style which shows annotation fields and employs numeric-style citation call-outs
If it's the plain
bibliography style you wish to modify to enable it to print the contents of the annotate
field, you could proceed as follows:
Find the file
plain.bst
in your TeX distribution. Make a copy of this file, calling the copy (say)plainannotate.bst
. (Don't edit a file from the TeX distribution directly.)Open the file
plainannotate.bst
in a text editor. The editor you use to edit your tex files will do fine.First, you have to inform
plainannotate
that it's supposed to recognize fields namedannotate
. Near the very top of the file, find the structure namedENTRY
. Insert a blank line between "address" and "author", and insert the word "annotate" in the new line.Second, you have to inform the bibliography style (and BibTeX) what to do when it's told to process the contents of the
annotate
field. Find the definition of the functionformat.authors
(ca. line 215 in my copy of the file). After this function (and before the functionformat.editors
), insert the following lines of code:FUNCTION {format.annotate} { annotate empty$ { "" } { " \begin{quotation}\noindent " annotate * " \end{quotation} " * } if$ }
In case you're curious what this code does: It first checks if the
annotate
field is empty. If so, it prints nothing (""
). If it's non-empty, aquotation
environment is initiated, the contents of theannotate
field are written out, and thequotation
environment is closed.Third, we have to modify the functions
article
,book
, etc, which process the entries of type@article
,@book
, etc., and tell them that they're supposed to invoke the newly-created functionformat.annotate
at the end of each entry.Find the function
article
. (It should start on line 550 or so if you've been following the instructions so far.) After the line that saysfin.entry
, insert two new lines:format.annotate write$ newline$
Next, find the function
book
. (It should be the function that immediately followsarticle
.) Guess what: After its final line, which is againfin.entry
, insert two more new lines, with the same contents as for the functionarticle
:format.annotate write$ newline$
Ditto for the function
booklet
.For most of the remaining entry-formatting functions, viz.,
inbook
,incollection
,inproceedings
,manual
,mastersthesis
,phdthesis
,proceedings
,techreport
, andunpublished
, just add one extra line afterfin.entry
, viz.,format.annotate write$
The only entry type that's a bit special is the type
@misc
, since it's BibTeX's "catch-all" entry type. (Entry types that are not recognized, say because they've been mis-spelled by accident, are automatically treated as being of type@misc
.) Find the functionmisc
; it should be between the functionsmastersthesis
andphdthesis
. Note that this function's final two lines arefin.entry empty.misc.check
(Because
@misc
is the catch-all entry type, care must be taken if its contents are entirely empty.) In this case, insert the instructionformat.annotate write$
on a new blank line between these two lines, like so:fin.entry format.annotate write$ empty.misc.check
Save the file
plainannotate.bst
, either in the directory where your main tex file is located, or in a directory that's searched by BibTeX. If you choose the latter option, be sure to update the filename database of your TeX distribution.Start using the "new" bibliography style by providing the instruction
\bibliographystyle{plainannotate}
. Be sure to run LaTeX, BibTeX, and LaTeX twice more to propagate all changes.
Here's an MWE that puts it all together:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{abcdef.bib}
@MISC{tJung11,
author = {Jungblut, Thomas},
title = {Ant Colony Optimization for {TSP} Problems},
month = Aug,
year = {2011},
howpublished = {\url{http://codingwiththomas.blogspot.co.uk/2011/08/ant-colony-optimization-for-tsp.html}},
note = {Accessed: 26-01-2015},
annotate = {This Blog posted by Thomas Jungblut covers mutliple topics which are of high interest to the projects research. The information contained in the blog covers items like capitalising on multi-threading opportunities and how to efficiently do so. The underling calculations and evaluation procedures for each agent are also discussed. This is useful for modeling and designing the algorithm itself.}
}
\end{filecontents}
\usepackage[numbers]{natbib}
\bibliographystyle{plainannotate}
\usepackage[hyphens]{url}
\begin{document}
\cite{tJung11}
\bibliography{abcdef}
\end{document}