diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx | 198 |
1 files changed, 158 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx b/Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx index d569b2b7532..63af99d76be 100644 --- a/Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-oxref/oxyear.bbx @@ -13,7 +13,7 @@ %% See: http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- %% -\def\Version{2018/02/09 v0.11.3} +\def\Version{2018/03/03 v0.12} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesFile{oxyear.bbx} [\Version\space Author-year bibliography style inspired by the Oxford Guide to Style] @@ -26,8 +26,25 @@ {Invalid option 'mergedate=#1'} {Valid values are 'maximum', 'compact', 'basic', 'minimum',\MessageBreak 'year', 'true' (=year), and 'false'.}}} +\DeclareTypeOption{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+extradate}{} \DeclareFieldFormat{datelabel}{\mkbibparens{#1}} +\DeclareFieldFormat{labeldate}{% + \iflabeldateisdate{% + \def\currentfield{date}% + }{% + \iflabeldateisanydate{% + \def\currentfield{\thefield{labeldatesource}date}% + }{% + \def\currentfield{\thefield{labeldatesource}}}}% + \iffieldannotation{inferred}{\mkbibbrackets{#1}}{#1}% + \undef\currentfield} \DeclareLabeldate{% \field{origdate} \field{date} @@ -56,50 +73,62 @@ \ifboolexpr{% not test {\iffieldundef{labeldatesource}} and test {\iffieldequalstr{labeldatesource}{pubstate}}}} +\newtoggle{blx@ox@nonodate} +\DeclareBibliographyOption[boolean]{nonodate}[true]{% + \settoggle{blx@ox@nonodate}{#1}} +\DeclareTypeOption[boolean]{nonodate}[true]{% + \settoggle{blx@ox@nonodate}{#1}} +\DeclareEntryOption[boolean]{nonodate}[true]{% + \settoggle{blx@ox@nonodate}{#1}} +\newbibmacro*{labeldate}{% + \ifboolexpr{ + test {\iffieldequalstr{labeldatesource}{nodate}} + and + togl {blx@ox@nonodate} + }{}{\printtext[datelabel]{\printlabeldateextra}}} \def\bbx@opt@mergedate@true{\bbx@opt@mergedate@year} \def\bbx@opt@mergedate@maximum{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{% - \iflabeldateisdate{% + \iflabeldateisdate{% + \printtext[datelabel]{% \printfield{issue}\clearfield{issue}% \setunit*{\addspace}% - \printdateextra - \clearfield{year}\clearfield{season}\clearfield{month}\clearfield{day}% + \printdateextra}% + \clearfield{year}\clearfield{season}\clearfield{month}\clearfield{day}% + }{% + \iflabeldateisanydate{% + \printtext[datelabel]{% + \csuse{print\thefield{labeldatesource}dateextra}}% + \clearfield{\thefield{labeldatesource}year}% + \clearfield{\thefield{labeldatesource}season}% + \clearfield{\thefield{labeldatesource}month}% + \clearfield{\thefield{labeldatesource}day}% }{% - \iflabeldateisanydate{% - \csuse{print\thefield{labeldatesource}dateextra}% - \clearfield{\thefield{labeldatesource}year}% - \clearfield{\thefield{labeldatesource}season}% - \clearfield{\thefield{labeldatesource}month}% - \clearfield{\thefield{labeldatesource}day}% - }{% - \printlabeldateextra - \iflabeldateispubstate{}{\clearfield{\thefield{labeldatesource}}}% - }}}}}} + \usebibmacro{labeldate}% + \iflabeldateispubstate{}{\clearfield{\thefield{labeldatesource}}}}}}}} \def\bbx@opt@mergedate@compact{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{% - \iflabeldateisdate{% - \printdateextra - \clearfield{year}\clearfield{season}\clearfield{month}\clearfield{day}% + \iflabeldateisdate{% + \printtext[datelabel]{\printdateextra}% + \clearfield{year}\clearfield{season}\clearfield{month}\clearfield{day}% + }{% + \iflabeldateisanydate{% + \printtext[datelabel]{% + \csuse{print\thefield{labeldatesource}dateextra}}% + \clearfield{\thefield{labeldatesource}year}% + \clearfield{\thefield{labeldatesource}season}% + \clearfield{\thefield{labeldatesource}month}% + \clearfield{\thefield{labeldatesource}day}% }{% - \iflabeldateisanydate{% - \csuse{print\thefield{labeldatesource}dateextra}% - \clearfield{\thefield{labeldatesource}year}% - \clearfield{\thefield{labeldatesource}season}% - \clearfield{\thefield{labeldatesource}month}% - \clearfield{\thefield{labeldatesource}day}% - }{% - \printlabeldateextra - \iflabeldateispubstate{}{\clearfield{\thefield{labeldatesource}}}% - }}}}}} + \usebibmacro{labeldate}% + \iflabeldateispubstate{}{\clearfield{\thefield{labeldatesource}}}}}}}} \def\bbx@opt@mergedate@year{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{\printlabeldateextra}% + \usebibmacro{labeldate}% \iflabeldateisdate{% \clearfield{year} }{% @@ -111,7 +140,7 @@ \def\bbx@opt@mergedate@basic{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{\printlabeldateextra}% + \usebibmacro{labeldate}% \iflabeldateisdate{% \ifboolexpr{ test {\ifdateshavedifferentprecision{label}{}} @@ -129,7 +158,7 @@ \def\bbx@opt@mergedate@minimum{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{\printlabeldateextra}% + \usebibmacro{labeldate}% \iflabeldateisdate{% \ifboolexpr{ test {\ifdateshavedifferentprecision{label}{}} @@ -153,7 +182,7 @@ \def\bbx@opt@mergedate@false{% \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear}{}{% - \printtext[datelabel]{\printlabeldateextra}% + \usebibmacro{labeldate}% \iflabeldateisanydate{}{% \iflabeldateispubstate{}{\clearfield{\thefield{labeldatesource}}}% }}}} @@ -411,9 +440,29 @@ test {\iffieldundef{month}} }% }{}{} -\DeclareFieldFormat[online,image]{citetitle}{\mkbibquote{#1\isdot}} -\DeclareFieldFormat[legislation,legal]{citetitle}{#1} -\DeclareFieldFormat[manuscript,unpublished]{citetitle}{% +\DeclareFieldFormat[bookinbook]{citetitle}{% + \ifboolexpr{ + test {\iffieldequalstr{entrysubtype}{poem}} + or + test {\iffieldequalstr{entrysubtype}{play}} + }{% + \mkbibemph{#1}% + }{% + \mkbibquote{#1\isdot}}} +\DeclareFieldFormat[suppperiodical,inaudio,inmusic,inmovie,invideo,online,% + image,manuscript,unpublished]{citetitle}{% + \def\currentfield{title}% + \ifboolexpr{ + test {\iffieldannotation{descriptor}} + or ( + test {\iffieldundef{shorttitle}} + and + test {\iffieldundef{title}} + ) + }{#1}{\mkbibquote{#1\isdot}}% + \undef\currentfield} +\DeclareFieldFormat[suppperiodical,inaudio,inmusic,inmovie,invideo,online,% + image,manuscript,unpublished]{citetitle}{% \def\currentfield{title}% \ifboolexpr{ test {\iffieldannotation{descriptor}} @@ -424,6 +473,60 @@ ) }{#1}{\mkbibquote{#1\isdot}}% \undef\currentfield} +\DeclareFieldFormat[audio,music]{citetitle}{% + \def\currentfield{title}% + \ifboolexpr{ + test {\iffieldannotation{descriptor}} + or ( + test {\iffieldundef{shorttitle}} + and + test {\iffieldundef{title}} + ) + }{#1}{% + \iffieldequalstr{entrysubtype}{podcast}{% + \mkbibquote{#1\isdot}% + }{% + \mkbibemph{#1}}}% + \undef\currentfield} +\DeclareFieldFormat[movie,video]{citetitle}{% + \def\currentfield{title}% + \ifboolexpr{ + test {\iffieldannotation{descriptor}} + or ( + test {\iffieldundef{shorttitle}} + and + test {\iffieldundef{title}} + ) + }{#1}{% + \ifboolexpr{ + test {\iffieldequalstr{entrysubtype}{episode}} + or + test {\iffieldequalstr{entrysubtype}{clip}} + or + test {\iffieldequalstr{entrysubtype}{webcast}} + }{% + \mkbibquote{#1\isdot}% + }{% + \mkbibemph{#1}}}% + \undef\currentfield} +\DeclareFieldFormat[legislation,legal]{citetitle}{#1} +\DeclareFieldFormat[misc]% + {citetitle}{% + \def\currentfield{title}% + \ifboolexpr{ + test {\iffieldannotation{descriptor}} + or ( + test {\iffieldundef{shorttitle}} + and + test {\iffieldundef{title}} + ) + }{#1}{% + \iffieldequalstr{relatedtype}{in}{% + \mkbibquote{#1\isdot}% + }{% + \mkbibemph{#1}% + }}% + \undef\currentfield} \renewcommand*{\bibpagespunct}{% \ifboolexpr{ @@ -438,16 +541,31 @@ \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} } +\DeclareStyleSourcemap{% + \maps[datatype=bibtex]{% + \map[overwrite=true]{ + \step[notmatch=\regexp{nonodate}, fieldsource=options, final] + \step[fieldsource=sortyear, final] + \step[fieldset=options, append, fieldvalue={,nonodate}] + } + \map[overwrite=true]{ + \step[notfield=options, final] + \step[fieldsource=sortyear, final] + \step[fieldset=options, fieldvalue={nonodate}] + } + \map[overwrite=false]{ + \pertype{standard} + \step[notfield=author, + fieldsource=number, + fieldtarget=label] + } +}} %% %% Copyright (C) 2016–2018 Alex Ball |