summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx157
1 files changed, 123 insertions, 34 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx b/macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx
index 2db1e18a32..780f797327 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-oxref/oxref.dtx
@@ -1,6 +1,6 @@
% \iffalse
%<*internal|bbx|cbx|dbx|lbx|doc>
-\def\Version{2019/09/02 v1.2}
+\def\Version{2019/09/20 v2.0}
%</internal|bbx|cbx|dbx|lbx|doc>
%<*internal>
\iffalse
@@ -2827,45 +2827,41 @@ Where the publisher changed between volumes, the following form is used:
all in \S13.11.1). I am therefore choosing to ignore this unnecessary
complication.}
-%</n|m|a|y>
-%<*n|m>
-\tip{You can alternatively use the standard \textsf{biblatex} relation type \code{multivolume}. Note that this construction is not portable to \textsf{oxyear}\slash\textsf{oxalph}.}
+\tip{You can alternatively use the standard \textsf{biblatex} relation type \code{multivolume}.
+%<n|m>Note that when you do so, the overall date is removed, so be sure that individual volume dates are provided.
+}
\begin{bibexbox}
-<OGS \S15.2.6*>
-{ritter1838hap1-3}
-Heinrich Ritter, \emph{The History of Ancient Philosophy}, trans. Alexander J. W. Morrison, 4~vols., i–iii (Oxford: Talboys, 1838–9), iv (London: Bohn, 1846).
+%<n|m><OGS \S15.2.6*>
+%<a|y><OGS \S15.2.6*\textdagger>
+{ritter1838hap:mv}
+%<n|m>Heinrich Ritter, \emph{The History of Ancient Philosophy}, trans. Alexander J. W. Morrison, 4~vols., i–iii (Oxford: Talboys, 1838–9), iv (London: Bohn, 1846).
+%<a|y>Ritter, H (1838-46). \emph{The History of Ancient Philosophy}, trans. A. J. W. Morrison, 4~vols., i–iii (Oxford: Talboys, 1838–9), iv (London: Bohn, 1846).
\tcblower
\begin{Verbatim}
-%</n|m>
-%<*n|m|bib>
-@mvbook{ritter1838hap1-3,
+%</n|m|a|y>
+@mvbook{ritter1838hap:mv,
author = {Heinrich Ritter},
title = {The History of Ancient Philosophy},
translator = {Alexander J. W. Morrison},
volumes = {4},
+ date = {1838/1846},
+ related = {ritter1838hap1-3,ritter1838hap4},
+ relatedtype = {multivolume}}
+@book{ritter1838hap1-3,
volume = {1-3},
location = {Oxford},
publisher = {Talboys},
- date = {1838/1839},
- related = {ritter1838hap4},
- relatedtype = {multivolume}}
-@mvbook{ritter1838hap4,
- author = {Heinrich Ritter},
- title = {The History of Ancient Philosophy},
- translator = {Alexander J. W. Morrison},
- volumes = {4},
+ date = {1838/1839}}
+@book{ritter1838hap4,
volume = {4},
location = {London},
publisher = {Bohn},
date = {1846}}
-%</n|m|bib>
-%<*n|m>
+%<*n|m|a|y>
\end{Verbatim}
\end{bibexbox}
-%</n|m>
-%<*n|m|a|y>
\subsection{One volume from several}
Where the volumes are merely numbered, the following form is used:
@@ -7737,7 +7733,6 @@ will trigger the use of parentheses.
%
% \begin{macrocode}
\newbibmacro*{bookeditor}{%
- \global\undef\bbx@lasthash
\ifboolexpr{
test \ifuseeditor
and
@@ -8579,7 +8574,9 @@ will trigger the use of parentheses.
% \end{macrocode}
%
% Volume numbers in monograph-style entries are formatted as roman
-% numerals.
+% numerals (if they are indeed numbers). We take some care here to support
+% simple ranges (e.g.\@ 1-3, 4--9). Support for more complex ranges may be
+% considered on request.
%
% \begin{macrocode}
\DeclareFieldFormat[book,mvbook,bookinbook,inbook,suppbook,%
@@ -8589,11 +8586,11 @@ reference,mvreference,inreference]{volume}{%
\IfSubStr{#1}{-}{%
\StrCount{#1}{-}[\blx@ox@dashnum]%
\StrBefore{#1}{-}[\blx@ox@volnum]%
- \Rn{\blx@ox@volnum}\bibrangedash
+ \expandafter\ifinteger\blx@ox@volnum{\Rn{\blx@ox@volnum}}{\blx@ox@volnum}\bibrangedash
\StrBehind[\blx@ox@dashnum]{#1}{-}[\blx@ox@volnum]%
- \Rn{\blx@ox@volnum}%
+ \expandafter\ifinteger\blx@ox@volnum{\Rn{\blx@ox@volnum}}{\blx@ox@volnum}%
}{%
- \Rn{#1}}}
+ \ifinteger{#1}{\Rn{#1}}{#1}}}
% \end{macrocode}
%
% Where a multi-volume work is more like a series, the volume number and
@@ -9996,7 +9993,7 @@ reference,mvreference,inreference]{volume}{%
% \end{macrocode}
%
% Direct use of the |manual| entry type is not encouraged, but it serves as a
-% basis for other entry types, notably standards, datasets, and software.
+% basis for other entry types, notably standards, and software.
% The main change to the |manual| driver compared to the standard style is
% that |type|, |series|, |number|, |edition| and |organization| are moved into
% the publication information block with |publisher|, |location| and |date|.
@@ -10570,10 +10567,43 @@ reference,mvreference,inreference]{volume}{%
%
% \subsubsection{Datasets}
%
-% Datasets are currently treated like manuals
+% The main change to the |dataset| driver compared to the standard style is
+% that |type|, |series|, |number|, |edition| and |organization| are moved into
+% the publication information block with |publisher|, |location| and |date|.
%
% \begin{macrocode}
-\DeclareBibliographyAlias{dataset}{manual}
+\DeclareBibliographyDriver{dataset}{%
+ \usebibmacro{bibindex}%
+ \usebibmacro{begentry}%
+ \usebibmacro{author/editor+others/translator+others}%
+ \setunit{\printdelim{nametitledelim}}\newblock
+ \usebibmacro{title}%
+ \newunit
+ \printlist{language}%
+ \setunit{\titlebyauthordelim}\newblock
+ \usebibmacro{byauthor}%
+ \newunit\newblock
+ \usebibmacro{byeditor+others}%
+ \newunit\newblock
+ \printfield{type}%
+ \newunit
+ \printfield{version}%
+ \newunit\newblock
+ \printfield{note}%
+ \newunit\newblock
+ \usebibmacro{type+series+number+edition+organization+publisher+location+date}%
+ \newunit\newblock
+ \usebibmacro{doi+eprint+url}%
+ \newunit\newblock
+ \usebibmacro{addendum+pubstate}%
+ \setunit{\bibpagerefpunct}\newblock
+ \usebibmacro{pageref}%
+ \newunit\newblock
+ \iftoggle{bbx:related}
+ {\usebibmacro{related:init}%
+ \usebibmacro{related}}
+ {}%
+ \usebibmacro{finentry}}
% \end{macrocode}
%
% \subsection{Legal references}
@@ -11894,7 +11924,8 @@ reference,mvreference,inreference]{volume}{%
\iffieldequalstr{relatedtype}{multivolume}{%
\setunit{\addcomma\space}}{}%
}}{}{\wlog{WARNING: biblatex-oxref failed to append to begrelated}}
-\renewcommand*{\begrelateddelimmultivolume}{\newunitpunct}
+\DeclareDelimFormat{relateddelimmultivolume}{\newunitpunct}
+\DeclareDelimFormat{begrelateddelimmultivolume}{\newunitpunct}
% \end{macrocode}
%
@@ -12088,9 +12119,23 @@ reference,mvreference,inreference]{volume}{%
\entrydata*{#1}{%
\printtext{%
\printfield{volume}%
- \printfield{part}}%
+ \printfield{part}%
+ \iffieldsequal{savedtitle}{title}{}{%
+ \setunit{\addcolon\space}%
+ \usebibmacro{title}}%
+ }%
\setunit*{\addspace}%
- \usebibmacro{series+number+edition+publisher+location+date}}}
+ \iffieldsequal{savedseries}{series}{\clearfield{series}}{}%
+ \iffieldsequal{savednumber}{number}{\clearfield{number}}{}%
+ \iffieldsequal{savededition}{edition}{\clearfield{edition}}{}%
+ \ifboolexpr{
+ test {\iflistsequal{savedpublisher}{publisher}}
+ and
+ test {\iflistsequal{savedlocation}{location}}
+ }{\clearlist{publisher}\clearlist{location}}{}%
+ \iffieldsequal{saveddate}{date}{\clearfield{date}}{}%
+ \usebibmacro{series+number+edition+publisher+location+date}%
+ }}
% \end{macrocode}
%
@@ -12652,6 +12697,8 @@ reference,mvreference,inreference]{volume}{%
\RequireBibliographyStyle{oxref}
% \end{macrocode}
%
+% \subsection{Names}
+%
% We apply our special name format to names likely to appear at the start of
% an entry.
%
@@ -12676,6 +12723,19 @@ reference,mvreference,inreference]{volume}{%
}{}{\wlog{WARNING: biblatex-oxref (oxnotes) failed to patch author}}
% \end{macrocode}
%
+% \subsection{Multivolume dates}
+%
+% For the very particular use case of breaking down multivolume works into
+% their constituent volumes, we remove the overall date, assuming that the
+% individual volume dates will be used instead.
+%
+% \begin{macrocode}
+\xpretobibmacro{series+number+edition+publisher+location+date}{%
+ \iffieldequalstr{relatedtype}{multivolume}{%
+ \clearfield{year}\clearfield{month}\clearfield{day}%
+ }{}}{}{}
+% \end{macrocode}
+%
% \subsection{Source maps}
%
% \begin{macrocode}
@@ -12728,6 +12788,8 @@ reference,mvreference,inreference]{volume}{%
\RequireBibliographyStyle{oxref}
% \end{macrocode}
%
+% \subsection{Names}
+%
% We apply our special name format to names likely to appear at the start of
% an entry.
%
@@ -12752,6 +12814,19 @@ reference,mvreference,inreference]{volume}{%
}{}{\wlog{WARNING: biblatex-oxref (oxnum) failed to patch author}}
% \end{macrocode}
%
+% \subsection{Multivolume dates}
+%
+% For the very particular use case of breaking down multivolume works into
+% their constituent volumes, we remove the overall date, assuming that the
+% individual volume dates will be used instead.
+%
+% \begin{macrocode}
+\xpretobibmacro{series+number+edition+publisher+location+date}{%
+ \iffieldequalstr{relatedtype}{multivolume}{%
+ \clearfield{year}\clearfield{month}\clearfield{day}%
+ }{}}{}{}
+% \end{macrocode}
+%
% \subsection{Label numbers}
%
% This next code is extracted from the standard |numeric| style.
@@ -13602,6 +13677,20 @@ reference,mvreference,inreference]{volume}{%
%
% \subsection{Manuscripts}
%
+% Since we clear the title, we need a more sophisticated test for whether to
+% suppress the date.
+%
+% \begin{macrocode}
+\renewbibmacro{manuscript:date}{%
+ \ifboolexpr{
+ test {\ifnameundef{author}}
+ and
+ not togl {blx@ox@clearedtitle}
+ and
+ test {\iffieldundef{label}}
+ }{}{\usebibmacro{date}}}
+% \end{macrocode}
+%
% We include the |library| field as a fallback title.
%
% \begin{macrocode}
@@ -13915,7 +14004,7 @@ reference,mvreference,inreference]{volume}{%
% option.
%
% \begin{macrocode}
-\newbibmacro*{cite:labeldate+extradate}{%
+\renewbibmacro*{cite:labeldate+extradate}{%
\ifboolexpr{
test {\iffieldundef{labelyear}}
or