summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tugboat/tugboat.bst
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tugboat/tugboat.bst')
-rw-r--r--macros/latex/contrib/tugboat/tugboat.bst96
1 files changed, 86 insertions, 10 deletions
diff --git a/macros/latex/contrib/tugboat/tugboat.bst b/macros/latex/contrib/tugboat/tugboat.bst
index d5ed32280f..7fadb59d35 100644
--- a/macros/latex/contrib/tugboat/tugboat.bst
+++ b/macros/latex/contrib/tugboat/tugboat.bst
@@ -1,23 +1,27 @@
-%%% $Id: tugboat.bst 314 2020-11-15 02:06:03Z karl $
+%%% $Id: tugboat.bst 375 2021-06-25 14:40:52Z karl $
%%% TUGboat changes are public domain.
%%%
%%% Modified for TUGboat from abbrvurl.bst:
+%%% New entry types @ctan (see ctanbib) and @online (alias for @misc).
+%%% New field bookauthor for @incollection and @inproceedings.
%%% Abbreviate "page(s)" to "p(p).",
%%% "volume" to "vol.",
%%% "editor(s)" to "ed(s)".
%%% Output "Ph.D." rather than "PhD".
%%% Output "No." and "no." for number field.
+%%% Omit spaces between author initials, like "A.B. Smith".
%%% Set urlintro="".
%%% Always use https://doi.org/ for the doi url, and omit doi: prefix
-%%% (incomplete: doi urls not linked correctly).
-%%% Omit spaces between author initials, like "A.B. Smith".
+%%% (todo: doi urls not linked correctly).
%%% Truncate long author lists in format.names (max.names, trunc.num)
%%% and omit "and" from author lists, per Oren P.
-%%% New field bookauthor for @incollection and @inproceedings.
+%%% Use \emph instead of \em so we get automatic italic corrections.
%%% New fields for editors:
+%%% "journaltie" - ~ instead of space after journal name.
%%% "newpage" - force page break after entry;
+%%% "prebibitem" - material output before \bibitem, with newline appended.
%%% "urlnewline" - force line break before url value;
-%%% "journaltie" - ~ instead of space after journal name.
+%%%
%%% --karl, originally created 24jul18.
%%%
%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/abbrv.bst
@@ -69,9 +73,13 @@ ENTRY
pubmed % urlbst
url % urlbst
lastchecked % urlbst
+ date % ctan
+ urldate % ctan
+ version % ctan
+ journaltie % tub
newpage % tub
+ prebibitem % tub
urlnewline % tub
- journaltie % tub
}
{}
{ label }
@@ -246,6 +254,7 @@ FUNCTION {add.inlinelink}
}
if$
}
+
FUNCTION {output.nonnull}
{ % Save the thing we've been asked to output
's :=
@@ -315,8 +324,10 @@ FUNCTION {output.check}
if$
}
+% tub: if prebibitem is nonempty, output it, plus a newline.
FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below)
{ newline$
+ prebibitem empty$ { skip$ } { prebibitem write$ newline$ } if$
"\bibitem{" write$
cite$ write$
"}" write$
@@ -334,6 +345,18 @@ FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wra
newline$
}
+% ctan
+FUNCTION {add.blank}
+{ " " * before.all 'output.state :=
+}
+
+% ctan
+FUNCTION {add.colon}
+{ empty$
+ 'skip$
+ { before.all 'output.state := ":" output add.blank }
+ if$
+}
FUNCTION {new.block}
{ output.state before.all =
@@ -392,10 +415,11 @@ FUNCTION {field.or.null}
if$
}
+% italic correction should not be added before period or comma, so use \emph.
FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
- { "{\em " swap$ * "}" * }
+ { "\emph{" swap$ * "}" * }
if$
}
@@ -567,6 +591,15 @@ FUNCTION {format.date}
if$
}
+% output the date field, instead of using month/year.
+FUNCTION {format.date.direct}
+{ date empty$
+ {""}
+ { date }
+ if$
+}
+
+
FUNCTION {format.btitle}
{ title emphasize
}
@@ -753,7 +786,7 @@ FUNCTION {format.article.crossref}
warning$
""
}
- { "In {\em " journal * "\/}" * }
+ { "In \emph{" journal * "}" * }
if$
}
{ "In " key * }
@@ -796,7 +829,7 @@ FUNCTION {format.book.crossref}
crossref * warning$
"" *
}
- { "{\em " * series * "\/}" * }
+ { "\emph{" * series * "}" * }
if$
}
{ key * }
@@ -817,7 +850,7 @@ FUNCTION {format.incoll.inproc.crossref}
crossref * warning$
""
}
- { "In {\em " booktitle * "\/}" * }
+ { "In \emph{" booktitle * "}" * }
if$
}
{ "In " key * }
@@ -880,6 +913,23 @@ FUNCTION {format.url}
if$
}
+FUNCTION {format.urldate}
+{ urldate empty$
+ {""}
+% {'skip$}
+ {"last visited: " urldate *}
+ if$
+}
+
+FUNCTION {format.version}
+{ version empty$
+ {""}
+ {"version " version * }
+ if$
+}
+
+
+
FUNCTION {format.eprint}
{ eprint empty$
{ "" }
@@ -1337,6 +1387,32 @@ FUNCTION {unpublished}
fin.entry
}
+% original for ctan entry:
+%{ output.bibitem
+% format.authors output
+% author add.colon
+% format.title output
+% format.version output
+% note output
+% format.longdate output
+% format.url output
+% format.urldate output
+% fin.entry.original
+%}
+
+% don't like printing urldates; and url is better last. Break up entry.
+FUNCTION {ctan}
+{ output.bibitem
+ format.authors "author" output.check
+ new.block
+ format.title "title" output.check
+ format.version output
+ format.date.direct "date" output.check
+ new.block
+ note "note" output.check
+ fin.entry
+}
+
FUNCTION {default.type} { misc }
MACRO {jan} {"Jan."}