summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/bibtex/bst/opcit/opcit.bst
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/bibtex/bst/opcit/opcit.bst')
-rw-r--r--Master/texmf-dist/bibtex/bst/opcit/opcit.bst725
1 files changed, 451 insertions, 274 deletions
diff --git a/Master/texmf-dist/bibtex/bst/opcit/opcit.bst b/Master/texmf-dist/bibtex/bst/opcit/opcit.bst
index 3135c3faa1a..3d25aa82db6 100644
--- a/Master/texmf-dist/bibtex/bst/opcit/opcit.bst
+++ b/Master/texmf-dist/bibtex/bst/opcit/opcit.bst
@@ -7,7 +7,7 @@
%% opcit.dtx (with options: `bst')
%% Part of the `opcit' project: bibliographical references as footnotes.
%%
-%% Copyright 2002 Federico Garcia
+%% Copyright 2006 Federico Garcia
%%
ENTRY
{ address
@@ -16,6 +16,7 @@ ENTRY
chapter
edition
editor
+ hereafter
howpublished
institution
journal
@@ -30,73 +31,24 @@ ENTRY
series
title
type
+ url
+ urldate
volume
year
- hereafter
}
{}
{ label }
-INTEGERS { output.state before.all mid.sentence after.sentence after.block quoted.state }
+INTEGERS { output.state before.all mid.sentence after.sentence
+ after.block quoted.state period.state }
-STRINGS { s t last.authors }
+STRINGS { s t last.authors quotes }
FUNCTION {init.state.consts}
-{ #0 'before.all :=
- #1 'mid.sentence :=
- #2 'after.sentence :=
- #3 'after.block :=
- #0 'quoted.state :=
+{ #0 'period.state :=
+ #0 'before.all :=
"" 'last.authors :=
-}
-FUNCTION {output.nonnull}
-{ 's :=
- output.state mid.sentence =
- { " " * write$ }
- { output.state after.block =
- { "\bibpunctuation" *
- quoted.state #1 =
- { #2 'quoted.state := }
- { quoted.state #2 =
- { "''" * #0 'quoted.state := }
- 'skip$
- if$
- }
- if$
- write$
- newline$
- "\newblock " write$
- }
- { output.state before.all =
- 'write$
- { "\bibpunctuation" * write$ }
- if$
- }
- if$
- mid.sentence 'output.state :=
- }
- if$
- s
-}
-
-FUNCTION {output}
-{ duplicate$ empty$
- 'pop$
- 'output.nonnull
- if$
-}
-
-FUNCTION {output.check}
-{ 't :=
- duplicate$ empty$
- { pop$ "empty " t * " in " * cite$ * warning$ }
- 'output.nonnull
- if$
-}
-
-FUNCTION {fin.entry}
-{ "\opcitend%" * write$
- newline$
+ "" 'quotes :=
}
FUNCTION {new.block}
@@ -123,22 +75,6 @@ FUNCTION {or}
if$
}
-FUNCTION {new.block.checka}
-{ empty$
- 'skip$
- 'new.block
- if$
-}
-
-FUNCTION {new.block.checkb}
-{ empty$
- swap$ empty$
- and
- 'skip$
- 'new.block
- if$
-}
-
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
@@ -155,45 +91,83 @@ FUNCTION {emphasize}
INTEGERS { nameptr namesleft numnames }
-FUNCTION {format.names}
+FUNCTION{format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
- { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
+ { s nameptr "{ff }{vv~}{ll}{,~jj}" format.name$ 't :=
nameptr #1 >
- { namesleft #1 >
- { ", " * t * }
- { numnames #2 >
- { "," * }
- 'skip$
- if$
- t "others" =
- { " et~al." * }
- { " and " * t * }
+ { namesleft #1 >
+ { ", " * t * }
+ { numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+ t "others" =
+ { " et~al." * }
+ { " and " * t * }
+ if$
+ }
if$
}
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {format.swap.names}
+{ 's :=
+ s num.names$ 'numnames :=
+ "\SwapNames{" s #1 "{ff}" format.name$
+ duplicate$ #-1 #1 substring$
+ "." =
+ { #1 'period.state := }
+ 'skip$
+ if$
+ * "}{" *
+ s #1 "{vv~}{ll}" format.name$ * "}" *
+ s #1 "{, jj}" format.name$ *
+ numnames #3 >
+ { " et~al." * #1 'period.state := }
+ { numnames #1 >
+ { #2 'nameptr :=
+ numnames #1 - 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
+ namesleft #1 >
+ { ", " * t * }
+ { " and " * t * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ }
+ 'skip$
if$
}
- 't
- if$
- nameptr #1 + 'nameptr :=
- namesleft #1 - 'namesleft :=
- }
- while$
+ if$
}
FUNCTION {format.authors}
-{ author empty$
+{ author empty$
{ ""
"" 'last.authors :=
}
- { author last.authors =
+ { author format.names
+ last.authors =
{ "\sameauthors" }
- { author format.names }
+ { before.all output.state =
+ { author format.swap.names }
+ { author format.names }
+ if$ }
if$
- author 'last.authors :=
+ author format.names 'last.authors :=
}
if$
}
@@ -201,21 +175,27 @@ FUNCTION {format.authors}
FUNCTION {format.editors}
{ editor empty$
{ "" }
- { editor format.names }
+ { before.all output.state =
+ { editor format.swap.names }
+ { editor format.names }
+ if$
+ }
if$
}
FUNCTION {format.editors.ed}
{ editor empty$
{ "" }
- { editor format.names " (ed.)" * }
- if$
-}
-
-FUNCTION {format.title}
-{ title empty$
- { "" }
- { title }
+ { before.all output.state =
+ { editor format.swap.names }
+ { editor format.names }
+ if$
+ editor num.names$ #1 >
+ { " (eds.)" * }
+ { " (ed.)" * }
+ if$
+ #0 'period.state :=
+ }
if$
}
@@ -247,24 +227,20 @@ FUNCTION {n.dashify}
FUNCTION {format.date}
{ year empty$
{ month empty$
- { "" }
- { "there's a month but no year in " cite$ * warning$
- month
- }
+ { "" }
+ { "there's a month but no year in " cite$ * warning$
+ "\toomit[month]{" month * " }" *
+ }
if$
}
{ month empty$
- 'year
- { month " " * year * }
+ 'year
+ { "\toomit[month]{" month * " }" * year * }
if$
}
if$
}
-FUNCTION {format.btitle}
-{ title emphasize
-}
-
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
@@ -273,22 +249,21 @@ FUNCTION {tie.or.space.connect}
swap$ * *
}
-FUNCTION {either.or.check}
-{ empty$
- 'pop$
- { "can't use both " swap$ * " fields in " * cite$ * warning$ }
- if$
+FUNCTION{either.warning}
+{ empty$
+ 'pop$
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
}
-
FUNCTION {format.bvolume}
{ volume empty$
{ "" }
- { "volume" volume tie.or.space.connect
+ { "\bibcase volume" volume tie.or.space.connect
series empty$
- 'skip$
- { " of " * series emphasize * }
+ 'skip$
+ { " of " * series emphasize * }
if$
- "volume and number" number either.or.check
+ "volume and number" number either.warning
}
if$
}
@@ -296,38 +271,25 @@ FUNCTION {format.bvolume}
FUNCTION {format.number.series}
{ volume empty$
{ number empty$
- { series empty$
- { "" }
- { ", series " * series * "" }
- if$ }
- { output.state mid.sentence =
- { "number" }
- { "Number" }
- if$
- number tie.or.space.connect
- series empty$
- { "there's a number but no series in " cite$ * warning$ }
- { " in " * series * }
- if$
- }
+ { series empty$
+ { "" }
+ { ", series " * series * "" }
+ if$
+ }
+ { "\bibcase number"
+ number tie.or.space.connect
+ series empty$
+ { "there's a number but no series in " cite$ * warning$ }
+ { " in " * series * }
+ if$
+ }
if$
}
{ "" }
if$
}
-FUNCTION {format.edition}
-{ edition empty$
- { "" }
- { output.state mid.sentence =
- { edition "l" change.case$ " edition" * }
- { edition "t" change.case$ " edition" * }
- if$
- }
- if$
-}
-
-INTEGERS { multiresult }
+INTEGERS { multiresult}
FUNCTION {multi.page.check}
{ 't :=
@@ -353,8 +315,8 @@ FUNCTION {format.pages}
{ pages empty$
{ "" }
{ pages multi.page.check
- { "pages" pages n.dashify tie.or.space.connect }
- { "page" pages tie.or.space.connect }
+ { "\toomit[pages]{\bibcase " swap$ * pages n.dashify tie.or.space.connect "}" * }
+ { "\toomit[pages]{\bibcase " swap$ * pages tie.or.space.connect "}" * }
if$
}
if$
@@ -364,13 +326,13 @@ FUNCTION {format.vol.num.date.pages}
{ volume empty$
'skip$
{ volume }
- if$
- number empty$
+ if$
+ number empty$
'skip$
- { "/" number * *
+ { "/" number *
volume empty$
- { "there's a number but no volume in " cite$ * warning$ }
- 'skip$
+ { "there's a number but no volume in " cite$ * warning$ }
+ { * }
if$
}
if$
@@ -378,8 +340,8 @@ FUNCTION {format.vol.num.date.pages}
pages empty$
'skip$
{ duplicate$ empty$
- { pop$ format.pages }
- { ": " * pages n.dashify * }
+ { pop$ "" format.pages * }
+ { ": " format.pages * }
if$
}
if$
@@ -387,90 +349,86 @@ FUNCTION {format.vol.num.date.pages}
FUNCTION {format.chapter.pages}
{ chapter empty$
- 'format.pages
- { type empty$
- { "chapter" }
- { type "l" change.case$ }
+ { pages empty$
+ { "" }
+ { ": " format.pages }
+ if$
+ }
+ { "\newblock\bibpunctuation "
+ type empty$
+ { "\bibcase chapter" * }
+ { type "l" change.case$ * }
if$
chapter tie.or.space.connect
pages empty$
'skip$
- { ", " * format.pages * }
- if$
- }
- if$
-}
-
-FUNCTION {format.in.ed.booktitle}
-{ booktitle empty$
- { "" }
- { "\bibIn \ " booktitle emphasize *
- editor empty$
- 'skip$
- { ", ed.~" * format.editors * }
+ { ", pages " * format.pages * }
if$
}
if$
}
-FUNCTION {empty.misc.check}
-{ author empty$ title empty$ howpublished empty$
- month empty$ year empty$ note empty$
- and and and and and
- key empty$ not and
- { "all relevant fields are empty in " cite$ * warning$ }
- 'skip$
- if$
-}
FUNCTION{get.lastnames}
{ 's :=
- #1 'nameptr :=
s num.names$ 'numnames :=
- numnames 'namesleft :=
- { namesleft #0 > }
- { s nameptr "{vv~}{ll}" format.name$ 't :=
- nameptr #1 >
- { namesleft #1 >
- { ", " * t * }
- { numnames #2 >
- { "," * }
- 'skip$
- if$
- t "others" =
- { " et~al." * }
- { " and " * t * }
- if$
+ s #1 "{vv~}{ll}" format.name$
+ numnames #3 >
+ { " et~al." * }
+ { numnames #1 >
+ { #2 'nameptr :=
+ numnames #1 - 'namesleft :=
+ { namesleft #0 > }
+ { s nameptr "{vv~}{ll}" format.name$ 't :=
+ namesleft #1 >
+ { ", " * t * }
+ { " and " * t * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
}
+ 'skip$
if$
}
- 't
- if$
- nameptr #1 + 'nameptr :=
- namesleft #1 - 'namesleft :=
- }
- while$
+ if$
}
FUNCTION {make.address.publisher.year}
-{ "\unskip\bibparenthesis{"
+{ ""
address empty$
'skip$
- { address * ": " * }
- if$
+ { address * }
+ if$
publisher empty$
'skip$
- { publisher * ", " * }
+ { address empty$
+ { publisher * }
+ { ": " * publisher * }
if$
- format.date * "}" *
+ }
+ if$
+ format.date duplicate$ "" =
+ 'pop$
+ { swap$ duplicate$ "" =
+ { * }
+ { swap$ ", " swap$ * * }
+ if$}
+ if$
+ duplicate$ "" =
+ 'skip$
+ { "\bibparenthesis{" swap$ * "}" * }
+ if$
}
-FUNCTION{format.title.quoted}
-{ title empty$
- { "" }
- { "``" title * }
- if$
- #1 'quoted.state :=
+FUNCTION {make.url}
+{ "\url{" url * "}" *
+ urldate empty$
+ { "there is url but no urldate in " cite$ * warning$ }
+ { " (accessed " * urldate * ")" * }
+ if$
}
+
FUNCTION {output.bibitem}
{ newline$
"\bibitem{" write$
@@ -479,80 +437,293 @@ FUNCTION {output.bibitem}
newline$
"\biblastnames{" write$
author empty$
- { editor get.lastnames }
+ { editor empty$
+ { organization empty$
+ { "no last names in " cite$ * warning$ }
+ { organization }
+ if$
+ }
+ { editor get.lastnames
+ editor num.names$ #1 >
+ { " (eds.)" * }
+ { " (ed.)" * }
+ if$
+ }
+ if$
+ }
{ author get.lastnames }
if$
"}" * write$
- hereafter empty$
- 'skip$
- { "\bibhereafter{" write$ hereafter "}" * write$ }
- if$
- newline$
- "\opcitstart " write$
before.all 'output.state :=
- #0 'quoted.state :=
}
-FUNCTION {article}
+
+FUNCTION{output.start}
+{ hereafter empty$
+ 'skip$
+ { "\bibhereafter{{\noexpand\em " write$ hereafter "}}" * write$ }
+ if$
+ newline$
+ "\opcitstart " write$
+}
+
+FUNCTION{output.as.block}
+{ duplicate$ "" =
+ 'pop$
+ { period.state #1 =
+ { "\GobbleOrNot" #0 'period.state := }
+ { "" }
+ if$
+ "\bibpunctuation" * quotes * write$ newline$ "\newblock " swap$ * write$
+ #1 'output.state :=
+ }
+ if$
+ "" 'quotes :=
+}
+
+FUNCTION{output.omitted}
+{ 't :=
+ duplicate$ "" =
+ { pop$ }
+ { "\toomit[" t * "]{\bibpunctuation\bibcase " * swap$ * "}" * write$ }
+ if$
+}
+
+FUNCTION {fin.entry}
+{ write$
+ note empty$ {""} {note} if$ "note" output.omitted
+ "\opcitend" write$
+ newline$
+}
+
+FUNCTION{empty.warning}
+{ 't :=
+ duplicate$ empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ ""}
+ 'skip$
+ if$
+}
+
+FUNCTION{empty.chapter.and.pages.warning}
+{ 't :=
+ chapter empty$
+ { pages empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ "" }
+ 'skip$
+ if$
+ }
+ 'skip$
+ if$
+
+}
+
+FUNCTION{book}
+{ output.bibitem
+ output.start
+ author empty$
+ { format.editors.ed "author and editor" empty.warning write$ }
+ { format.authors "author and editor" editor either.warning write$ }
+ if$
+ title emphasize "title" empty.warning output.as.block
+ edition empty$
+ 'skip$
+ { "\bibcase " edition * " edition" * output.as.block }
+ if$
+ howpublished missing$
+ 'skip$
+ { "\bibcase " howpublished * output.as.block }
+ if$
+ format.bvolume "volume" output.omitted
+ format.number.series "number" output.omitted
+ make.address.publisher.year write$
+ url empty$
+ 'skip$
+ { make.url output.as.block }
+ if$
+ fin.entry
+}
+
+FUNCTION{article}
+{ output.bibitem
+ output.start
+ format.authors "author" empty.warning write$
+ "``" title * "title" empty.warning output.as.block "''" 'quotes :=
+ howpublished empty$
+ 'skip$
+ { "\bibpunctuation'' \newblock\toomit[howpublished]{\bibcase
+ " howpublished * write$
+ "}" 'quotes :=
+ }
+ if$
+ journal emphasize "journal" empty.warning
+ " " * format.vol.num.date.pages "year" empty.warning * output.as.block
+ url empty$
+ 'skip$
+ { make.url output.as.block }
+ if$
+ fin.entry
+}
+
+FUNCTION {incollection}
{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title.quoted "title" output.check
- new.block
- journal emphasize "journal" output.check
- format.vol.num.date.pages "year" output.check
- new.block
- note output
+ output.start
+ format.authors "author" empty.warning write$
+ "``" title * "title" empty.warning output.as.block "''" 'quotes :=
+ "\bibcase in " output.as.block
+ crossref empty$
+ 'skip$
+ { "\bibincite{" crossref * "}" * write$ }
+ if$
+ "{" write$
+ editor empty$
+ 'skip$
+ { format.editors.ed ", " * write$ }
+ if$
+ booktitle emphasize "booktitle" empty.warning write$
+ edition empty$
+ 'skip$
+ { "\bibcase " edition * " edition" * output.as.block }
+ if$
+ make.address.publisher.year write$
+ url empty$
+ 'skip$
+ { make.url output.as.block }
+ if$
+ "}" write$
+ format.chapter.pages write$
fin.entry
}
-FUNCTION {book}
+FUNCTION {inbook}
{ output.bibitem
+ output.start
author empty$
- { format.editors.ed "author and editor" output.check }
- { format.authors output.nonnull
- "author and editor" editor either.or.check
- }
- if$
- new.block
- format.btitle "title" output.check
- edition new.block.checka
- format.edition output
- format.bvolume output
- format.number.series output
- make.address.publisher.year output
- new.block
- note output
+ { format.editors.ed "author and editor" empty.warning write$ }
+ { format.authors "author and editor" editor either.warning write$ }
+ if$
+ "``" title * "title" empty.warning output.as.block "''" 'quotes :=
+ chapter empty$
+ 'skip$
+ { type empty$
+ { "\bibcase chapter " chapter * }
+ { "\bibcase " type * " " * chapter * }
+ if$
+ }
+ if$
+ pages empty$
+ 'skip$
+ { chapter empty$
+ { "\bibcase pages" pages n.dashify tie.or.space.connect }
+ { "\toomit[pages]{ (pages" * pages n.dashify tie.or.space.connect ")}" * }
+ if$
+ }
+ if$
+ "chapter and pages" empty.warning
+ " of " *
+ crossref empty$
+ { booktitle emphasize * "booktitle" empty.warning
+ edition empty$
+ 'skip$
+ { ", " * edition "l" change.case$ * " edition" * }
+ if$
+ howpublished missing$
+ 'skip$
+ { ", " * howpublished * }
+ if$
+ output.as.block
+ make.address.publisher.year write$
+ }
+ { "\bibincitestar{" * crossref * "}{" * booktitle emphasize * "}" * output.as.block }
+ if$
fin.entry
}
-FUNCTION {incollection}
+FUNCTION{phdthesis}
{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title.quoted "title" output.check
- new.block
- format.in.ed.booktitle "booktitle" output.check
- format.bvolume output
- format.number.series output
- make.address.publisher.year output
- format.chapter.pages output
- new.block
- note output
+ output.start
+ format.authors "author" empty.warning write$
+ title emphasize "title" empty.warning
+ "\bibparenthesis{Ph.\,D.\ diss\GobbleOrNot.}" * output.as.block
+ address empty$
+ { "" }
+ { address ": " * }
+ if$
+ school "school" empty.warning * output.as.block
+ month empty$
+ { "" }
+ { month " " * }
+ if$
+ year "year" empty.warning * output.as.block
+ fin.entry
+}
+
+FUNCTION{mastersthesis}
+{ output.bibitem
+ output.start
+ format.authors "author" empty.warning write$
+ title emphasize "title" empty.warning
+ "\bibparenthesis{M.\,A.\ thesis}" * output.as.block
+ address empty$
+ { "" }
+ { address ": " * }
+ if$
+ school "school" empty.warning * output.as.block
+ month empty$
+ { "" }
+ { month " " * }
+ if$
+ year "year" empty.warning * output.as.block
+ fin.entry
+}
+
+FUNCTION{proceedings}
+{ output.bibitem
+ output.start
+ editor empty$
+ { organization "editor and organization" empty.warning write$ }
+ { format.editors.ed "editor" empty.warning write$ }
+ if$
+ title emphasize "title" empty.warning output.as.block
+ format.bvolume "volume" output.omitted
+ format.number.series "number" output.omitted
+ make.address.publisher.year write$
+ fin.entry
+}
+
+FUNCTION {booklet}
+{ book }
+
+FUNCTION {inproceedings}
+{ output.bibitem
+ output.start
+ format.authors "author" empty.warning write$
+ "``" title * "title" empty.warning output.as.block "''" 'quotes :=
+ "\bibcase in " output.as.block
+ crossref empty$
+ 'skip$
+ { "\bibincite{" crossref * "}" * write$ }
+ if$
+ "{" booktitle emphasize * "booktitle" empty.warning write$
+ editor empty$
+ { organization "editor and organization" empty.warning output.as.block }
+ { ", edited by " format.editors * write$ }
+ if$
+ make.address.publisher.year write$
+ "}" write$
+ format.chapter.pages write$
fin.entry
}
FUNCTION {misc}
{ output.bibitem
- format.authors "author" output.check
- new.block
- format.title output
- howpublished new.block.checka
- howpublished output
- format.date output
- new.block
- note output
+ output.start
+ format.authors "author" empty.warning write$
+ title output.as.block
+ howpublished missing$
+ 'skip$
+ { howpublished output.as.block }
+ if$
+ format.date output.as.block
fin.entry
- empty.misc.check
}
FUNCTION {default.type} { misc }
@@ -648,13 +819,13 @@ FUNCTION {sort.format.names}
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
- { " " * }
- 'skip$
+ { " " * }
+ 'skip$
if$
s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
nameptr numnames = t "others" = and
- { "et al" * }
- { t sortify * }
+ { "et al" * }
+ { t sortify * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
@@ -769,6 +940,12 @@ FUNCTION {begin.bib}
'skip$
{ preamble$ write$ newline$ }
if$
+ "\newBibCommand{\bibparenthesis[1]}{ (#1)}{. \newblock #1}" write$ newline$
+ "\newBibCommand{\bibincite[2]}{\recover@last\@nameuse{@#1}}{#2}" write$ newline$
+ "\newBibCommand{\bibincitestar[2]}{\recover@last " write$ newline$
+ " \@nameuse{#1@star}}{#2}" write$ newline$
+ "\newBibCommand{\SwapNames[2]}{#1 #2}{#2, #1}" write$ newline$
+ "\newBibCommand{\GobbleOrNot}{\relax}{\newblock\@gobble}" write$ newline$
"\begin{thebibliography}{}" write$ newline$
}
ITERATE {presort}