%% %% This is file `oxyear.bbx', %% generated with the docstrip utility. %% %% The original source files were: %% %% oxref.dtx (with options: `bbx,y') %% ---------------------------------------------------------------- %% biblatex-oxref --- Biblatex styles inspired by the Oxford Guide to Style %% Author: Alex Ball %% E-mail: a.j.ball@bath.ac.uk %% License: Released under the LaTeX Project Public License v1.3c or later %% See: http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- %% \def\Version{2017/05/14 v0.10} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesFile{oxyear.bbx} [\Version\space Author-year bibliography style inspired by the Oxford Guide to Style] \RequireBibliographyStyle{oxref} \ExecuteBibliographyOptions{uniquename=init,giveninits,labeldateparts,sorting=nyt,pagetracker,maxcitenames=2} \DeclareBibliographyOption{mergedate}[true]{% \ifcsdef{bbx@opt@mergedate@#1} {\csuse{bbx@opt@mergedate@#1}} {\PackageError{biblatex} {Invalid option 'mergedate=#1'} {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak 'year', 'true' (=year), and 'false'.}}} \providebibmacro*{date+extrayear}{} \DeclareFieldFormat{datelabel}{\mkbibparens{#1}} \newbibmacro*{labelyearrange}{% \printfield{labelyear}% \printfield{extrayear}% \iffieldundef{labelendyear}{}{% \iffieldsequal{labelyear}{labelendyear}{}{% \iffieldequalstr{labelendyear}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \iffieldundef{extrayear}{% \blx@ox@compyear {\thefield{labelyear}}% {\thefield{labelendyear}}% }{% \printfield{labelendyear}}}}}} \def\bbx@opt@mergedate@true{\bbx@opt@mergedate@year} \def\bbx@opt@mergedate@maximum{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \printfield{issue}% \setunit*{\addspace}% \ifboolexpr{% not test {\iffieldundef{\thefield{labeldatesource}year}} and test {\iffieldsequal{\thefield{labeldatesource}year}{labelyear}} }{% \printlabeldateextra }{% \printfield{labelyear}% \printfield{extrayear}}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}% }{% \clearfield{\thefield{labeldatesource}year}% \clearfield{end\thefield{labeldatesource}year}% \clearfield{\thefield{labeldatesource}month}% \clearfield{end\thefield{labeldatesource}month}% \clearfield{\thefield{labeldatesource}day}% \clearfield{end\thefield{labeldatesource}day}% }% \clearfield{issue}}}}% \def\bbx@opt@mergedate@compact{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \ifboolexpr{% not test {\iffieldundef{\thefield{labeldatesource}year}} and test {\iffieldsequal{\thefield{labeldatesource}year}{labelyear}} }{% \printlabeldateextra }{% \printfield{labelyear}% \printfield{extrayear}}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}% }{% \clearfield{\thefield{labeldatesource}year}% \clearfield{end\thefield{labeldatesource}year}% \clearfield{\thefield{labeldatesource}month}% \clearfield{end\thefield{labeldatesource}month}% \clearfield{\thefield{labeldatesource}day}% \clearfield{end\thefield{labeldatesource}day}% }}}} \def\bbx@opt@mergedate@year{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \usebibmacro{labelyearrange}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}% }{% \clearfield{\thefield{labeldatesource}year}% \clearfield{end\thefield{labeldatesource}year}% }}}} \def\bbx@opt@mergedate@basic{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \usebibmacro{labelyearrange}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}% }{% \ifboolexpr{ test {\iffieldundef{\thefield{labeldatesource}month}} and ( test {\iffieldundef{issue}} or not test {\iffieldequalstr{labeldatesource}{}} )}{% \clearfield{\thefield{labeldatesource}year}% \clearfield{end\thefield{labeldatesource}year}% }{}}}}}% \def\bbx@opt@mergedate@minimum{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \usebibmacro{labelyearrange}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}% }{% \ifboolexpr{ test {\iffieldundef{\thefield{labeldatesource}month}} and test {\iffieldundef{extrayear}} and ( test {\iffieldundef{issue}} or not test {\iffieldequalstr{labeldatesource}{}} )}{% \clearfield{\thefield{labeldatesource}year}% \clearfield{end\thefield{labeldatesource}year}% }{}}}}}% \def\bbx@opt@mergedate@false{% \renewbibmacro*{date+extrayear}{% \iffieldundef{labelyear}{}{% \printtext[datelabel]{% \usebibmacro{labelyearrange}}}}% \iffieldundef{\thefield{labeldatesource}year}{% \iffieldundef{\thefield{labeldatesource}}{}{% \iffieldequalstr{labeldatesource}{pubstate}{}{% \clearfield{\thefield{labeldatesource}}}}}{}} \ExecuteBibliographyOptions{mergedate} \DeclareRobustCommand*{\mkdaterangefull}[2]{% \blx@metadateinfo{#2}% \iffieldundef{#2year}{% \iffieldundef{#2month}{}{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2month}{#2day}% \blx@printtime{#2}{}% }{% \csuse{mkbibseasondate#1}{}{#2season}}% \dateuncertainprint \iffieldundef{#2endmonth}{}{% \iffieldequalstr{#2endmonth}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2endmonth}{#2endday}% \blx@printtime{#2}{end}% }{% \csuse{mkbibseasondate#1}{}{#2endseason}}% \enddateuncertainprint}}}}% }{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \csuse{mkbibdate#1}{#2year}{#2month}{#2day}% \blx@printtime{#2}{}% }{% \csuse{mkbibseasondate#1}{#2year}{#2season}}% \dateuncertainprint \dateeraprint{#2year}% \iffieldundef{#2endyear}{}{% \iffieldequalstr{#2endyear}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}% \blx@printtime{#2}{end}% }{% \csuse{mkbibseasondate#1}{#2endyear}{#2endseason}}% \enddateuncertainprint \dateeraprint{#2endyear}}}}}} \DeclareRobustCommand*{\mkdaterangetrunc}[2]{% \blx@metadateinfo{#2}% \iffieldundef{#2year}{% \iffieldundef{#2month}{}{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \ifboolexpr{ test {\iffieldsequal{labelyear}{labelendyear}} and test {\iffieldsequal{#2month}{#2endmonth}} }{% \csuse{mkbibdate#1}{}{}{#2day}% }{% \csuse{mkbibdate#1}{}{#2month}{#2day}}% }{% \csuse{mkbibseasondate#1}{}{#2season}}% \dateuncertainprint \iffieldundef{#2endmonth}{}{% \iffieldequalstr{#2endmonth}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2endmonth}{#2endday}% }{% \csuse{mkbibseasondate#1}{}{#2endseason}}% \enddateuncertainprint}}}}% }{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \iffieldsequal{#2year}{#2endyear}{% \iffieldsequal{#2month}{#2endmonth}{% \csuse{mkbibdate#1}{}{}{#2day}% }{% \csuse{mkbibdate#1}{}{#2month}{#2day}}% }{% \csuse{mkbibdate#1}{#2year}{#2month}{#2day}% \iffieldsequal{#2dateera}{#2enddateera}{}{% \dateeraprint{#2year}}}% }{% \iffieldsequal{#2year}{#2endyear}{% \csuse{mkbibseasondate#1}{}{#2season}% }{% \csuse{mkbibseasondate#1}{#2year}{#2season}% \iffieldsequal{#2dateera}{#2enddateera}{}{% \dateeraprint{#2year}}}}% \dateuncertainprint \iffieldundef{#2endyear}{}{% \iffieldequalstr{#2endyear}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \iffieldundef{#2endmonth}{% \blx@ox@compyear{\thefield{#2year}}{\thefield{#2endyear}}% }{% \csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}}% }{% \csuse{mkbibseasondate#1}{#2endyear}{#2endseason}}% \enddateuncertainprint \dateeraprint{#2endyear}}}}}} \DeclareRobustCommand*{\mkdaterangefullextra}[2]{% \blx@metadateinfo{#2}% \iffieldundef{#2year}{% \iffieldundef{#2month}{}{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2month}{#2day}% \blx@printtime{#2}{}% }{% \csuse{mkbibseasondate#1}{}{#2season}}% \dateuncertainprint \iffieldundef{#2endmonth}{}{% \iffieldequalstr{#2endmonth}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2endmonth}{#2endday}% \blx@printtime{#2}{end}% }{% \csuse{mkbibseasondate#1}{}{#2endseason}}% \enddateuncertainprint}}}}% }{% \datecircaprint \printtext[#2date]{% \printtext{% \iffieldundef{#2season}{% \csuse{mkbibdate#1}{#2year}{#2month}{#2day}% \blx@printtime{#2}{}% }{% \csuse{mkbibseasondate#1}{#2year}{#2season}}% \dateuncertainprint \dateeraprint{#2year}% \iffieldundef{#2endyear}{% \printfield{extrayear}% }{% \iffieldequalstr{#2endyear}{}{% \printfield{extrayear}% \printtext{\mbox{\bibdaterangesep}}% }{% \printtext{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}% \blx@printtime{#2}{end}% }{% \csuse{mkbibseasondate#1}{#2endyear}{#2endseason}}}% \printfield{extrayear}% \enddateuncertainprint \dateeraprint{#2endyear}}}}}}} \DeclareRobustCommand*{\mkdaterangetruncextra}[2]{% \blx@metadateinfo{#2}% \iffieldundef{#2year}{% \iffieldundef{#2month}{}{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \iffieldsequal{#2month}{#2endmonth}{% \csuse{mkbibdate#1}{}{}{#2day}% }{% \csuse{mkbibdate#1}{}{#2month}{#2day}}% }{% \csuse{mkbibseasondate#1}{}{#2season}}% \dateuncertainprint \iffieldundef{#2endmonth}{}{% \iffieldequalstr{#2endmonth}{}{% \mbox{\bibdaterangesep}% }{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \csuse{mkbibdate#1}{}{#2endmonth}{#2endday}% }{% \csuse{mkbibseasondate#1}{}{#2endseason}}% \enddateuncertainprint}}}}% }{% \datecircaprint \printtext[#2date]{% \iffieldundef{#2season}{% \iffieldsequal{#2year}{#2endyear}{% \iffieldsequal{#2month}{#2endmonth}{% \csuse{mkbibdate#1}{}{}{#2day}% }{% \csuse{mkbibdate#1}{}{#2month}{#2day}}% }{% \csuse{mkbibdate#1}{#2year}{#2month}{#2day}% \iffieldsequal{#2dateera}{#2enddateera}{}{% \dateeraprint{#2year}}}% }{% \iffieldsequal{#2year}{#2endyear}{% \csuse{mkbibseasondate#1}{}{#2season}% }{% \csuse{mkbibseasondate#1}{#2year}{#2season} \iffieldsequal{#2dateera}{#2enddateera}{}{% \dateeraprint{#2year}}}}% \dateuncertainprint \iffieldundef{#2endyear}{% \printfield{extrayear}% }{% \iffieldequalstr{#2endyear}{}{% \printfield{extrayear}% \printtext{\mbox{\bibdaterangesep}}% }{% \printtext{% \bibdaterangesep \enddatecircaprint \iffieldundef{#2season}{% \iffieldundef{#2endmonth}{% \blx@ox@compyear{\thefield{#2year}}{\thefield{#2endyear}}% }{% \csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}}% }{% \csuse{mkbibseasondate#1}{#2endyear}{#2endseason}}}% \printfield{extrayear}% \enddateuncertainprint \dateeraprint{#2endyear}}}}}} \DeclareLabeldate{% \field{origdate} \field{date} \field{year} \field{eventdate} \field{pubstate} \literal{nodate} } \DeclareFieldFormat{extrayear}{% \iffieldundef{\thefield{labeldatesource}}{% \iffieldnums{\thefield{labeldatesource}year}{}{~}% }{% \iffieldnums{\thefield{labeldatesource}}{}{~}% }% \mkbibemph{\mknumalph{#1}}}% \DeclareFieldFormat{shorthandwidth}{#1} \xpretonameformat{family-given}{% \iffieldannotation{inferred}{\ifnumequal{\value{listcount}}{1}{\bibopenbracket}{}}{}% \ifitemannotation{inferred}{\bibopenbracket}{}% }{}{} \xpatchnameformat{family-given}{% \usebibmacro{name:andothers}% }{% \ifitemannotation{pseudo}{% \addspace\printtext[parens]{\bibsstring{pseudo}}% }{}% \ifitemannotation{inferred}{\bibclosebracket}{}% \usebibmacro{name:andothers}% \iffieldannotation{inferred}{% \ifboolexpr{ test {\ifnumequal{\value{listcount}}{\value{maxnames}}} or test {\ifnumequal{\value{listcount}}{\value{listtotal}}} or ( test {\ifnumequal{\value{listcount}}{\value{minnames}}} and test {\ifnumgreater{\value{listtotal}}{\value{maxnames}}} ) }{\bibclosebracket}{}% }{}% }{}{} \DeclareNameAlias{shortauthor}{family-given} \DeclareNameAlias{shorteditor}{family-given} \DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{author}{family-given} \DeclareNameAlias{editor}{family-given} \DeclareNameAlias{translator}{family-given} \defbibenvironment{bibliography} {\list {} {\setlength{\leftmargin}{\bibhang}% \setlength{\itemindent}{-\leftmargin}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}} {\endlist} {\item} \defbibenvironment{shorthand} {\list {\printfield[shorthandwidth]{shorthand}} {\setlength{\labelwidth}{\shorthandwidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}% \renewcommand*{\makelabel}[1]{##1\hss}}} {\endlist} {\item} \InitializeBibliographyStyle{\global\undef\bbx@lasthash} \xapptobibmacro{begrelated}{% \booltrue{bbx@inset}}{}{} \xapptobibmacro{endrelated}{% \usebibmacro*{bbx:savehash}}{}{} \xpatchbibmacro{author}{% \iffieldundef{authortype}% }{% \usebibmacro{date+extrayear}% \setunit*{\addspace}% \iffieldundef{authortype}% }{}{}% \xpatchbibmacro{author}{% \global\undef\bbx@lasthash }{% \global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}% \usebibmacro{date+extrayear}% }{}{}% \xpatchbibmacro{namepairs}{% \printnames[by#1]% }{% \printnames[#1]% }{}{} \xpatchbibmacro{author+altauthor}{% \printnames{author}% }{% \ifboolexpr{% ( not test {\ifnameundef{shortauthor}} ) and test {\ifnumequal{\value{shortauthor}}{\value{author}}} }{% \usebibmacro{namepairs}{author}{shortauthor}% }{% \printnames{author}% }% }{}{}% \xpatchbibmacro{bbx:editor}{% \usebibmacro{#1}% }{% \usebibmacro{date+extrayear}% \setunit*{\addspace}% \usebibmacro{#1}% }{}{}% \xpatchbibmacro{bbx:editor}{% \global\undef\bbx@lasthash }{% \global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}% \usebibmacro{date+extrayear}% }{}{}% \xpatchbibmacro{editor+alteditor}{% \printnames[byeditor]% }{% \printnames[editor]% }{}{} \xpatchbibmacro{editor+alteditor}{% \printnames{editor}% }{% \ifboolexpr{% ( not test {\ifnameundef{shorteditor}} ) and test {\ifnumequal{\value{shorteditor}}{\value{editor}}} }{% \usebibmacro{namepairs}{editor}{shorteditor}% }{% \printnames{editor}% }% }{}{}% \xpatchbibmacro{bbx:translator}{% \global\undef\bbx@lasthash }{% \global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}% \usebibmacro{date+extrayear}% }{}{}% \xpatchbibmacro{bbx:translator}{% \usebibmacro{#1}% }{% \usebibmacro{date+extrayear}% \setunit*{\addspace}% \usebibmacro{#1}% }{}{}% \newtoggle{blx@ox@clearedtitle} \newbibmacro*{labeltitle}{% \iffieldundef{label}{% \iffieldundef{shorttitle}{% \ifboolexpr{ test {\iffieldundef{title}} and test {\iffieldundef{subtitle}} }{% \printfield{library}% \clearfield{library}% }{% \printtext[title]{% \printfield[titlecase]{title}% \setunit{\subtitlepunct}% \printfield[titlecase]{subtitle}}% \clearfield{title}% \clearfield{subtitle}% \toggletrue{blx@ox@clearedtitle}% \setunit{\addspace}% }% }{% \printtext[title]{\printfield[titlecase]{shorttitle}}% }% }{% \printfield{label}% }% } \xpretobibmacro{maintitle+title}{% \iftoggle{blx@ox@clearedtitle}{% \usebibmacro{maintitle+volume}% \clearfield{maintitle}% \clearfield{volume}% }{}% }{}{} \DeclareFieldFormat[mvbook,mvcollection,mvreference,proceedings,mvproceedings]{maintitle+volume}{#1} \xpatchbibdriver{online}{% \iffieldundef{year}% }{% \iffieldundef{month}% }{}{} \DeclareFieldFormat[online,image]{citetitle}{\mkbibquote{#1\isdot}} \DeclareFieldFormat[legislation,legal]{citetitle}{#1} \DeclareFieldFormat[manuscript,unpublished]{citetitle}{% \def\currentfield{title}% \ifboolexpr{ test {\iffieldannotation{descriptor}} or ( test {\iffieldundef{shorttitle}} and test {\iffieldundef{title}} ) }{#1}{\mkbibquote{#1\isdot}}% \undef\currentfield} \renewcommand*{\bibpagespunct}{% \ifboolexpr{ test {\ifentrytype{article}} or test {\ifentrytype{suppperiodical}} or test {\ifentrytype{review}} }{% \addcolon\space }{% \addcomma\space }% } \DeclareFieldFormat[manuscript]{datelabel}{\mkbibbrackets{#1}} \DeclareFieldFormat[unpublished]{datelabel}{% \iftoggle{blx@ox@ms}{\mkbibbrackets{#1}}{\mkbibparens{#1}}} \renewbibmacro*{manuscript:date}{\usebibmacro{date}} \DeclareLabeltitle{% \field{shorttitle} \field{title} \field{maintitle} \field{library} } %% %% Copyright (C) 2016 Alex Ball %% %% End of file `oxyear.bbx'.