🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #11852

Re: Q: How to generate [AAAA 99]-like citation when use BibTeX?

#11852
From: Wu Zhiming
Date: Tue, 28 Nov 1995 00:00
129 lines
4352 bytes
Pavel Pokorny wrote:
> 
> Wu Zhiming (wu@athena.polytechnique.fr) wrote:
> : Hi there
> :
> :         I come across a problem on on generating citation style using
> : BiBTeX.
> : When using the alpha.bst style, the citation is in general appears like
> : [AAA99]. I want a citation format like [AAAA  99], I know how to do it
> : with \bibitem, but I dont know how to generate such a format by BiBTeX.

...
< delete >


> :         France
> 
> There will certainly be more people interested in this solution. (Me too, btw.)
> 
> Pavel POKORNY                   Department of Mathematics
> phone: +42 2 24 35 30 96        Prague Institute of Chemical Technology
> fax:   +42 2 31 13 629          Technicka 5
>  or    +42 2 24 31 10 82        166 28 Prague
> e-mail: Pavel.Pokorny@vscht.cz  Czech Republic

Well, I have solved the problem at the weekend. Here I post the whole modifications I made. 

In total you should make four modifcations, if you want to try my modfications, please first
copy the "alpha.bst" to a new file, say, "alpha_new.bst" ( do "chmod" in order to make it
writable)

^^^^^^^^^^^^^^^^^^^^^
1),  replace the line 
^^^^^^^^^^^^^^^^^^^^^

  { label extra.label sort.label }

by
  { label extra.label sort.label temp.label}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2) replace the FUNCTION {output.bibitem} by the following new fonction:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FUNCTION {output.bibitem}
{ newline$
%% add by WU 
  "\bibitem[\sf " write$
%  "\bibitem[" write$
  label write$
  "]{" write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3) replace the FUNCTION {format.lab.names} by the following new fonction:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FUNCTION {format.lab.names}
{ 's :=
  s num.names$ 'numnames :=
  numnames #1 > 
    {  s #1 "{v{}}{l{}}" format.name$
       pop$ s #1 "{ll}" format.name$ #4 text.prefix$ 
	" {\em et~al.}" * #1 'et.al.char.used :=
    }
    { s #1 "{v{}}{l{}}" format.name$
      pop$ s #1 "{ll}" format.name$ #4 text.prefix$ 
    }
  if$
}

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4) replace the FUNCTION {calc.label} by the following new fonction:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


FUNCTION {calc.label}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label
    { type$ "proceedings" =
        'editor.key.organization.label
        { type$ "manual" =
            'author.key.organization.label
            'author.key.label
          if$
        }
      if$
    }
  if$
  duplicate$
%% by WU:  add " " between name and year
  field.or.null  " " %
  *
  'temp.label :=  
  temp.label year purify$ #-1 #2 substring$ 
  * 
  'temp.label := 
  label temp.label * 'label :=
%  year  field.or.null purify$ #-1 #2 substring$
%  *
%  'label :=
  year  field.or.null purify$ #-1 #4 substring$
  *
  sortify 'sort.label :=
}


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When you have done these modifcations, save the file. Suppose you have saved the file under the
sub directory  /home/users/xxx/tex/inputs, and now you want to try this new citation format, add
the the path to 

\bibliographystyle{/home/users/xxx/tex/inputs/alpha_new}

Then, do as with other styles.


	Good luck

	
	Zhiming WU
Technical Details
Message-ID: <30BA58D6.32AE@athena.polytechnique.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <30B63DF2.32D9@athena.polytechnique.fr> <49cnim$sio@news.vscht.cz>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f9e16,13da702d86009e17
X-Google-Attributes: gidf9e16,public
X-Google-Thread: 10ee61,1faaaaffa68a98f1
X-Google-Attributes: gid10ee61,public
From: Wu Zhiming <wu@athena.polytechnique.fr>
Subject: Re: Q: How to generate [AAAA  99]-like citation when use BibTeX?
Date: 1995/11/28
Message-ID: <30BA58D6.32AE@athena.polytechnique.fr>
X-Deja-AN: 120225814
references: <30B63DF2.32D9@athena.polytechnique.fr> <49cnim$sio@news.vscht.cz>
to: Pavel Pokorny <pokornp@math.vscht.cz>
content-type: text/plain; charset=us-ascii
organization: Ecole Polytechnique
mime-version: 1.0
newsgroups: comp.text.tex,fr.comp.text.tex
x-mailer: Mozilla 2.0b2 (X11; I; HP-UX A.09.05 9000/712)