f



BibTeX style: replace repeated author names by multiple dashes

Hi,

I would like to create a BibTeX style (bst-file) that produces a list of
references where *each* author name is replaces by a dash if it is the same
author as in the previous entry. I have created a BibTeX style by
custombib/makebst, but this Style replaces *all* author names by a *single*
dash if *all* authors are the same as in the previous entry. However, the
guidelines that my BibTeX style should follow say that the first author
name should be replaced by a dash yet if only this author is the same as
the first author in the previous entry (regardless of any co-authors). If
the first $n$ authors are the same as the first $n$ authors in the previous
entry, the names of the first $n$ authors should be replaced by $n$ dashes.
I hope that following example makes this clear:

BERNANKE, B. and BLINDER, A. (1988). ... 
___ and GERTLER, M. (1995). ...
___, ___ and GILCHRIST, S. (1996). ...

(http://darp.lse.ac.uk/Frankweb/Economica/pdf/EconomicaAcceptedPaperNotes.pdf)

Does anybody know a BibTeX style that does this? (I would like to look at
the code or --- if the license allows this --- copy the code.)

Does anybody know how this can be implemented in a BibTeX style?

Cheers,
Arne
0
5/11/2007 8:08:14 AM
comp.text.tex 39027 articles. 3 followers. Post Follow

10 Replies
1115 Views

Similar Articles

[PageSpeed] 0

On May 11, 9:08 am, Arne Henningsen <ahenning...@agric-econ.uni-
kiel.de> wrote:
> Hi,
>
> I would like to create a BibTeX style (bst-file) that produces a list of
> references where *each* author name is replaces by a dash if it is the same
> author as in the previous entry. I have created a BibTeX style by
> custombib/makebst, but this Style replaces *all* author names by a *single*
> dash if *all* authors are the same as in the previous entry. However, the
> guidelines that my BibTeX style should follow say that the first author
> name should be replaced by a dash yet if only this author is the same as
> the first author in the previous entry (regardless of any co-authors). If
> the first $n$ authors are the same as the first $n$ authors in the previous
> entry, the names of the first $n$ authors should be replaced by $n$ dashes.
> I hope that following example makes this clear:
>
> BERNANKE, B. and BLINDER, A. (1988). ...
> ___ and GERTLER, M. (1995). ...
> ___, ___ and GILCHRIST, S. (1996). ...
>
> (http://darp.lse.ac.uk/Frankweb/Economica/pdf/EconomicaAcceptedPaperNo...)
>
> Does anybody know a BibTeX style that does this? (I would like to look at
> the code or --- if the license allows this --- copy the code.)
>
> Does anybody know how this can be implemented in a BibTeX style?
>
> Cheers,
> Arne

If you could forward me our custom-bib bst file I'll take a look.  It
shouldn't be too hard (I hope).

Joseph Wright

0
joseph.wright (1875)
5/11/2007 8:18:46 AM
Joseph Wright wrote:
> If you could forward me our custom-bib bst file I'll take a look.  It
> shouldn't be too hard (I hope).

Thanks! I have put all relevant files on my website:
  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
(section "Economica (ECCA)")

Arne

0
5/11/2007 8:39:18 AM
On May 11, 9:39 am, Arne Henningsen <ahenning...@agric-econ.uni-
kiel.de> wrote:
> Joseph Wright wrote:
> > If you could forward me our custom-bib bst file I'll take a look.  It
> > shouldn't be too hard (I hope).
>
> Thanks! I have put all relevant files on my website:
>  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
> (section "Economica (ECCA)")
>
> Arne

I will send you the file by e-mail with all of the changes I've made.
For the record, there are a few places to alter.  Firts, the following
lines are needed before FUNCTION {format.names}:

STRINGS { oldnames namestring currentname exname exnametmp }
INTEGERS { namecnt position }

% This function builds up a list of names with no formatting.
% The names are separtaed by semi-colons for eay unpicking
FUNCTION {store.name}
{ duplicate$
  namestring swap$
  ";" * *
  'namestring :=
}

FUNCTION {extract.name}
{ #0 'namecnt :=
  #0 'position :=
  "" 'exnametmp :=
  { oldnames text.length$ position >
    nameptr namecnt > and }
  { position #1 + 'position :=
    oldnames position #1 substring$
    duplicate$ ";" =
      { pop$
        namecnt #1 + 'namecnt :=
        exnametmp 'exname :=
        "" 'exnametmp := }
      { exnametmp swap$ *
        'exnametmp := }
    if$
 }
 while$
 exname
}

FUNCTION {compare.name}
{ 'currentname :=
  extract.name
  currentname =
    { "---" }
    { currentname }
  if$
}

FUNCTION {format.names} then needs to be altered, but for ease I will
past the complete revised function:

FUNCTION {format.names}
{ 'bibinfo :=
  duplicate$ empty$ 'skip$ {
  namestring 'oldnames := % Copy the stored names to the oldnames list
  "" 'namestring :=       % and blank the current name string
  's :=
  "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{vv~}{ll}{, f.}{, jj}"
      format.name$
      store.name
      compare.name % Save the current name to our storage list
      bib.name.font
      bibinfo bibinfo.check
      't :=
      nameptr #1 >
        {
          namesleft #1 >
            { ", " * t * }
            {
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
              t "others" =
                {
                  " " * bbl.etal emphasize *
                }
                {
                  bbl.and
                  space.word * t *
                }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
  }
  if$
}

Remove:

STRINGS {oldname}

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname := s }
     { s oldname =
         { "---" }
         { s 'oldname := s }
       if$
     }
   if$
}

and all references to name.or.dash.  You should then be good to go.

I hope this works for you!

Joseph Wright

0
joseph.wright (1875)
5/11/2007 3:43:55 PM
On May 11, 4:43 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
wrote:
> On May 11, 9:39 am, Arne Henningsen <ahenning...@agric-econ.uni-
>
> kiel.de> wrote:
> > Joseph Wright wrote:
> > > If you could forward me our custom-bib bst file I'll take a look.  It
> > > shouldn't be too hard (I hope).
>
> > Thanks! I have put all relevant files on my website:
> >  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
> > (section "Economica (ECCA)")
>
> > Arne
>
> I will send you the file by e-mail with all of the changes I've made.
> For the record, there are a few places to alter.  Firts, the following
> lines are needed before FUNCTION {format.names}:
>
> STRINGS { oldnames namestring currentname exname exnametmp }
> INTEGERS { namecnt position }
>
> % This function builds up a list of names with no formatting.
> % The names are separtaed by semi-colons for eay unpicking
> FUNCTION {store.name}
> { duplicate$
>   namestring swap$
>   ";" * *
>   'namestring :=
>
> }
>
> FUNCTION {extract.name}
> { #0 'namecnt :=
>   #0 'position :=
>   "" 'exnametmp :=
>   { oldnames text.length$ position >
>     nameptr namecnt > and }
>   { position #1 + 'position :=
>     oldnames position #1 substring$
>     duplicate$ ";" =
>       { pop$
>         namecnt #1 + 'namecnt :=
>         exnametmp 'exname :=
>         "" 'exnametmp := }
>       { exnametmp swap$ *
>         'exnametmp := }
>     if$
>  }
>  while$
>  exname
>
> }
>
> FUNCTION {compare.name}
> { 'currentname :=
>   extract.name
>   currentname =
>     { "---" }
>     { currentname }
>   if$
>
> }
>
> FUNCTION {format.names} then needs to be altered, but for ease I will
> past the complete revised function:
>
> FUNCTION {format.names}
> { 'bibinfo :=
>   duplicate$ empty$ 'skip$ {
>   namestring 'oldnames := % Copy the stored names to the oldnames list
>   "" 'namestring :=       % and blank the current name string
>   's :=
>   "" 't :=
>   #1 'nameptr :=
>   s num.names$ 'numnames :=
>   numnames 'namesleft :=
>     { namesleft #0 > }
>     { s nameptr
>       "{vv~}{ll}{, f.}{, jj}"
>       format.name$
>       store.name
>       compare.name % Save the current name to our storage list
>       bib.name.font
>       bibinfo bibinfo.check
>       't :=
>       nameptr #1 >
>         {
>           namesleft #1 >
>             { ", " * t * }
>             {
>               s nameptr "{ll}" format.name$ duplicate$ "others" =
>                 { 't := }
>                 { pop$ }
>               if$
>               t "others" =
>                 {
>                   " " * bbl.etal emphasize *
>                 }
>                 {
>                   bbl.and
>                   space.word * t *
>                 }
>               if$
>             }
>           if$
>         }
>         't
>       if$
>       nameptr #1 + 'nameptr :=
>       namesleft #1 - 'namesleft :=
>     }
>   while$
>   }
>   if$
>
> }
>
> Remove:
>
> STRINGS {oldname}
>
> FUNCTION {name.or.dash}
> { 's :=
>    oldname empty$
>      { s 'oldname := s }
>      { s oldname =
>          { "---" }
>          { s 'oldname := s }
>        if$
>      }
>    if$
>
> }
>
> and all references to name.or.dash.  You should then be good to go.
>
> I hope this works for you!
>
> Joseph Wright

Hmm, I missed the fact that this would match authors later in the list
even if the initial ones didn't match.  Modify my earlier post as
follows:

INTEGERS { nameptr namesleft numnames lastmatch }

....

FUNCTION {compare.name}
{ 'currentname :=
  extract.name
  currentname =
    { nameptr #1 - lastmatch =
        { "---"
          nameptr 'lastmatch := }
        { currentname }
    if$
    }
    { currentname }
  if$
}

This checks that names are only matched "in order".

Joseph Wright

0
joseph.wright (1875)
5/11/2007 4:09:30 PM
On May 11, 5:09 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
wrote:
> On May 11, 4:43 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
> wrote:
>
>
>
> > On May 11, 9:39 am, Arne Henningsen <ahenning...@agric-econ.uni-
>
> > kiel.de> wrote:
> > > Joseph Wright wrote:
> > > > If you could forward me our custom-bib bst file I'll take a look.  It
> > > > shouldn't be too hard (I hope).
>
> > > Thanks! I have put all relevant files on my website:
> > >  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
> > > (section "Economica (ECCA)")
>
> > > Arne
>
> > I will send you the file by e-mail with all of the changes I've made.
> > For the record, there are a few places to alter.  Firts, the following
> > lines are needed before FUNCTION {format.names}:
>
> > STRINGS { oldnames namestring currentname exname exnametmp }
> > INTEGERS { namecnt position }
>
> > % This function builds up a list of names with no formatting.
> > % The names are separtaed by semi-colons for eay unpicking
> > FUNCTION {store.name}
> > { duplicate$
> >   namestring swap$
> >   ";" * *
> >   'namestring :=
>
> > }
>
> > FUNCTION {extract.name}
> > { #0 'namecnt :=
> >   #0 'position :=
> >   "" 'exnametmp :=
> >   { oldnames text.length$ position >
> >     nameptr namecnt > and }
> >   { position #1 + 'position :=
> >     oldnames position #1 substring$
> >     duplicate$ ";" =
> >       { pop$
> >         namecnt #1 + 'namecnt :=
> >         exnametmp 'exname :=
> >         "" 'exnametmp := }
> >       { exnametmp swap$ *
> >         'exnametmp := }
> >     if$
> >  }
> >  while$
> >  exname
>
> > }
>
> > FUNCTION {compare.name}
> > { 'currentname :=
> >   extract.name
> >   currentname =
> >     { "---" }
> >     { currentname }
> >   if$
>
> > }
>
> > FUNCTION {format.names} then needs to be altered, but for ease I will
> > past the complete revised function:
>
> > FUNCTION {format.names}
> > { 'bibinfo :=
> >   duplicate$ empty$ 'skip$ {
> >   namestring 'oldnames := % Copy the stored names to the oldnames list
> >   "" 'namestring :=       % and blank the current name string
> >   's :=
> >   "" 't :=
> >   #1 'nameptr :=
> >   s num.names$ 'numnames :=
> >   numnames 'namesleft :=
> >     { namesleft #0 > }
> >     { s nameptr
> >       "{vv~}{ll}{, f.}{, jj}"
> >       format.name$
> >       store.name
> >       compare.name % Save the current name to our storage list
> >       bib.name.font
> >       bibinfo bibinfo.check
> >       't :=
> >       nameptr #1 >
> >         {
> >           namesleft #1 >
> >             { ", " * t * }
> >             {
> >               s nameptr "{ll}" format.name$ duplicate$ "others" =
> >                 { 't := }
> >                 { pop$ }
> >               if$
> >               t "others" =
> >                 {
> >                   " " * bbl.etal emphasize *
> >                 }
> >                 {
> >                   bbl.and
> >                   space.word * t *
> >                 }
> >               if$
> >             }
> >           if$
> >         }
> >         't
> >       if$
> >       nameptr #1 + 'nameptr :=
> >       namesleft #1 - 'namesleft :=
> >     }
> >   while$
> >   }
> >   if$
>
> > }
>
> > Remove:
>
> > STRINGS {oldname}
>
> > FUNCTION {name.or.dash}
> > { 's :=
> >    oldname empty$
> >      { s 'oldname := s }
> >      { s oldname =
> >          { "---" }
> >          { s 'oldname := s }
> >        if$
> >      }
> >    if$
>
> > }
>
> > and all references to name.or.dash.  You should then be good to go.
>
> > I hope this works for you!
>
> > Joseph Wright
>
> Hmm, I missed the fact that this would match authors later in the list
> even if the initial ones didn't match.  Modify my earlier post as
> follows:
>
> INTEGERS { nameptr namesleft numnames lastmatch }
>
> ...
>
> FUNCTION {compare.name}
> { 'currentname :=
>   extract.name
>   currentname =
>     { nameptr #1 - lastmatch =
>         { "---"
>           nameptr 'lastmatch := }
>         { currentname }
>     if$
>     }
>     { currentname }
>   if$
>
> }
>
> This checks that names are only matched "in order".
>
> Joseph Wright

Opps again.  A blank line crept in just before the closing } in
FUNCTION {compare.name} - remove it!

Joseph Wright

0
joseph.wright (1875)
5/12/2007 12:00:53 PM
Joseph Wright wrote:
> On May 11, 5:09 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
> wrote:
>> On May 11, 4:43 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
>> wrote:
>>
>>
>>
>> > On May 11, 9:39 am, Arne Henningsen <ahenning...@agric-econ.uni-
>> > kiel.de> wrote:
>> > > Joseph Wright wrote:
>> > > > If you could forward me our custom-bib bst file I'll take a look. 
>> > > > It shouldn't be too hard (I hope).
>>
>> > > Thanks! I have put all relevant files on my website:
>> > >  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
>> > > (section "Economica (ECCA)")
>>
>> > > Arne
>>
>> > I will send you the file by e-mail with all of the changes I've made.
>> > For the record, there are a few places to alter.  Firts, the following
>> > lines are needed before FUNCTION {format.names}:
>>
>> > STRINGS { oldnames namestring currentname exname exnametmp }
>> > INTEGERS { namecnt position }
>>
>> > % This function builds up a list of names with no formatting.
>> > % The names are separtaed by semi-colons for eay unpicking
>> > FUNCTION {store.name}
>> > { duplicate$
>> >   namestring swap$
>> >   ";" * *
>> >   'namestring :=
>>
>> > }
>>
>> > FUNCTION {extract.name}
>> > { #0 'namecnt :=
>> >   #0 'position :=
>> >   "" 'exnametmp :=
>> >   { oldnames text.length$ position >
>> >     nameptr namecnt > and }
>> >   { position #1 + 'position :=
>> >     oldnames position #1 substring$
>> >     duplicate$ ";" =
>> >       { pop$
>> >         namecnt #1 + 'namecnt :=
>> >         exnametmp 'exname :=
>> >         "" 'exnametmp := }
>> >       { exnametmp swap$ *
>> >         'exnametmp := }
>> >     if$
>> >  }
>> >  while$
>> >  exname
>>
>> > }
>>
>> > FUNCTION {compare.name}
>> > { 'currentname :=
>> >   extract.name
>> >   currentname =
>> >     { "---" }
>> >     { currentname }
>> >   if$
>>
>> > }
>>
>> > FUNCTION {format.names} then needs to be altered, but for ease I will
>> > past the complete revised function:
>>
>> > FUNCTION {format.names}
>> > { 'bibinfo :=
>> >   duplicate$ empty$ 'skip$ {
>> >   namestring 'oldnames := % Copy the stored names to the oldnames list
>> >   "" 'namestring :=       % and blank the current name string
>> >   's :=
>> >   "" 't :=
>> >   #1 'nameptr :=
>> >   s num.names$ 'numnames :=
>> >   numnames 'namesleft :=
>> >     { namesleft #0 > }
>> >     { s nameptr
>> >       "{vv~}{ll}{, f.}{, jj}"
>> >       format.name$
>> >       store.name
>> >       compare.name % Save the current name to our storage list
>> >       bib.name.font
>> >       bibinfo bibinfo.check
>> >       't :=
>> >       nameptr #1 >
>> >         {
>> >           namesleft #1 >
>> >             { ", " * t * }
>> >             {
>> >               s nameptr "{ll}" format.name$ duplicate$ "others" =
>> >                 { 't := }
>> >                 { pop$ }
>> >               if$
>> >               t "others" =
>> >                 {
>> >                   " " * bbl.etal emphasize *
>> >                 }
>> >                 {
>> >                   bbl.and
>> >                   space.word * t *
>> >                 }
>> >               if$
>> >             }
>> >           if$
>> >         }
>> >         't
>> >       if$
>> >       nameptr #1 + 'nameptr :=
>> >       namesleft #1 - 'namesleft :=
>> >     }
>> >   while$
>> >   }
>> >   if$
>>
>> > }
>>
>> > Remove:
>>
>> > STRINGS {oldname}
>>
>> > FUNCTION {name.or.dash}
>> > { 's :=
>> >    oldname empty$
>> >      { s 'oldname := s }
>> >      { s oldname =
>> >          { "---" }
>> >          { s 'oldname := s }
>> >        if$
>> >      }
>> >    if$
>>
>> > }
>>
>> > and all references to name.or.dash.  You should then be good to go.
>>
>> > I hope this works for you!
>>
>> > Joseph Wright
>>
>> Hmm, I missed the fact that this would match authors later in the list
>> even if the initial ones didn't match.  Modify my earlier post as
>> follows:
>>
>> INTEGERS { nameptr namesleft numnames lastmatch }
>>
>> ...
>>
>> FUNCTION {compare.name}
>> { 'currentname :=
>>   extract.name
>>   currentname =
>>     { nameptr #1 - lastmatch =
>>         { "---"
>>           nameptr 'lastmatch := }
>>         { currentname }
>>     if$
>>     }
>>     { currentname }
>>   if$
>>
>> }
>>
>> This checks that names are only matched "in order".
>>
>> Joseph Wright
> 
> Opps again.  A blank line crept in just before the closing } in
> FUNCTION {compare.name} - remove it!
> 
> Joseph Wright

Thank you, Joseph Wright, for your great help!
There was just a little problem: some repeated author names were not
replaced by a dash although they should. I solved this problem by adding
following line after the line "   while$" in function "format.names":
  #0 'lastmatch :=
This command resets the variable "lastmatch" to zero when all author names
of an entry are formatted.

Arne

0
5/12/2007 4:01:35 PM
On May 12, 5:01 pm, Arne Henningsen <ahenning...@agric-econ.uni-
kiel.de> wrote:
> Joseph Wright wrote:
> > On May 11, 5:09 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
> > wrote:
> >> On May 11, 4:43 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
> >> wrote:
>
> >> > On May 11, 9:39 am, Arne Henningsen <ahenning...@agric-econ.uni-
> >> > kiel.de> wrote:
> >> > > Joseph Wright wrote:
> >> > > > If you could forward me our custom-bib bst file I'll take a look.
> >> > > > It shouldn't be too hard (I hope).
>
> >> > > Thanks! I have put all relevant files on my website:
> >> > >  http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html
> >> > > (section "Economica (ECCA)")
>
> >> > > Arne
>
> >> > I will send you the file by e-mail with all of the changes I've made.
> >> > For the record, there are a few places to alter.  Firts, the following
> >> > lines are needed before FUNCTION {format.names}:
>
> >> > STRINGS { oldnames namestring currentname exname exnametmp }
> >> > INTEGERS { namecnt position }
>
> >> > % This function builds up a list of names with no formatting.
> >> > % The names are separtaed by semi-colons for eay unpicking
> >> > FUNCTION {store.name}
> >> > { duplicate$
> >> >   namestring swap$
> >> >   ";" * *
> >> >   'namestring :=
>
> >> > }
>
> >> > FUNCTION {extract.name}
> >> > { #0 'namecnt :=
> >> >   #0 'position :=
> >> >   "" 'exnametmp :=
> >> >   { oldnames text.length$ position >
> >> >     nameptr namecnt > and }
> >> >   { position #1 + 'position :=
> >> >     oldnames position #1 substring$
> >> >     duplicate$ ";" =
> >> >       { pop$
> >> >         namecnt #1 + 'namecnt :=
> >> >         exnametmp 'exname :=
> >> >         "" 'exnametmp := }
> >> >       { exnametmp swap$ *
> >> >         'exnametmp := }
> >> >     if$
> >> >  }
> >> >  while$
> >> >  exname
>
> >> > }
>
> >> > FUNCTION {compare.name}
> >> > { 'currentname :=
> >> >   extract.name
> >> >   currentname =
> >> >     { "---" }
> >> >     { currentname }
> >> >   if$
>
> >> > }
>
> >> > FUNCTION {format.names} then needs to be altered, but for ease I will
> >> > past the complete revised function:
>
> >> > FUNCTION {format.names}
> >> > { 'bibinfo :=
> >> >   duplicate$ empty$ 'skip$ {
> >> >   namestring 'oldnames := % Copy the stored names to the oldnames list
> >> >   "" 'namestring :=       % and blank the current name string
> >> >   's :=
> >> >   "" 't :=
> >> >   #1 'nameptr :=
> >> >   s num.names$ 'numnames :=
> >> >   numnames 'namesleft :=
> >> >     { namesleft #0 > }
> >> >     { s nameptr
> >> >       "{vv~}{ll}{, f.}{, jj}"
> >> >       format.name$
> >> >       store.name
> >> >       compare.name % Save the current name to our storage list
> >> >       bib.name.font
> >> >       bibinfo bibinfo.check
> >> >       't :=
> >> >       nameptr #1 >
> >> >         {
> >> >           namesleft #1 >
> >> >             { ", " * t * }
> >> >             {
> >> >               s nameptr "{ll}" format.name$ duplicate$ "others" =
> >> >                 { 't := }
> >> >                 { pop$ }
> >> >               if$
> >> >               t "others" =
> >> >                 {
> >> >                   " " * bbl.etal emphasize *
> >> >                 }
> >> >                 {
> >> >                   bbl.and
> >> >                   space.word * t *
> >> >                 }
> >> >               if$
> >> >             }
> >> >           if$
> >> >         }
> >> >         't
> >> >       if$
> >> >       nameptr #1 + 'nameptr :=
> >> >       namesleft #1 - 'namesleft :=
> >> >     }
> >> >   while$
> >> >   }
> >> >   if$
>
> >> > }
>
> >> > Remove:
>
> >> > STRINGS {oldname}
>
> >> > FUNCTION {name.or.dash}
> >> > { 's :=
> >> >    oldname empty$
> >> >      { s 'oldname := s }
> >> >      { s oldname =
> >> >          { "---" }
> >> >          { s 'oldname := s }
> >> >        if$
> >> >      }
> >> >    if$
>
> >> > }
>
> >> > and all references to name.or.dash.  You should then be good to go.
>
> >> > I hope this works for you!
>
> >> > Joseph Wright
>
> >> Hmm, I missed the fact that this would match authors later in the list
> >> even if the initial ones didn't match.  Modify my earlier post as
> >> follows:
>
> >> INTEGERS { nameptr namesleft numnames lastmatch }
>
> >> ...
>
> >> FUNCTION {compare.name}
> >> { 'currentname :=
> >>   extract.name
> >>   currentname =
> >>     { nameptr #1 - lastmatch =
> >>         { "---"
> >>           nameptr 'lastmatch := }
> >>         { currentname }
> >>     if$
> >>     }
> >>     { currentname }
> >>   if$
>
> >> }
>
> >> This checks that names are only matched "in order".
>
> >> Joseph Wright
>
> > Opps again.  A blank line crept in just before the closing } in
> > FUNCTION {compare.name} - remove it!
>
> > Joseph Wright
>
> Thank you, Joseph Wright, for your great help!
> There was just a little problem: some repeated author names were not
> replaced by a dash although they should. I solved this problem by adding
> following line after the line "   while$" in function "format.names":
>   #0 'lastmatch :=
> This command resets the variable "lastmatch" to zero when all author names
> of an entry are formatted.
>
> Arne

Ah yes, probably a good thing.

Joseph Wright

0
joseph.wright (1875)
5/13/2007 10:57:19 AM
A BibTeX style that replaces repeated author names by multiple dashes
(ecca.bst) is available on CTAN and on my website now:

http://www.ctan.org/tex-archive/biblio/bibtex/contrib/economic/

http://www.uni-kiel.de/agrarpol/ahenningsen/latex-bibtex.html

Arne

0
5/15/2007 9:18:23 AM
Arne Henningsen wrote:
> Hi,
> 
> I would like to create a BibTeX style (bst-file) that produces a list of
> references where *each* author name is replaces by a dash if it is the same
> author as in the previous entry. 

I think Jurabib does this in an option or setting. It's a very common 
requirement in the Humanities.

///Peter
0
Peter
5/16/2007 9:52:44 PM
On May 16, 10:52 pm, Peter Flynn <peter.n...@m.silmaril.ie> wrote:
> Arne Henningsen wrote:
> > Hi,
>
> > I would like to create a BibTeX style (bst-file) that produces a list of
> > references where *each* author name is replaces by a dash if it is the same
> > author as in the previous entry.
>
> I think Jurabib does this in an option or setting. It's a very common
> requirement in the Humanities.
>
> ///Peter

My understanding is that jurabib is quite a time investment, compared
to other bibliography styles.  The LaTeX Companion indicates that you
can't just hack something quickly together.  I may be wrong, thought!

Joseph Wright

0
joseph.wright (1875)
5/17/2007 11:08:33 AM
Reply: