Document ClassesCustom reference style

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
geo_101
Posts: 7
Joined: Mon May 19, 2008 10:22 am

Custom reference style

Post by geo_101 »

I'm sure something like this has been posted before, but I did a search and found too much!!

I basically want to modify (or make a new) a reference style to fit a journal I'm writing for, but I'm not quite sure where to start.

apalike is the closest style to what I want, it out puts:
Sparks, R. S. J., Gardeweg, M. C., Calder, E. S., and Matthews, S. J. (1997). Erosion by pyroclastic flows on Lascar volcano Chile. Bull Volcanol, 58(7):557-565.
What I would like is:
Sparks, RSJ, Gardeweg, MC, Calder, ES, and Matthews, SJ (1997) Erosion by pyroclastic flows on Lascar volcano Chile. Bull Volcanol 58:557-565
Basically remove some periods, commas and the issue number.

The problem I have is that I don't really understand the code in the bst file, so any hints to a starting point would be welcome

Cheers!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

propell
Posts: 44
Joined: Fri May 30, 2008 11:16 am

Custom reference style

Post by propell »

Modifying a BibTeX style is not trivial. For some documentation on hacking a bst file see:
http://www.ctan.org/get/biblio/bibtex/c ... btxhak.pdf

One option may be to use the custom-bib package. It allows you to customize a style by answering (a lot of) question. It may not generate exactly what you want, but it provides a good starting point.

- Kjell Magne Fauske
geo_101
Posts: 7
Joined: Mon May 19, 2008 10:22 am

Custom reference style

Post by geo_101 »

Cheers for that... but you weren't kidding when you said it wasn't trivial!!!

Been poking at it for a few hours and I can get my reference list how I want (using custom-bib), but not my citations...
I would like to remove the comma...
Sparks et al., 1997
to
Sparks et al. 1997
It's done in this part of the code:

Code: Select all

FUNCTION {calc.label}
{ calc.short.authors[quote][/quote]
  short.list
  ", "
  *
  year duplicate$ empty$
  short.list key field.or.null = or
     { pop$ "" }
     'skip$
  if$
  *
  'label :=
}
But when I delete the comma I get bad boxes where I have multiple citations and it adds the citations to the reference list i.e.
[Sparks et al. 1997]Sparks, RSJ, Gardeweg, MC, Calder, ES, and Matthews, SJ (1997) Erosion by pyroclastic flows on Lascar volcano Chile. Bull Volcanol 58:557-565
Cheers again
propell
Posts: 44
Joined: Fri May 30, 2008 11:16 am

Custom reference style

Post by propell »

geo_101 wrote:Cheers for that... but you weren't kidding when you said it wasn't trivial!!!
There is a reason why there are several alternatives to using bst for formatting bibliographies :) Some very promising alternatives are biblatex and Pybtex. I will probably try one of them for my thesis.
Been poking at it for a few hours and I can get my reference list how I want (using custom-bib), but not my citations...
I would like to remove the comma...
Sparks et al., 1997
to
Sparks et al. 1997
I usually use the natbib package for my bibliography. It provides several alternative citation styles. The \citealt{key} command seems to give what you want:
\citealt{jon90} -> Jones et al. 1990
Hope this helps!

- Kjell Magne Fauske
geo_101
Posts: 7
Joined: Mon May 19, 2008 10:22 am

Custom reference style

Post by geo_101 »

I usually use the natbib package for my bibliography. It provides several alternative citation styles. The \citealt{key} command seems to give what you want:
Yeah, that's what I'm using, but I was using \cite[]{key}... I forgot about the other variations.

All sorted (for now), cheers for the help! :D
Post Reply