summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx52
1 files changed, 50 insertions, 2 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx
index 2ee9431d57..c226d81cf7 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-mla/mla.bbx
@@ -1,5 +1,5 @@
% These sourcemap declarations allow for .bib file oddities. Additionally, to comport with MLA expectations, they modify strings in publisher fields, drop unneeded parts of URLs, and look for patterns in a URL field to fill in missing eprint fields. If the choices here seem to do too much, use "style=mla-strict", which makes fewer accommodations and more exactly prints entries as they're defined in a given bibtex file.
-\ProvidesFile{mla.bbx}[2021/06/07 v2.0 biblatex bibliography style]
+\ProvidesFile{mla.bbx}[2022/02/21 v2.1 biblatex bibliography style]
\RequireBibliographyStyle{mla-strict}
@@ -19,6 +19,39 @@
\step[fieldset=booktitle, null]
\step[fieldset=entrysubtype, fieldvalue={book}]
}
+ \map{% Add italics to app names for videos, movies, music, audio
+ \pertype{video}
+ \step[fieldsource=addendum, notmatch=\regexp{mkbibemph}, final]
+ \step[fieldsource=addendum, match=\regexp{(.+)\s+app$}, replace={\\mkbibemph\{$1\} app}]
+ }
+ \map{% Add italics to app names for videos, movies, music, audio
+ \pertype{movie}
+ \step[fieldsource=addendum, notmatch=\regexp{mkbibemph}, final]
+ \step[fieldsource=addendum, match=\regexp{(.+)\s+app$}, replace={\\mkbibemph\{$1\} app}]
+ }
+ \map{% Add italics to app names for videos, movies, music, audio
+ \pertype{music}
+ \step[fieldsource=addendum, notmatch=\regexp{mkbibemph}, final]
+ \step[fieldsource=addendum, match=\regexp{(.+)\s+app$}, replace={\\mkbibemph\{$1\} app}]
+ }
+ \map{% Add italics to app names for videos, movies, music, audio
+ \pertype{audio}
+ \step[fieldsource=addendum, notmatch=\regexp{mkbibemph}, final]
+ \step[fieldsource=addendum, match=\regexp{(.+)\s+app$}, replace={\\mkbibemph\{$1\} app}]
+ }
+ \map{% Add italics to app names for software
+ \pertype{software}
+ \step[fieldsource=maintitle, notmatch=\regexp{mkbibemph}, final]
+ \step[fieldsource=maintitle, match=\regexp{(.+)\s+app$}, replace={$1 \\mkbibemph\{app\}}]
+ }
+ \map{% Accommodate music albums defined simply
+ \pertype{music}
+ \step[notfield=title, final]
+ \step[fieldsource=booktitle, match=\regexp{(.+)}, final]
+ \step[fieldset=title, fieldvalue=\regexp{$1}, final]
+ \step[fieldset=booktitle, null]
+ \step[fieldset=entrysubtype, fieldvalue={album}]
+ }
\map{% Fill in missing publisher for US patents
\pertype{patent}
\step[notfield=publisher, final]
@@ -37,7 +70,11 @@
\step[fieldsource=publisher, match={University}, replace={U}]
\step[fieldsource=publisher, match=\regexp{Press\b}, replace={P}]
\step[fieldsource=publisher, match=\regexp{Corporation|Corp.|Incorporated|Inc.|Limited|Ltd.}, replace={}]
- \step[fieldsource=url, match=\regexp{http(s)?://}, replace={}]
+ % \step[fieldsource=url, match=\regexp{http(s)?://}, replace={}]
+ }
+ \map{% abbreviate and drop unneeded parts of institutions
+ \step[fieldsource=institution, match={University}, replace={U}]
+ \step[fieldsource=school, match={University}, replace={U}]
}
\map{% JSTOR url to eprint
\step[fieldsource=url, match={jstor.org}, final]
@@ -84,6 +121,14 @@
\step[fieldsource=doi, match=\regexp{http(s)?://dx.doi.org/(.+)}, replace=\regexp{$1}]
\step[fieldsource=doi, match=\regexp{dx.doi.org/(.+)}, replace=\regexp{$1}]
}
+ % \map{% doi to url when eprinttype set and url empty
+ % \step[notfield=url, final]
+ % \step[field=eprinttype, final]
+ % \step[field=doi, final]
+ % \step[fieldsource=doi, fieldtarget=url]
+ % \step[fieldsource=url, match=\regexp{(.+)}, replace=\regexp{https://doi.org/$1}]
+ % \step[fieldset=doi, null]
+ % }
\map{ % remove isbns from Works Cited
\step[fieldsource=isbn, final]
\step[fieldset=isbn, null]
@@ -93,6 +138,9 @@
\step[fieldset=url, null]
\step[fieldset=urldate, null]
}
+ \map[overwrite]{ % clean url + urldate field from all entries that have a doi field
+ \step[fieldsource=url, match=\regexp{http(s)?://}, replace={}]
+ }
}
}