summaryrefslogtreecommitdiff
path: root/biblio/bibtex/contrib/bath-bst/bath-bst.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'biblio/bibtex/contrib/bath-bst/bath-bst.dtx')
-rw-r--r--biblio/bibtex/contrib/bath-bst/bath-bst.dtx359
1 files changed, 293 insertions, 66 deletions
diff --git a/biblio/bibtex/contrib/bath-bst/bath-bst.dtx b/biblio/bibtex/contrib/bath-bst/bath-bst.dtx
index 18e1beb4f6..1f7e5e6317 100644
--- a/biblio/bibtex/contrib/bath-bst/bath-bst.dtx
+++ b/biblio/bibtex/contrib/bath-bst/bath-bst.dtx
@@ -39,7 +39,7 @@ See: http://www.latex-project.org/lppl.txt
\endpreamble
\postamble
-Copyright (C) 2020 by University of Bath
+Copyright (C) 2016-2021 by University of Bath
\endpostamble
\usedir{bibtex/bst/\jobname}
@@ -74,7 +74,7 @@ Copyright (C) 2020 by University of Bath
\ProvidesFile{bath-bst.dtx}
%</driver>
%<*driver|tex1>
- [2020/01/16 v3.2 Harvard referencing style as recommended by the University of Bath Library]
+ [2021/02/25 v4.0 Harvard referencing style as recommended by the University of Bath Library]
\documentclass[10pt,a4paper]{article}
\usepackage[british]{babel}
@@ -445,9 +445,10 @@ documentation.
2. Compile `bath-bst.dtx` with [LuaLaTeX] and BibTeX to generate the
documentation. You will need, among other things, the [luatexja],
- [adobemapping] and [ipaex] packages installed; this is just for the
- documentation, not for the BibTeX style itself. To generate the version 1
- tests and documentation, compile `bath-bst-v1.tex` with LuaLaTeX and BibTeX.
+ [adobemapping], [ipaex] and [haranoaji] packages installed; this is just for
+ the documentation, not for the BibTeX style itself. To generate the version
+ 1 tests and documentation, compile `bath-bst-v1.tex` with LuaLaTeX and
+ BibTeX.
3. If you are using TeX Live, find your home TeX tree using the following
command at the command prompt/terminal:
@@ -485,6 +486,7 @@ documentation.
[luatexja]: http://ctan.org/pkg/luatexja
[adobemapping]: http://ctan.org/pkg/adobemapping
[ipaex]: http://ctan.org/pkg/ipaex
+[haranoaji]: http://ctan.org/pkg/haranoaji
%</driver|readme>
%<*driver>
\end{markdown*}
@@ -704,6 +706,10 @@ though of course any item might need adjustment to take account of differing con
\end{Verbatim}
\end{bibexbox}
+\begin{info}\item
+Internally, \texttt{collection} is an alias for \texttt{book}.
+\end{info}
+
\subsubsection*{Electronic book}
@@ -781,6 +787,97 @@ though of course any item might need adjustment to take account of differing con
\end{bibexbox}
+\subsubsection*{Book known by its title}
+
+\begin{info}\item
+Unfortunately, to avoid breaking other use cases for the \texttt{book} entry
+type, to achieve the following format you must use the non-standard
+\texttt{reference} entry type.
+\end{info}
+
+\begin{bibexbox}<RX>{bnf2020}
+ British National Formulary, 2020. 79th ed. London: Pharmaceutical Press.
+ \tcblower
+\begin{Verbatim}
+%</driver|tex1>
+%<*driver|bib|tex1|bib1>
+@reference{bnf2020,
+ year = {2020},
+ title = {{British National Formulary}},
+ edition = {79},
+ address = {London},
+ publisher = {Pharmaceutical Press}}
+%</driver|bib|tex1|bib1>
+%<*driver|tex1>
+\end{Verbatim}
+\end{bibexbox}
+
+\begin{info}\item
+Similarly, to achieve the following formats you must use the non-standard
+\texttt{inreference} entry type.
+\end{info}
+
+\begin{bibexbox}<RX>{asprin2020bnf}
+ British National Formulary, 2020. 79th ed. \emph{Asprin.} London: Pharmaceutical Press.
+ \tcblower
+\begin{Verbatim}
+%</driver|tex1>
+%<*driver|bib|tex1|bib1>
+@inreference{asprin2020bnf,
+ title = {Asprin},
+ year = {2020},
+ booktitle = {{British National Formulary}},
+ edition = {79},
+ address = {London},
+ publisher = {Pharmaceutical Press}}
+%</driver|bib|tex1|bib1>
+%<*driver|tex1>
+\end{Verbatim}
+\end{bibexbox}
+
+\begin{bibexbox}<RX>{asprin2019bnf}
+ British National Formulary, 2019. \emph{Aspirin} [Online]. London: Pharmaceutical Press. Available from: \url{https://www.medicinescomplete.com/\#/content/bnf/_456850132} [Accessed 26 November 2019].
+ \tcblower
+\begin{Verbatim}
+%</driver|tex1>
+%<*driver|bib>
+@inreference{asprin2019bnf,
+ title = {Asprin},
+ year = {2019},
+ booktitle = {{British National Formulary}},
+ address = {London},
+ publisher = {Pharmaceutical Press},
+ url = {https://www.medicinescomplete.com/\#/content/bnf/_456850132},
+ urlyear = {26 November 2019}}
+%</driver|bib>
+%<*driver>
+\end{Verbatim}
+\iffalse
+%</driver>
+%<*tex1|bib1>
+@inreference{asprin2019bnf,
+ title = {Asprin},
+ year = {2019},
+ booktitle = {{British National Formulary \textup{[Online]}}},
+ address = {London},
+ publisher = {Pharmaceutical Press},
+ url = {https://www.medicinescomplete.com/\#/content/bnf/_456850132},
+ urldate = {26 November 2019}}
+%</tex1|bib1>
+%<*driver|tex1>
+\end{Verbatim}
+%<*driver>
+\fi
+%</driver>
+\end{bibexbox}
+
+\begin{info}\item
+Internally, \texttt{inreference} is an alias for \texttt{incollection}.
+%<driver>Use \texttt{inreference} if you need compatibility with \textsf{biblatex-bath}.
+\end{info}
+
+\citet{bnf2020}, \cite{asprin2019bnf}, \citet{asprin2020bnf}.
+
\subsubsection*{One chapter\slash paper from a collection (by different authors) in an edited book}
\begin{bibexbox}<RL>{burchard1965hhl}
@@ -1563,6 +1660,42 @@ but the \texttt{organization} field if the location relates to the archive.
\begin{tips}\item The \texttt{book} entry type would also work for this reference.\end{tips}
+\begin{bibexbox}<RX>{os2020bath}
+ Ordnance Survey, 2020. \emph{Street view map of University of Bath} [Online], 1:5000, OS VectorMap® Local. Available from: \url{https://digimap.edina.ac.uk/roam/map/os} [Accessed 30 April 2020].
+ \tcblower
+\begin{Verbatim}
+%</driver|tex1>
+%<*driver|bib|tex1|bib1>
+@manual{os2020bath,
+ author = {{Ordnance Survey}},
+ year = {2020},
+ title = {Street view map of {University of Bath}},
+ series = {1:5000, OS VectorMap® Local},
+ url = {https://digimap.edina.ac.uk/roam/map/os},
+ urlyear = {30 April 2020}}
+%</driver|bib|tex1|bib1>
+%<*driver|tex1>
+\end{Verbatim}
+\end{bibexbox}
+
+\begin{bibexbox}<RX>{google2020harbourside}
+ Google, 2020. \emph{Harbourside, Bristol} [Online], Google Maps. Available from: \url{https://www.google.co.uk/maps/place/Harbourside,+Bristol/} [Accessed 30 April 2020].
+ \tcblower
+\begin{Verbatim}
+%</driver|tex1>
+%<*driver|bib|tex1|bib1>
+@manual{google2020harbourside,
+ author = {{Google}},
+ year = {2020},
+ title = {{Harbourside, Bristol}},
+ series = {Google Maps},
+ url = {https://www.google.co.uk/maps/place/Harbourside,+Bristol/},
+ urldate = {2020-04-30}}
+%</driver|bib|tex1|bib1>
+%<*driver|tex1>
+\end{Verbatim}
+\end{bibexbox}
+
\subsubsection*{Film, video or DVD}
@@ -2780,7 +2913,7 @@ Commission case number, \texttt{number} for the formal decision number, and give
%<readme>## Licence
%<readme>
%<*driver|readme>
-Copyright 2016-2020 University of Bath.
+Copyright 2016-2021 University of Bath.
This work consists of the documented LaTeX file bath-bst.dtx and a Makefile.
@@ -3210,17 +3343,13 @@ FUNCTION {either.or.check}
%
% \begin{macrocode}
FUNCTION {is.online}
-{ type$ "software" =
- { #0 }
- { url empty$ doi empty$ and
- { type$ "online" =
- { #1 }
- { #0 }
- if$
- }
+{ url empty$ doi empty$ and
+ { type$ "online" =
{ #1 }
+ { #0 }
if$
}
+ { #1 }
if$
}
% \end{macrocode}
@@ -3235,6 +3364,9 @@ FUNCTION {is.online}
FUNCTION {bbl.and}
{ "and"}
+FUNCTION {bbl.byeditor}
+{ "Ed. by" }
+
FUNCTION {bbl.etal}
{ "et~al." }
@@ -3499,6 +3631,19 @@ FUNCTION {format.authors}
}
% \end{macrocode}
%
+% |format.byeditors| returns editor names, and prepended by `Ed. by'.
+%
+% \begin{macrocode}
+FUNCTION {format.byeditors}
+{ editor "editor" format.names.ed duplicate$ empty$ 'skip$
+ { bbl.byeditor
+ " " *
+ swap$ *
+ }
+ if$
+}
+% \end{macrocode}
+%
% |format.editors| returns editor names, and appends `ed.' or `eds' as
% appropriate.
%
@@ -3673,8 +3818,8 @@ FUNCTION {output.bibitem}
%
% |format.key| takes a field (author or editor). If the field is empty, it
% replaces it with the key field (if not non-null). Otherwise, replaces it with
-% an empty string. It is used as a last resort to stop an entry beginning with
-% the date.
+% an empty string. It is used as an extra defence against an entry beginning
+% with the date.
%
% \begin{macrocode}
FUNCTION {format.key}
@@ -3688,7 +3833,7 @@ FUNCTION {format.key}
% \subsection{Titles}
%
% |select.language| checks if the field before was written out, and if so,
-% wraps |{\selectlanguage{language}\dots}| around it.
+% wraps |{\selectlanguage{language}|\dots|}| around it.
%
% \begin{macrocode}
FUNCTION {select.language}
@@ -3775,23 +3920,31 @@ FUNCTION {get.title.addenda}
format.titleaddon output
continue.clause
%<*bst2>
- library empty$
- type$ "image" =
- or
is.online
- and
journal empty$
and
- type empty$
- type$ "booklet" = not
- type$ "audio" = not
- and
- type$ "video" = not
- and
- type$ "music" = not
- and
- type$ "movie" = not
- and
+ booktitle empty$
+ type$ "inreference" =
+ author empty$
+ and
+ or
+ and
+ library empty$
+ type$ "image" =
+ or
+ and
+ type$ "software" = not
+ and
+ type empty$
+ type$ "booklet" = not
+ type$ "audio" = not
+ and
+ type$ "video" = not
+ and
+ type$ "music" = not
+ and
+ type$ "movie" = not
+ and
or
and
{ bbl.online output }
@@ -3799,6 +3952,10 @@ FUNCTION {get.title.addenda}
if$
continue.clause
%</bst2>
+ type$ "reference" =
+ { format.byeditors output }
+ 'skip$
+ if$
format.translators output
}
% \end{macrocode}
@@ -3812,15 +3969,23 @@ FUNCTION {word.in}
" " * }
% \end{macrocode}
%
-% |format.booktitle| returns the booktitle field in italics.
+% |format.label.booktitle| returns the booktitle field upright
%
% \begin{macrocode}
-FUNCTION {format.booktitle}
+FUNCTION {format.label.booktitle}
{ booktitle
duplicate$ empty$ 'skip$
{ "t" change.case$ }
if$
"booktitle" bibinfo.check
+}
+% \end{macrocode}
+%
+% |format.booktitle| returns the booktitle field in italics.
+%
+% \begin{macrocode}
+FUNCTION {format.booktitle}
+{ format.label.booktitle
emphasize
}
% \end{macrocode}
@@ -3830,8 +3995,19 @@ FUNCTION {format.booktitle}
%
% \begin{macrocode}
FUNCTION {format.in.ed.booktitle}
-{ format.booktitle duplicate$ empty$ 'skip$
- { editor "editor" format.names.ed duplicate$ empty$ 'pop$
+{ format.booktitle
+ duplicate$ empty$
+ 'skip$
+ {
+%<*bst2>
+ is.online
+ { " " *
+ bbl.online *
+ }
+ 'skip$
+ if$
+%</bst2>
+ editor "editor" format.names.ed duplicate$ empty$ 'pop$
{ "," *
" " *
get.bbl.editor add.period$
@@ -4970,13 +5146,17 @@ FUNCTION {book}
{ output.bibitem
author empty$
{ editor empty$
- { format.btitle "title" output.check
+ type$ "reference" =
+ or
+ { type$ "reference" =
+ { format.title "title" output.check }
+ { format.btitle "title" output.check }
+ if$
format.date "year" output.check
year empty$ 'skip$ { date.block } if$
get.title.addenda
}
{ format.editors "author and editor" output.check
- editor format.key output
format.date "year" output.check
date.block
format.btitle "title" output.check
@@ -5072,6 +5252,8 @@ FUNCTION {inbook}
date.block
format.btitle "title" output.check
get.title.addenda
+ new.block
+ format.edition output
crossref missing$
{ format.publisher.address output
format.bvolume output
@@ -5085,7 +5267,6 @@ FUNCTION {inbook}
format.book.crossref output.nonnull
}
if$
- format.edition output
new.block
format.note output
new.block
@@ -5100,22 +5281,49 @@ FUNCTION {inbook}
% \begin{macrocode}
FUNCTION {incollection}
{ output.bibitem
- format.authors "author" output.check
- author format.key output
- format.date "year" output.check
- date.block
- format.title "title" output.check
- get.title.addenda
+ author empty$
+ { type$ "inreference" =
+ { format.label.booktitle output }
+ { format.title "title" output.check }
+ if$
+ format.date "year" output.check
+ year empty$ 'skip$ { date.block } if$
+ type$ "inreference" =
+ 'skip$
+ { get.title.addenda }
+ if$
+ }
+ { format.authors output.nonnull
+ format.date "year" output.check
+ date.block
+ format.title "title" output.check
+ get.title.addenda
+ }
+ if$
new.block
crossref missing$
- { format.in.ed.booktitle "booktitle" output.check
+ { type$ "inreference" =
+ author empty$
+ and
+ { format.byeditors output }
+ { format.in.ed.booktitle "booktitle" output.check }
+ if$
new.block
+ format.edition output
+ new.block
+ type$ "inreference" =
+ author empty$
+ and
+ { format.btitle "title" output.check
+ get.title.addenda
+ new.block
+ }
+ 'skip$
+ if$
format.publisher.address output
format.bvolume output
format.number.series output
format.chapter.pages output
- new.sentence
- format.edition output
}
{ format.incoll.inproc.crossref output.nonnull
format.chapter.pages output
@@ -5593,6 +5801,9 @@ FUNCTION {letter}
'article
if$
}
+FUNCTION {collection} { book }
+FUNCTION {reference} { book }
+FUNCTION {inreference} { incollection }
FUNCTION {audio} { booklet }
FUNCTION {movie} { booklet }
FUNCTION {music} { booklet }
@@ -5755,18 +5966,28 @@ FUNCTION {editor.key.label}
FUNCTION {author.key.label}
{ author empty$
{ key empty$
- { title empty$
- { cite$ #1 #3 substring$ }
- { title
- type$ "article" =
- type$ "incollection" =
- or
- type$ "inproceedings" =
- or
- type$ "misc" =
- or
- 'skip$
- { emphasize }
+ { type$ "inreference" =
+ booktitle empty$ not
+ and
+ { booktitle }
+ { title empty$
+ { cite$ #1 #3 substring$ }
+ { title
+ type$ "article" =
+ type$ "incollection" =
+ or
+ type$ "inproceedings" =
+ or
+ type$ "reference" =
+ author empty$
+ and
+ or
+ type$ "misc" =
+ or
+ 'skip$
+ { emphasize }
+ if$
+ }
if$
}
if$
@@ -5919,15 +6140,21 @@ FUNCTION {editor.sort}
% \begin{macrocode}
FUNCTION {author.sort}
{ author empty$
- { title empty$
- { key empty$
- { "to sort, need author, title, or key in " cite$ * warning$
- ""
+ { type$ "inreference" =
+ booktitle empty$ not
+ and
+ { booktitle sort.format.title }
+ { title empty$
+ { key empty$
+ { "to sort, need author, title, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
}
- { key sortify }
+ { title sort.format.title }
if$
}
- { title sort.format.title }
if$
}
{ author sort.format.names }
@@ -6035,7 +6262,7 @@ FUNCTION {reverse.pass}
%
% Applying these functions is a bit more tricky, but once we have done that,
% we re-sort the entries to make absolutely sure they in the right order,
-% this time wih the year between with |sort.label| and the title.
+% this time with the year between with |sort.label| and the title.
%
% \begin{macrocode}
EXECUTE {initialize.extra.label.stuff}