LaTeX is a powerful document typesetting system that I recommend for any large technical or academic work. LaTeX does have a significant learning curve, and works in a very different way to the modern WYSIWYG word processor, but the investment in learning this excellent system will pay dividends again and again. There are numerous front-ends that make learning the system even easier.
I store my entire research bibliography in bibtex format, a text-based open format, readable by many different bibliography management programs. I currently use Jabref, but there are many others.
A decent reference manager is essential when creating academic works. I would hesitate to do manual reference management for even the smallest projects. The benefits are:
- All references can be stored in one place
- References can be automatically downloaded from literature databases (e.g., Pubmed) minimising transcription errors.
- Many packages allow one to store other information and files along with a reference, such as the full-text PDF or a link to the full-text article.
- Dynamic reformatting of bibliography citation styles (e.g., switch to Harvard style), and bibliography style (depending on journal requirements – e.g., maximum three authors, year, journal name, volume, page numbers). Do not underestimate the workload involved in doing this manually!
LaTeX, BibTeX, Natbib and custom bibliography styles
I have 664 article references held in my central research bibliography database and use Jabref to manage them. I have manually typed in only three or four, as it is usually possible to download citations straight from Pubmed. I reference these articles from a number of different LaTeX documents including my thesis and several ancilliary papers being prepared for publication. I use the natbib package to provide more sophisticated control over citation formatting.
To understand how different this is to using Microsoft Word, I should show an example of simple LaTeX formatting along with a citation:
A useless fact\cite{Smith:2007}.
The \cite{}
construct tells LaTeX to insert a citation. Depending on the citation style in use at the time, it may insert [1], (1), /1/, 1, (Smith et al. 1975). Citation styles include numeric, author-year and authors, with a choice of bracket types.
You can do more complex things if you choose the right options:
Some other useless facts\cite{Smith:2007, Bob:1967, Evans:2004, Griffiths:1945}.
can create a citation such as [1, 3-5].
If you choose to not use natbib, then there are many more built-in bibliographic style files, and you may find one “off the shelf”. Some more technically inclined journals may even provide style files, although I haven’t see this in the medical literature!
My preference is to use natbib and a custom bibliography style file. In this way, I get fine control over both citation and bibliography style formats, and both can be changed very easily, with minimal or no changes to my LaTeX document.
Generating custom bibliography styles
To generate custom bibliography styles compatible with natbib, also read makebst package documentation. This allows one to create arbitrary bibliography styles, and should support any style requested by the most demanding of medical journals! They are many built-in bibliography styles with LaTeX, but medical journals tend to have different requirements, and I normally end up creating a style file to suit the journal. I suspect this isn’t the case in the computing or scientific communities, but medical and the life-sciences uses different defaults and different standards to most of the included style files.
For this run-through, I’m going to create a style file that uses numeric citations, in order of citation( not alphabetical order), with a list of authors (surname then initials), then the article title (in italics), then journal name, the year, then volume number, optionally the issue number in brackets, and finally the page number.
- Getting started
- Run makebst.makebst is a tex program that generates style files. To run it, use
latex /opt/local/share/texmf-dist/tex/latex/custom-bib/makebst.tex
You will need to use the correct path to the file itself, which will depend on your operating system and TeX installation. - Type ‘Y’ to get more information
- Accept the default master file (merlin.mbs)
- Output file – name it something memorable – I type
wibble.bst
- Type a comment – I type
An example style file
- Say Y to verbose comments
- Name of language definition file – agree with default
- Include files for journal names? – no
- Internal language support – agree with default
- Run makebst.makebst is a tex program that generates style files. To run it, use
- Choosing style
- Choose numeric mode
- Choose normal LaTeX output
- Language field? no
- Annotations? no
- Ordering of references? Citation order – option c
- Order on “von” part? Sort on von part – although N/A for us
- Author names? Surname plus pure initials (option x)
- Editor names? Reversed as in authors’ – option r
- Position of “Junior” – comes last
- Author name punctuation – separate by commas
- Adjacent references with repeated names – always present
- Number of authors – all authors
- Typeface for authors – normal font
- Date position – date part of journal spec – option j
- Date format – plain month and year – default option
- Suppress month – yes – option x
- Date punctuation – semi-colon – option s
- Blank after date – no space – option x
- Date font – normal format
- Title font – italic
- Title capitalisation – title style (I ensure all bibtex entries are correctly capitalised manually by using {})
- Article title present – Yes
- Journal names – dotless names – option x
- Journal name font – plain
- Thesis title – like books
- Tech report – like article
- Tech report num – plain
- Journal volume font – plain
- Journal volume – vol(num) – default
- Volume punctuation – volume with colon – default
- Year in journal specification – as given by date specification
- Page numbers – start and stop numbers
- Large page numbers – no separators
- Word “page” in articles – no – numbers only – default
- Position of pages – default
- Word volume – number only -default
- Allow number without series – default
- Position of number and series – default
- Volume and series for books – option s
- Position of volume and series – default
- Journal name punctuation – space – option x
- Book title italic? Yes
- Pages in books plain – default
- Total pages printed – no
- Publisher,Address – default
- Publisher in paratheses – default no
- Publisher position – default
- ISBN – no
- ISSN – no
- DOI – no
- Editor after names – default
- Editor in collections – default
- Punctuation between blocks – default
- Punctuation after authors – default
- Punctuation after “in” – default
- “In” with journal names – default – no
- Final punctuation – period at end
- Abbreviate “pages” – omit – option x
- Abbreviate “editors” – yes – option a
- Other abbreviations – yes
- Abbreviation for edition – a
- Months with dots – option x (although not applicable as hidden)
- Editions as in database – default
- Stored journal names – default (not applicable)
- Ampersand – use word and – default
- Comma before “and” – no comma
- No “and” in reference list – No – option x
- Font of “et al” – plain
- RevTeX data fields – none (default)
- E-print data field – none (default)
- URL – none
- Reference component – none
- Emphasis – default
- Compatibility with plain TeX – default
After all that (most of the options we set to their default), we get:
Finished!!
Batch job written to file `acnr.dbj'
Shall I now run this batch job? (NO)
Choose YES, and your STY file is created!
You will notice that many of the options are actually not applicable. For example, you can choose not to have “AND” placed into the author list if there are only two authors, but it still asks you about using an ampersand or plain text. In these situations, it is normally possible to just select the default.
Copy it into your TeX distribution tree.
sudo mkdir /opt/local/share/texmf-dist/bibtex/bst/mybst
sudo cp wibble.bst /opt/local/share/texmf-dist/bibtex/bst/mybst/
sudo texhash
And finally change the bibliography style setting in your LaTeX document:
\bibliographystyle{wibble}
Further reading: Wikibooks’ LaTeX bibliography management, Making style files with custom bib.
21 responses so far ↓
1 How to use JabRef/BibTeX with Microsoft Word 2003 // Mar 25, 2007 at 10:16 pm
[…] This can be done by clicking the paintbrush logo. To find out what styles are available from your MikTeX installation you can search the BibTeX folder for style files which have the *.bst extension, or create your own as described in Mark’s recent article […]
2 Janez // Jul 5, 2007 at 8:21 am
Hi!
Thanks for making this instructions available. I find it really useful.
I have a small problem. After I had created my own bibliography style and copy it to: C:\Program Files\MiKTeX 2.6\bibtex\bst , and then run texhash, the Microsoft word couldn’t find style file which I had created with tex makebst. Is the reason that you are using LaTeX and it doesn’t work in Word?
3 James // Jul 5, 2007 at 6:15 pm
Janez,
I assume you are trying to use your own custom style with the BibTeX4Word Macro. Before you try using your own style- try modifying an existing style. For example copy the Vancouver style and rename it as ‘test’, run TexHash and check that BibTeX4Word can find the renamed style file by the name of ‘test’, if it can then the problem relates to your style rather than the BibTeX4Word macro. Please let me know how you get on.
4 Owen // Jul 7, 2007 at 10:47 am
To reference a page range in a citation the format is \cite[pagerange]{AuthorYear}. But how do you cite different page ranges in multiple author citations (\cite{AuthorYear, AuthorYear, AuthorYear})?
5 Janez // Jul 9, 2007 at 6:53 am
Hi,
Thank you for your advice James. Unfortunately the same thing happens again. Renaming the the Vancouver style to test brings no success. Is the problem in TexHash? Because, when I run TexHash it appears just for a second and then disappears. I even can’t find this program in MiKTeX package manager to install it.
6 Janez // Jul 9, 2007 at 7:04 am
Yes you are right, I am using BibTeX4Word macro.
7 James // Jul 11, 2007 at 8:45 pm
I think you need to run texhash from the command prompt, go to run then enter command and press enter. Then try typing texhash.
James
8 James // Jul 11, 2007 at 8:51 pm
Owen,
\cite[pages~1-5,pages~2-3]{Noh1998,Filho2006}
Does that work?
James
9 Janez // Jul 12, 2007 at 10:42 am
James,
many thanks, it works prperly now.
10 Custom LaTeX bibliography style files: Part 1/4 // Oct 13, 2007 at 8:45 pm
[…] a wide range of biomedical journals. This article builds on some the basic knowledge included in an introductory text here on this […]
11 Dan // Dec 6, 2007 at 4:14 pm
This is a great introductory article.
One thing it doesn’t address though is how to only include specific fields e.g. I make notes on my references in JabRef, but don’t want the notes to be in my ref list. Have tried manually editing files, but its got me nowhere.
12 Mark // Dec 8, 2007 at 12:25 pm
My bibliography style file does not include any annotations or notes within the bibliography, so I can only assume you have included those fields in your custom bibliography style.
Or are you using one the built-in natbib styles? They do include notes and URLs, which I dislike.
13 Dan // Jan 14, 2008 at 10:03 am
I ran the makebst a couple of times and now the additional fields e.g. notes, no longer appear.
Thanks for your help
14 Amrish // Apr 4, 2008 at 11:28 pm
Dan (or somebody else),
How did you get the additional fields to disappear?
Any particular setting ?
Thanks!
15 mattia // Jul 31, 2008 at 9:22 am
HI!
I have a question: what do you mean by “Copy it into your TeX distribution tree”?
Isn’t copying the bst file in the folder of the article/report/book we are writing enough?
Thank you!
16 James // Jul 31, 2008 at 6:27 pm
You do have to copy it into your Tex distribution’s Tree, and then run texhash.
Regards
James
17 Sandra // Sep 24, 2009 at 9:16 pm
Hi,
Thanks for setting up this website, I think it is really helpful. I do have a question though. Is it possible to have in the text (not in the reference list) instead of numbers, the authors and years mentioned? As in: The sun was shining and the sky is blue (Prisma et al., 2004; Colour, 2000).
Thanks,
Sandra
18 simo // Mar 10, 2010 at 10:04 am
I have a little probleme using natbib. i’m using harvard style for referencing author. I use also jabref to organize my references. When i fill my references in jabref by putting the first name followed by the name of the author, after compiling the code i got the inverse at the end of my article, i mean the first and last name of the author are inversed, and it’s a probleme because it interferes with natbib ( the references in the article with harvard style follow the order defined in jabref which is not the case in the section REFRENCES at the end of the article. ?? thank you
19 asca // Apr 12, 2010 at 10:12 pm
Thanks for a great resource.
Sorry for a newb question, but I am trying to use maskebst.tex to define an author-date system with no comma between author and year:
(Brilliant 2010) not (Brilliant, 2010).
I am getting some option wrong in the list of makebst questions. Any help most appreciated.
Thanks
a
20 Jaze // May 8, 2010 at 1:39 am
hey.. when does a question mark appear instead of a number in a citation..
In the tex file its — \cite{s5}, suppose.
In the pdf it comes [?].
The reference is present in the References section at the bottom of the page. why is there no number displayed inside the square brackets.?
Thanks in advance
21 Rodrigo // Jun 25, 2010 at 4:51 pm
How can I get to cite ASTM standards with Latex?
Regards,
Rodrigo.
Leave a Comment
(Don't forget to fill in the Captcha)