BibTeX, biblatex and biberNumber and linebreak between references in the bibliography

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
dtalmy
Posts: 3
Joined: Mon Oct 01, 2012 1:57 pm

Number and linebreak between references in the bibliography

Post by dtalmy »

Hi there,

I need to format my reference list so that it has a number, separated by a linebreak between each reference (these are the guidelines of a particular journal):

1.
Begon, M., Harper, J. & Townsend, C. (1996). Ecology: Individuals, Populations and Communities. 3rd edn. Blackwell Science, Oxford.

2.
Ferris, C., King, R.A. & Gray, A.J. (1997). Molecular evidence for the maternal parentage in the hybrid origin of Spartina anglica C.E. Hubbard. Mol. Ecol., 6, 185-187.

3.
Milligan, B. (1992). Plant DNA isolation. In: Molecular Genetic Analysis of Populations: A Practical Approach (ed. Hoelzel, A.R.). IRL Press, Oxford, UK, pp. 59-88.

Using packages like natbib it is possible to number the reference list, but i haven't found any examples that allow me to put a linebreak between the number and the reference itself. Any ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Number and linebreak between references in the bibliography

Post by kaiserkarl13 »

The following is brute-force, but might work:

Code: Select all

\makeatletter
\def\@biblabel#1{#1.\\}
\makeatother
dtalmy
Posts: 3
Joined: Mon Oct 01, 2012 1:57 pm

Re: Number and linebreak between references in the bibliogra

Post by dtalmy »

This works in that it puts a number by the reference, but it doesn't add the linebreak (which i guess us what the \\ is meant for). I've tried hacking my .bst file by putting newline$ at various points in different functions, but nothing seems to work.

Further help much appreciated!
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Number and linebreak between references in the bibliography

Post by cgnieder »

Hi dtalmy,

Welcome to the LaTeX community!

In order to help us helping you please prepare a proper Infominimal working example* so we can see how you create your bibliography.

Regards

*If you don't know what that is please follow the link!
site moderator & package author
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Number and linebreak between references in the bibliography

Post by kaiserkarl13 »

I think this will work: take your bibliography style file, and make a copy of it with a different name (this is actually REQUIRED if using a standard, copyrighted BST file, by the way). Find the line that says

Code: Select all

"\bibitem{" write$
or something similar. Below that, there should be a line that is the empty string by itself. Change that empty string to "\hspace{0em}\\" and save the file. That file should now break the line right after the number.

Please ignore my first post, then---that's what I get for posting without testing it first!
Last edited by cgnieder on Thu Oct 04, 2012 10:31 pm, edited 1 time in total.
dtalmy
Posts: 3
Joined: Mon Oct 01, 2012 1:57 pm

Number and linebreak between references in the bibliography

Post by dtalmy »

I'm a little reluctant to provide a minimal working example because what i'm doing involves hacking a .bst file:

http://www.lecb.ncifcrf.gov/~toms/ftp/ecol_let.bst

I guess Kaiserkarl13 is saying the function that needs to be modified in order for me to get a number and line break before the first author is the following:

Code: Select all

FUNCTION {output.bibitem}
{ newline$
  "\bibitem[{" write$
  label write$
  ")" make.full.names duplicate$ short.list =
     { pop$ }
     { * }
   if$
  "}]{" * write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}
i've tried a few things but nothing seems to work

cheers,
David
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Number and linebreak between references in the bibliography

Post by kaiserkarl13 »

It worked for me:

Code: Select all

FUNCTION {output.bibitem}
{ newline$
  "\bibitem[{" write$
  label write$
  ")" make.full.names duplicate$ short.list =
     { pop$ }
     { * }
   if$
  "}]{" * write$
  cite$ write$
  "}" write$
  newline$
  "\hspace{0em}\\"  % CHANGED LINE
  before.all 'output.state :=
}
The following is an example that, I think, will reproduce what you want to do:

Code: Select all

\documentclass{article}
\usepackage[numbers]{natbib}   % Your database assumes author-year; this overrides
\usepackage{url}

\makeatletter
\def\@biblabel#1{#1}           % changes numbers from [1] to 1.
\makeatother

\begin{document}

\nocite{*}
\bibliographystyle{ecol_let.bst}

\bibliography{yourbibliographydatabasename}

\end{document}
annek
Posts: 1
Joined: Thu Jan 03, 2013 1:10 am

Re: Number and linebreak between references in the bibliogra

Post by annek »

I understand the part with the spacing and was able to change that. But I also want the reference list numbered BUT in the main text it should be author-year. How do I do that?
JJL_84
Posts: 2
Joined: Thu Jul 11, 2013 9:39 pm

Re: Number and linebreak between references in the bibliogra

Post by JJL_84 »

Hi Annek,
Did you eventually solve your problem? I am trying to submit to the same journal, and have the same problem...
Hope you can help me!
Post Reply