[OS X TeX] bibtex style file

Paul Fons paul-fons at aist.go.jp
Thu Nov 9 05:21:24 CET 2006


   I have to write an article for a journal with a somewhat bizarre  
bibliographic style.  It requires a colon ":", yes a colon after the  
author names.  Unfortunately the master style file custom.bib is not  
quite smart enough to handle this requiring manual editing of the  
style file.  I certainly would be the first to admit I don't know  
what I am doing, but I took a shot anyway.  I generated a style file  
as close as I could using custom.bib (so all of the definitions are  
the same) and then hacked the function format.names to add a colon.   
The trouble is that my hack only half works -- e.g. it puts a colon  
at the end of a list of authors (this is fine), but in the special  
case where there is only one author, there is no colon inserted.  Any  
suggestions as to how to fix this.  And yes, I did look around to  
find a style file for this and couldn't find a functional one  
(although they do have latex style files).  How can I hack this so I  
will have a colon at the end of the author list when there is only  
one author (BTW my hack is bbl.colon)  Thanks.

		confused in Japan



FUNCTION {bbl.colon}
{* ":" }


FUNCTION {format.names}
{ 'bibinfo :=
   duplicate$ empty$ 'skip$ {
   's :=
   "" 't :=
   #1 'nameptr :=
   s num.names$ 'numnames :=
   numnames 'namesleft :=
     { namesleft #0 > }
     { s nameptr
       "{f.~}{vv~}{ll}{, jj}"
       format.name$
       bibinfo bibinfo.check
       't :=
       nameptr #1 >
         {
           namesleft #1 >
             { ", " * t * }
             {
               s nameptr "{ll}" format.name$ duplicate$ "others" =
                 { 't := }
                 { pop$ }
               if$
               t "others" =
                 {
                   " " * bbl.etal *
                 }
                 {
                   bbl.and
                   space.word * t * bbl.colon
                 }
               if$
             }
           if$
         }
         't
       if$
       nameptr #1 + 'nameptr :=
       namesleft #1 - 'namesleft :=
     }
   while$
   } if$
}

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list