citeproc 0.8 → 0.8.0.1
raw patch · 12 files changed
+1167/−99 lines, 12 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Citeproc.Types: PageRangeChicago :: PageRangeFormat
+ Citeproc.Types: PageRangeChicago15 :: PageRangeFormat
+ Citeproc.Types: PageRangeChicago16 :: PageRangeFormat
Files
- CHANGELOG.md +15/−0
- README.md +1/−1
- citeproc.cabal +2/−2
- src/Citeproc/Eval.hs +20/−15
- src/Citeproc/Style.hs +5/−1
- src/Citeproc/Types.hs +2/−1
- test/Spec.hs +1/−1
- test/csl/etal_AndOthersWithEtAlUseLast.txt +0/−78
- test/csl/page_Chicago16.txt +288/−0
- test/csl/textcase_TitleCaseWithCleverBrandName.txt +43/−0
- test/extra/issue_112.txt +212/−0
- test/extra/issue_116.txt +578/−0
CHANGELOG.md view
@@ -1,5 +1,20 @@ # citeproc changelog +## 0.8.0.1++ * Fix disambiguation edge case (#116). We weren't properly+ disambiguating when only one of two ambiguous names had a+ subsequent citation.++ * Chicago page numbering fixes.++ * Update test suite form upstream.++ * Handle whole-citation links differently in `secondFieldAlign` (#113,+ Benjamin Bray).++ * Require data-default >= 0.5.2 (#114, Bodigrim).+ ## 0.8 * Add `SubstitutedVal` constructor for `Val` [API change] (#101, #108).
README.md view
@@ -101,7 +101,7 @@ Although this library is much more accurate in implementing the CSL spec than pandoc-citeproc was, it still fails some of the-tests from the CSL test suite (67/862). However, most of the+tests from the CSL test suite (62/818). However, most of the failures are on minor corner cases, and in many cases the expected behavior goes beyond what is required by the CSL spec. (For example, we intentionally refrain from capitalizing
citeproc.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: citeproc-version: 0.8+version: 0.8.0.1 synopsis: Generates citations and bibliography from CSL styles. description: citeproc parses CSL style files and uses them to generate a list of formatted citations and bibliography@@ -73,7 +73,7 @@ , uniplate , xml-conduit , attoparsec- , data-default+ , data-default >= 0.5.2 , aeson , filepath , file-embed
src/Citeproc/Eval.hs view
@@ -394,9 +394,7 @@ = Tagged (TagName n) (Literal replacement) replaceEach x = x replaceFirst num x@(Tagged (TagNames _ _ ns') _)- -- a kludge to get this to type-check!- | True = foldr (transform . replaceName) x $ take num ns'- | False = Literal replacement+ = foldr (transform . replaceName) x $ take num ns' replaceFirst _num x = x replaceName name (Tagged (TagName n) _) | n == name = Tagged (TagName n) (Literal replacement)@@ -426,11 +424,11 @@ disambiguateCitations style bibSortKeyMap citations = do refs <- unReferenceMap <$> gets stateRefMap let refIds = M.keys refs- let citeIds = concatMap (map citationItemId . citationItems) citations- let citeIdsSet = Set.fromList citeIds let ghostItems = [ ident | ident <- refIds- , not (ident `Set.member` citeIdsSet)]+ ]+ -- we add additional references for EVERY citation,+ -- even those we have already, to handle cases like #116 -- for purposes of disambiguation, we remove prefixes and -- suffixes and locators, and we convert author-in-text to normal citation.@@ -1133,6 +1131,8 @@ where formatting = layoutFormatting layout + secondFieldAlign [Linked t (x:xs)] =+ secondFieldAlign [x, Linked t xs] secondFieldAlign (x:xs) = formatted mempty{ formatDisplay = Just DisplayLeftMargin } [x] : [formatted mempty{ formatDisplay = Just DisplayRightInline } xs]@@ -1439,12 +1439,9 @@ Verb -> lookupTerm' term{ termForm = Long } Short -> lookupTerm' term{ termForm = Long } _ -> return NullOutput- f xs = case xs of- [] -> return NullOutput- ((_,t):_) -> return $- if T.null t- then NullOutput- else Literal $ fromText t+ f ((_,t):_) = return $ if T.null t+ then NullOutput+ else Literal $ fromText t pageRange :: CiteprocOutput a => Text -> Eval a (Output a) pageRange x = do@@ -1485,11 +1482,11 @@ length $ filter not $ zipWith (==) (xs ++ repeat ' ') ys minimal threshold pref x y = case T.commonPrefixes x y of- Just (_comm, _erstx, resty) ->+ Just (_comm, restx, resty) | T.length restx == T.length resty -> if T.length resty < threshold && T.length y >= threshold then inRange pref [x, T.takeEnd threshold y] else inRange pref [x, resty]- Nothing -> inRange pref [x, y]+ _ -> inRange pref [x, y] in case rangeParts of [] -> NullOutput [w] -> literal w@@ -1509,14 +1506,22 @@ then T.take (xlen - ylen) x <> y else y case fmt of- PageRangeChicago+ PageRangeChicago15 | xlen < 3 -> inRange pref [x, y'] | "00" `T.isSuffixOf` x -> inRange pref [x, y'] | T.take 1 (T.takeEnd 2 x) == "0"+ , T.take 1 (T.takeEnd 2 y') == "0" -> minimal 1 pref x y' | xlen == 4 , changedDigits (T.unpack x) (T.unpack y') >= 3 -> inRange pref [x, y']+ | otherwise -> minimal 2 pref x y'+ PageRangeChicago16+ | xlen < 3 -> inRange pref [x, y']+ | "00" `T.isSuffixOf` x -> inRange pref [x, y']+ | T.take 1 (T.takeEnd 2 x) == "0"+ , T.take 1 (T.takeEnd 2 y') == "0"+ -> minimal 1 pref x y' | otherwise -> minimal 2 pref x y' PageRangeExpanded -> inRange mempty [pref <> x, pref <> y']
src/Citeproc/Style.hs view
@@ -165,7 +165,11 @@ lookupAttribute "initialize-with-hyphen" attr , stylePageRangeFormat = case lookupAttribute "page-range-format" attr of- Just "chicago" -> Just PageRangeChicago+ Just "chicago" -> Just PageRangeChicago15+ -- chicago is an alias for chicago-15, but this+ -- will change to chicago-16 in v1.1+ Just "chicago-15" -> Just PageRangeChicago15+ Just "chicago-16" -> Just PageRangeChicago16 Just "expanded" -> Just PageRangeExpanded Just "minimal" -> Just PageRangeMinimal Just "minimal-two" -> Just PageRangeMinimalTwo
src/Citeproc/Types.hs view
@@ -683,7 +683,8 @@ deriving (Show, Eq) data PageRangeFormat =- PageRangeChicago+ PageRangeChicago15+ | PageRangeChicago16 | PageRangeExpanded | PageRangeMinimal | PageRangeMinimalTwo
test/Spec.hs view
@@ -340,7 +340,7 @@ (length (skipped counts)) case length (failed counts) + length (errored counts) of 0 -> exitSuccess- n | n <= 64 -> do+ n | n <= 62 -> do putStrLn "We have passed all the CSL tests we expect to..." exitSuccess | otherwise -> exitWith $ ExitFailure n
− test/csl/etal_AndOthersWithEtAlUseLast.txt
@@ -1,78 +0,0 @@->>===== MODE =====>>-bibliography-<<===== MODE =====<<---->>===== RESULT =====>>-<div class="csl-bib-body">- <div class="csl-entry">John Doe, Jane Roe, et al.</div>-</div>-<<===== RESULT =====<<--->>===== CSL =====>>-<style - xmlns="http://purl.org/net/xbiblio/csl"- class="note"- version="1.0">- <info>- <id />- <title />- <updated>2022-03-22T18:29:00+01:00</updated>- </info>- <citation>- <layout>- <text value="Oops"/>- </layout>- </citation>- <bibliography>- <layout>- <group delimiter=", ">- <names variable="author">- <name et-al-min="5" et-al-use-first="4" et-al-use-last="true" />- </names>- </group>- </layout>- </bibliography>-</style>-<<===== CSL =====<<--->>===== INPUT =====>>-[- {- "author": [- {- "family": "Doe",- "given": "John"- },- {- "family": "Roe",- "given": "Jane"- },- {- "literal": "others"- }- ],- "id": "ITEM-1",- "issued": {- "date-parts": [- [- "1965",- "6",- "1"- ]- ]- },- "title": "His Anonymous Life",- "type": "article-journal"- }-]-<<===== INPUT =====<<--->>===== VERSION =====>>-1.0-<<===== VERSION =====<<-
+ test/csl/page_Chicago16.txt view
@@ -0,0 +1,288 @@+>>===== MODE =====>>+citation+<<===== MODE =====<<++Examples taken from:++ http://cmosshoptalk.com/2018/04/10/316-7-316-17-or-316-317-chicago-style-for-number-ranges/++>>===== RESULT =====>>+Example A, at 3–10+Example B, at 71–72+Example C, at 71–72+Example D, at 96–117+Example E, at 100–104+Example F, at 1100–1113+Example G, at 1100–1113+Example H, at 101–8+Example I, at 808–33+Example J, at 1103–4+Example K, at 321–28+Example L, at 321–28+Example M, at 498–532+Example N, at 1087–89+Example O, at 1087–89+Example P, at 1496–500+Example Q, at 11564–615+Example R, at 12991–123001+Example S, at xxv–xxviii+Example T, at cvi–cix+<<===== RESULT =====<<+++>>===== CITATION-ITEMS =====>>+[+ [+ {+ "id": "ITEM-1"+ }+ ],+ [+ {+ "id": "ITEM-2"+ }+ ],+ [+ {+ "id": "ITEM-3"+ }+ ],+ [+ {+ "id": "ITEM-4"+ }+ ],+ [+ {+ "id": "ITEM-5"+ }+ ],+ [+ {+ "id": "ITEM-6"+ }+ ],+ [+ {+ "id": "ITEM-7"+ }+ ],+ [+ {+ "id": "ITEM-8"+ }+ ],+ [+ {+ "id": "ITEM-9"+ }+ ],+ [+ {+ "id": "ITEM-10"+ }+ ],+ [+ {+ "id": "ITEM-11"+ }+ ],+ [+ {+ "id": "ITEM-12"+ }+ ],+ [+ {+ "id": "ITEM-13"+ }+ ],+ [+ {+ "id": "ITEM-14"+ }+ ],+ [+ {+ "id": "ITEM-15"+ }+ ],+ [+ {+ "id": "ITEM-16"+ }+ ],+ [+ {+ "id": "ITEM-17"+ }+ ],+ [+ {+ "id": "ITEM-18"+ }+ ],+ [+ {+ "id": "ITEM-19"+ }+ ],+ [+ {+ "id": "ITEM-20"+ }+ ]+]+<<===== CITATION-ITEMS =====<<+++>>===== CSL =====>>+<style+ xmlns="http://purl.org/net/xbiblio/csl"+ class="note"+ version="1.0"+ page-range-format="chicago-16">+ <info>+ <id />+ <title />+ <updated>2021-09-16T20:00:00+08:00</updated>+ </info>+ <citation>+ <layout>+ <text variable="title"/>+ <text variable="page" prefix=", at "/>+ </layout>+ </citation>+</style>+<<===== CSL =====<<+++>>===== INPUT =====>>+[+ {+ "id": "ITEM-1",+ "page": "3-10",+ "title": "Example A",+ "type": "book"+ },+ {+ "id": "ITEM-2",+ "page": "71-72",+ "title": "Example B",+ "type": "book"+ },+ {+ "id": "ITEM-3",+ "page": "71-2",+ "title": "Example C",+ "type": "book"+ },+ {+ "id": "ITEM-4",+ "page": "96-117",+ "title": "Example D",+ "type": "book"+ },+ {+ "id": "ITEM-5",+ "page": "100-104",+ "title": "Example E",+ "type": "book"+ },+ {+ "id": "ITEM-6",+ "page": "1100-1113",+ "title": "Example F",+ "type": "book"+ },+ {+ "id": "ITEM-7",+ "page": "1100-13",+ "title": "Example G",+ "type": "book"+ },+ {+ "id": "ITEM-8",+ "page": "101-108",+ "title": "Example H",+ "type": "book"+ },+ {+ "id": "ITEM-9",+ "page": "808-833",+ "title": "Example I",+ "type": "book"+ },+ {+ "id": "ITEM-10",+ "page": "1103-1104",+ "title": "Example J",+ "type": "book"+ },+ {+ "id": "ITEM-11",+ "page": "321-328",+ "title": "Example K",+ "type": "book"+ },+ {+ "id": "ITEM-12",+ "page": "321-8",+ "title": "Example L",+ "type": "book"+ },+ {+ "id": "ITEM-13",+ "page": "498-532",+ "title": "Example M",+ "type": "book"+ },+ {+ "id": "ITEM-14",+ "page": "1087-1089",+ "title": "Example N",+ "type": "book"+ },+ {+ "id": "ITEM-15",+ "page": "1087-89",+ "title": "Example O",+ "type": "book"+ },+ {+ "id": "ITEM-16",+ "page": "1496-1500",+ "title": "Example P",+ "type": "book"+ },+ {+ "id": "ITEM-17",+ "page": "11564-11615",+ "title": "Example Q",+ "type": "book"+ },+ {+ "id": "ITEM-18",+ "page": "12991-123001",+ "title": "Example R",+ "type": "book"+ },+ {+ "id": "ITEM-19",+ "page": "xxv-xxviii",+ "title": "Example S",+ "type": "book"+ },+ {+ "id": "ITEM-20",+ "page": "cvi-cix",+ "title": "Example T",+ "type": "book"+ }+]+<<===== INPUT =====<<+++>>===== VERSION =====>>+1.0+<<===== VERSION =====<<
+ test/csl/textcase_TitleCaseWithCleverBrandName.txt view
@@ -0,0 +1,43 @@+>>===== MODE =====>>+citation+<<===== MODE =====<<++>>===== RESULT =====>>+iPad Is a Thing+<<===== RESULT =====<<+++>>===== CSL =====>>+<style + xmlns="http://purl.org/net/xbiblio/csl"+ class="note"+ version="1.0">+ <info>+ <id />+ <title />+ <updated>2009-08-10T04:49:00+09:00</updated>+ </info>+ <citation>+ <layout>+ <text variable="title" text-case="title"/>+ </layout>+ </citation>+</style>+<<===== CSL =====<<+++>>===== INPUT =====>>+[+ {+ "id": "ITEM-1",+ "title": "iPad is a thing",+ "type": "book"+ }+]+<<===== INPUT =====<<+++>>===== VERSION =====>>+1.0+<<===== VERSION =====<<+
+ test/extra/issue_112.txt view
@@ -0,0 +1,212 @@+>>===== MODE =====>>+bibliography+<<===== MODE =====<<+++>>===== OPTIONS =====>>+{+ "linkBibliography" : true+}+<<===== OPTIONS =====<<+++>>===== RESULT =====>>+<div class="csl-bib-body">+ <div class="csl-entry">+ <div class="csl-left-margin">[1]</div><div class="csl-right-inline"><a href="https://pandoc.org/">F. Author, <b>1234</b></a>.</div>+ </div>+</div>+<<===== RESULT =====<<+++>>===== CSL =====>>+<?xml version="1.0" encoding="utf-8"?>+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">+ <info>+ <title>Angewandte Chemie International Edition</title>+ <id>http://www.zotero.org/styles/angewandte-chemie</id>+ <link href="http://www.zotero.org/styles/angewandte-chemie" rel="self"/>+ <link href="https://onlinelibrary.wiley.com/page/journal/15213773/homepage/notice-to-authors" rel="documentation"/>+ <author>+ <name>Richard Karnesky</name>+ <email>karnesky+zotero@gmail.com</email>+ <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>+ </author>+ <contributor>+ <name>Sebastian Karcher</name>+ </contributor>+ <category citation-format="numeric"/>+ <category field="engineering"/>+ <!--<category term="materials science"/>-->+ <category field="chemistry"/>+ <issn>1433-7851</issn>+ <eissn>1521-3773</eissn>+ <summary>A style for Wiley-VCH's journal "Angewandte Chemie International Edition"+This style has many limits due to csl constraints, most notably the inability to include pages/page ranges for books, the wrong square brackets for two items cited together, and the lack of support for citing 1a)... b)...c)....</summary>+ <updated>2020-05-15T22:06:38+00:00</updated>+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>+ </info>+ <macro name="author">+ <names variable="author">+ <name initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>+ <label form="short" prefix=", " text-case="capitalize-first" suffix=" "/>+ <substitute>+ <names variable="editor"/>+ <names variable="translator"/>+ </substitute>+ </names>+ </macro>+ <macro name="editor">+ <names variable="editor">+ <label form="short" text-case="capitalize-first" suffix=".: " strip-periods="true"/>+ <name initialize-with="." delimiter=", " delimiter-precedes-last="always"/>+ </names>+ </macro>+ <macro name="year-date">+ <group font-weight="bold">+ <choose>+ <if variable="issued">+ <date variable="issued">+ <date-part name="year"/>+ </date>+ </if>+ <else>+ <text term="no date" form="short"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="access">+ <choose>+ <if variable="page" match="none">+ <choose>+ <if variable="DOI">+ <text variable="DOI" prefix="DOI "/>+ </if>+ </choose>+ <choose>+ <if type="webpage">+ <text variable="URL" prefix="can be found under "/>+ </if>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="publisher">+ <group delimiter=", ">+ <text variable="publisher" text-case="capitalize-all"/>+ <text variable="publisher-place" text-case="title"/>+ </group>+ </macro>+ <macro name="pages">+ <label variable="page" form="short" suffix=" "/>+ <text variable="page"/>+ </macro>+ <citation collapse="citation-number">+ <sort>+ <key variable="citation-number"/>+ </sort>+ <layout vertical-align="sup" delimiter="," prefix="[" suffix="]">+ <text variable="citation-number"/>+ </layout>+ </citation>+ <bibliography entry-spacing="0" second-field-align="flush">+ <layout suffix=".">+ <text variable="citation-number" prefix="[" suffix="]"/>+ <text macro="author" suffix=", "/>+ <choose>+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <group delimiter=", ">+ <text variable="title" text-case="title" font-style="italic"/>+ <text macro="publisher"/>+ <text macro="year-date"/>+ </group>+ </if>+ <else-if type="chapter paper-conference" match="any">+ <group delimiter=", ">+ <group delimiter=" ">+ <text term="in"/>+ <text variable="container-title" form="short" text-case="title" font-style="italic"/>+ <text macro="editor" prefix="(" suffix=")"/>+ </group>+ <text macro="publisher"/>+ <text macro="year-date"/>+ <group delimiter=" ">+ <text macro="pages"/>+ </group>+ </group>+ </else-if>+ <else-if type="patent">+ <group delimiter=", ">+ <text variable="title" text-case="title" font-style="italic"/>+ <text macro="year-date"/>+ <text variable="number"/>+ </group>+ </else-if>+ <else-if type="thesis">+ <group delimiter=", ">+ <text variable="title" text-case="title"/>+ <text variable="genre"/>+ <text variable="publisher"/>+ <text macro="year-date"/>+ </group>+ </else-if>+ <else-if type="webpage">+ <group delimiter=", ">+ <text variable="title" quotes="true"/>+ <text macro="access"/>+ <text macro="year-date"/>+ </group>+ </else-if>+ <else>+ <group delimiter=" ">+ <text variable="container-title" form="short" font-style="italic"/>+ <group delimiter=", ">+ <text macro="year-date"/>+ <group>+ <text variable="volume" font-style="italic"/>+ </group>+ <text variable="page" form="short"/>+ </group>+ </group>+ <text macro="access" prefix=", "/>+ </else>+ </choose>+ </layout>+ </bibliography>+</style>+<<===== CSL =====<<+++++>>===== INPUT =====>>+[+ {+ "author": [+ {+ "family": "Author",+ "given": "First"+ }+ ],+ "id": "test",+ "title": "Title",+ "journal": "Journal",+ "type": "article",+ "issued": {+ "date-parts": [+ [+ 1234+ ]+ ]+ },+ "URL": "https://pandoc.org/"+ }+]+<<===== INPUT =====<<+++>>===== VERSION =====>>+1.0+<<===== VERSION =====<<+
+ test/extra/issue_116.txt view
@@ -0,0 +1,578 @@+>>===== MODE =====>>+citation+<<===== MODE =====<<++++>>===== RESULT =====>>+Thorlac Turville-Petre, ‘Sir Adrian Fortescue and His Copy of <i>Piers Plowman</i>’, <i>Yearbook of Langland Studies</i>, 14 (2000), 29–48; Thorlac Turville-Petre, ‘Putting It Right: The Corrections of Huntington Library MS. HM 128 and BL Additional MS. 35287’, <i>Yearbook of Langland Studies</i>, 16 (2002), 41–65.+Turville-Petre, ‘Putting It Right’.+<<===== RESULT =====<<+++>>===== CITATIONS =====>>+[[ { "id":"Turville-PetreSirAdrianFortescue2000" },+ { "id":"Turville-PetrePuttingItRight2002" } ],+ [ { "id":"Turville-PetrePuttingItRight2002" } ]+]+<<===== CITATIONS =====<<+++++>>===== CSL =====>>+<?xml version="1.0" encoding="utf-8"?>+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB" page-range-format="chicago">+ <info>+ <title>Modern Humanities Research Association 3rd edition (note with bibliography)</title>+ <title-short>MHRA</title-short>+ <id>http://www.zotero.org/styles/modern-humanities-research-association</id>+ <link href="http://www.zotero.org/styles/modern-humanities-research-association" rel="self"/>+ <link href="http://www.mhra.org.uk/Publications/Books/StyleGuide/download.shtml" rel="documentation"/>+ <author>+ <name>Rintze Zelle</name>+ <uri>http://twitter.com/rintzezelle</uri>+ </author>+ <contributor>+ <name>Sebastian Karcher</name>+ </contributor>+ <contributor>+ <name>Andrew Dunning</name>+ <uri>http://individual.utoronto.ca/dunning/</uri>+ </contributor>+ <category citation-format="note"/>+ <category field="generic-base"/>+ <summary>MHRA format with full notes and bibliography</summary>+ <updated>2019-01-07T13:45:21+00:00</updated>+ <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>+ </info>+ <locale xml:lang="en">+ <terms>+ <term name="et-al">and others</term>+ <term name="editor" form="verb-short">ed. by</term>+ <term name="edition" form="short">edn</term>+ <term name="translator" form="verb-short">trans. by</term>+ <term name="folio">+ <single>fol.</single>+ <multiple>fols</multiple>+ </term>+ </terms>+ </locale>+ <macro name="author">+ <group delimiter=". ">+ <names variable="author">+ <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>+ <label form="short" prefix=", " suffix="."/>+ <substitute>+ <names variable="editor"/>+ <names variable="translator"/>+ <text macro="title-note"/>+ </substitute>+ </names>+ <text macro="recipient"/>+ </group>+ </macro>+ <macro name="recipient">+ <group delimiter=" ">+ <choose>+ <if type="personal_communication">+ <choose>+ <if variable="genre">+ <text variable="genre" text-case="capitalize-first"/>+ </if>+ <else>+ <text term="letter" text-case="capitalize-first"/>+ </else>+ </choose>+ </if>+ </choose>+ <text macro="recipient-note"/>+ </group>+ </macro>+ <macro name="contributors-note">+ <names variable="author">+ <name and="text" sort-separator=", " delimiter=", "/>+ <label form="short" prefix=", "/>+ <substitute>+ <text macro="title-note"/>+ </substitute>+ </names>+ <text macro="recipient-note"/>+ </macro>+ <macro name="title-note">+ <choose>+ <if variable="title" match="none">+ <text variable="genre"/>+ </if>+ <else-if type="bill book graphic legislation motion_picture report song" match="any">+ <text variable="title" text-case="title" font-style="italic"/>+ <group delimiter=" " prefix=", ">+ <text term="version"/>+ <text variable="version"/>+ </group>+ </else-if>+ <else-if type="legal_case interview" match="any">+ <text variable="title"/>+ </else-if>+ <else-if variable="reviewed-author">+ <text variable="title" font-style="italic" prefix="review of "/>+ </else-if>+ <else>+ <text variable="title" text-case="title" quotes="true"/>+ </else>+ </choose>+ </macro>+ <macro name="disambiguate">+ <choose>+ <if disambiguate="true">+ <choose>+ <if variable="title" match="none">+ <text macro="issued"/>+ </if>+ <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <text variable="title" font-style="italic" text-case="title" form="short"/>+ </else-if>+ <else>+ <text variable="title" quotes="true" text-case="title" form="short"/>+ </else>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="title-sort-substitute">+ <choose>+ <if type="bill book graphic legal_case legislation motion_picture report song" match="any">+ <text variable="title" font-style="italic" text-case="title" form="short"/>+ </if>+ <else>+ <text variable="title" quotes="true" text-case="title" form="short"/>+ </else>+ </choose>+ </macro>+ <macro name="editor-translator">+ <group delimiter=", ">+ <group delimiter=" ">+ <choose>+ <if variable="container-author reviewed-author" match="any">+ <group>+ <names variable="container-author reviewed-author">+ <label form="verb-short" text-case="lowercase" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </if>+ </choose>+ </group>+ <names variable="editor translator" delimiter=", ">+ <label form="verb-short" text-case="lowercase" suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </group>+ </macro>+ <macro name="secondary-contributors-note">+ <choose>+ <if type="chapter paper-conference" match="none">+ <text macro="editor-translator"/>+ </if>+ </choose>+ </macro>+ <macro name="container-contributors-note">+ <choose>+ <if type="chapter paper-conference" match="any">+ <text macro="editor-translator"/>+ </if>+ </choose>+ </macro>+ <macro name="collection-title">+ <group delimiter=", ">+ <choose>+ <if type="article-journal">+ <text variable="collection-title"/>+ <text variable="collection-number"/>+ </if>+ <else>+ <text variable="collection-title" text-case="title"/>+ <text variable="collection-number"/>+ </else>+ </choose>+ </group>+ </macro>+ <macro name="locators-note">+ <choose>+ <if type="article-journal">+ <group delimiter=".">+ <text variable="volume"/>+ <text variable="issue"/>+ </group>+ </if>+ <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">+ <group delimiter=", ">+ <text macro="edition-note"/>+ <group>+ <number variable="number-of-volumes" form="numeric"/>+ <text term="volume" form="short" prefix=" " plural="true"/>+ </group>+ </group>+ </else-if>+ </choose>+ </macro>+ <macro name="volume">+ <choose>+ <if type="article-journal">+ <group delimiter=".">+ <text variable="volume"/>+ <text variable="issue"/>+ </group>+ </if>+ <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">+ <group delimiter=", ">+ <text macro="edition-note"/>+ <group>+ <number variable="number-of-volumes" form="numeric"/>+ <text term="volume" form="short" prefix=" " plural="true"/>+ </group>+ </group>+ </else-if>+ </choose>+ </macro>+ <macro name="issue-note">+ <choose>+ <if type="article-journal">+ <choose>+ <if variable="volume">+ <text macro="issued" prefix=" (" suffix=")"/>+ </if>+ <else>+ <text macro="issued" prefix=", "/>+ </else>+ </choose>+ </if>+ <else-if variable="publisher-place publisher" match="any">+ <group prefix=" (" suffix=")" delimiter=", ">+ <group delimiter=" ">+ <choose>+ <if variable="title" match="none"/>+ <else-if type="thesis speech" match="any">+ <text variable="genre" prefix="unpublished "/>+ </else-if>+ </choose>+ <text macro="event"/>+ </group>+ <text macro="publisher"/>+ <text macro="issued"/>+ </group>+ </else-if>+ <else>+ <text macro="issued" prefix=", "/>+ </else>+ </choose>+ </macro>+ <macro name="locators-specific-note">+ <choose>+ <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">+ <choose>+ <if is-numeric="volume">+ <number variable="volume" form="roman" font-variant="small-caps"/>+ </if>+ <else>+ <text variable="volume" font-variant="small-caps"/>+ </else>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="container-title-note">+ <choose>+ <if type="chapter paper-conference" match="any">+ <text term="in" suffix=" "/>+ </if>+ </choose>+ <text variable="container-title" text-case="title" font-style="italic"/>+ </macro>+ <macro name="edition-note">+ <choose>+ <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">+ <choose>+ <if is-numeric="edition">+ <group delimiter=" ">+ <number variable="edition" form="ordinal"/>+ <text term="edition" form="short"/>+ </group>+ </if>+ <else>+ <text variable="edition"/>+ </else>+ </choose>+ </if>+ </choose>+ </macro>+ <macro name="recipient-note">+ <names variable="recipient" delimiter=", ">+ <label form="verb" prefix=" " suffix=" "/>+ <name and="text" delimiter=", "/>+ </names>+ </macro>+ <macro name="recipient-short">+ <names variable="recipient">+ <label form="verb" prefix=" " suffix=" "/>+ <name form="short" and="text" delimiter=", "/>+ </names>+ </macro>+ <macro name="contributors-short">+ <names variable="author">+ <name form="short" and="text" sort-separator=", " delimiter=", "/>+ <substitute>+ <names variable="editor"/>+ <names variable="translator"/>+ <text macro="title-sort-substitute"/>+ </substitute>+ </names>+ <text macro="recipient-short"/>+ </macro>+ <macro name="locators-newspaper">+ <choose>+ <if type="article-newspaper">+ <group delimiter=", ">+ <group delimiter=" ">+ <text variable="edition"/>+ <text term="edition"/>+ </group>+ <group>+ <text term="section" suffix=" "/>+ <text variable="section"/>+ </group>+ </group>+ </if>+ </choose>+ </macro>+ <macro name="event">+ <group>+ <text term="presented at" suffix=" "/>+ <text variable="event"/>+ </group>+ </macro>+ <macro name="publisher">+ <choose>+ <if type="thesis">+ <text variable="publisher"/>+ </if>+ <else>+ <group delimiter=": ">+ <text variable="publisher-place"/>+ <text variable="publisher"/>+ </group>+ </else>+ </choose>+ </macro>+ <macro name="issued">+ <choose>+ <if type="report article-newspaper article-magazine personal_communication" match="any">+ <date variable="issued">+ <date-part name="day" suffix=" "/>+ <date-part name="month" suffix=" "/>+ <date-part name="year"/>+ </date>+ </if>+ <else>+ <date variable="issued">+ <date-part name="year"/>+ </date>+ </else>+ </choose>+ </macro>+ <macro name="pages">+ <choose>+ <if type="article-journal">+ <text variable="page" prefix=", "/>+ </if>+ <else>+ <choose>+ <if variable="volume">+ <text variable="page" prefix=", "/>+ </if>+ <else>+ <label variable="page" form="short" prefix=", " suffix=" "/>+ <text variable="page"/>+ </else>+ </choose>+ </else>+ </choose>+ </macro>+ <macro name="point-locators">+ <text macro="pages"/>+ <choose>+ <if variable="page">+ <group prefix=" (" suffix=")">+ <label variable="locator" form="short" suffix=" "/>+ <text variable="locator"/>+ </group>+ </if>+ <else>+ <label variable="locator" form="short" prefix=", " suffix=" "/>+ <text variable="locator"/>+ </else>+ </choose>+ </macro>+ <macro name="point-locators-subsequent">+ <label variable="locator" form="short" prefix=", " suffix=" "/>+ <text variable="locator"/>+ </macro>+ <macro name="archive-note">+ <group delimiter=", ">+ <text variable="archive-place"/>+ <text variable="archive"/>+ <text variable="archive_location"/>+ </group>+ </macro>+ <macro name="access-note">+ <group delimiter=", ">+ <choose>+ <if type="article-journal bill chapter legal_case legislation paper-conference" match="none">+ <text macro="archive-note" prefix=", "/>+ </if>+ </choose>+ </group>+ <choose>+ <if variable="DOI">+ <text variable="DOI" prefix=" <https://doi.org/" suffix=">"/>+ </if>+ <else>+ <choose>+ <if variable="URL">+ <text variable="URL" prefix=" <" suffix=">"/>+ <group prefix=" [" suffix="]">+ <text term="accessed"/>+ <date variable="accessed">+ <date-part name="day" prefix=" "/>+ <date-part name="month" prefix=" "/>+ <date-part name="year" prefix=" "/>+ </date>+ </group>+ </if>+ </choose>+ </else>+ </choose>+ </macro>+ <macro name="artwork">+ <choose>+ <if type="graphic" match="any">+ <group delimiter=", ">+ <text variable="medium"/>+ <text variable="dimensions"/>+ </group>+ </if>+ </choose>+ </macro>+ <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true" disambiguate-add-givenname="true">+ <layout suffix="." delimiter="; ">+ <choose>+ <if position="subsequent">+ <group delimiter=", ">+ <text macro="contributors-short"/>+ <text macro="disambiguate"/>+ <text macro="locators-specific-note"/>+ </group>+ <text macro="point-locators-subsequent"/>+ </if>+ <else>+ <group delimiter=", ">+ <text macro="contributors-note"/>+ <text macro="title-note"/>+ <text macro="secondary-contributors-note"/>+ <text macro="container-title-note"/>+ <text macro="container-contributors-note"/>+ <text macro="collection-title"/>+ <text macro="locators-note"/>+ </group>+ <text macro="issue-note"/>+ <text macro="locators-specific-note" prefix=", "/>+ <text macro="locators-newspaper" prefix=", "/>+ <text macro="point-locators"/>+ <text macro="access-note"/>+ </else>+ </choose>+ </layout>+ </citation>+ <bibliography hanging-indent="true" et-al-min="7" et-al-use-first="6" subsequent-author-substitute="———">+ <sort>+ <key macro="author"/>+ <key variable="title"/>+ </sort>+ <layout>+ <group delimiter=", ">+ <text macro="author"/>+ <text macro="title-note"/>+ <text macro="secondary-contributors-note"/>+ <text macro="container-title-note"/>+ <text macro="container-contributors-note"/>+ <text macro="collection-title"/>+ <text macro="volume"/>+ </group>+ <text macro="issue-note"/>+ <text macro="locators-specific-note" prefix=", "/>+ <text macro="artwork" prefix=", "/>+ <text macro="locators-newspaper" prefix=", "/>+ <text macro="pages"/>+ <text macro="access-note"/>+ </layout>+ </bibliography>+</style>+<<===== CSL =====<<+++>>===== INPUT =====>>+[+ {+ "author": [+ {+ "family": "Turville-Petre",+ "given": "Thorlac"+ }+ ],+ "citation-key": "Turville-PetrePuttingItRight2002",+ "container-title": "Yearbook of Langland Studies",+ "id": "Turville-PetrePuttingItRight2002",+ "issued": {+ "date-parts": [+ [+ 2002+ ]+ ]+ },+ "page": "41-65",+ "title": "Putting it right: the corrections of Huntington Library MS. HM 128 and BL Additional MS. 35287",+ "title-short": "Putting it right",+ "type": "article-journal",+ "volume": "16"+ },+ {+ "author": [+ {+ "family": "Turville-Petre",+ "given": "Thorlac"+ }+ ],+ "citation-key": "Turville-PetreSirAdrianFortescue2000",+ "container-title": "Yearbook of Langland Studies",+ "id": "Turville-PetreSirAdrianFortescue2000",+ "issued": {+ "date-parts": [+ [+ 2000+ ]+ ]+ },+ "page": "29-48",+ "title": "Sir Adrian Fortescue and his copy of <i>Piers Plowman</i>",+ "title-short": "Sir Adrian Fortescue",+ "type": "article-journal",+ "volume": "14"+ }+]+<<===== INPUT =====<<+++>>===== VERSION =====>>+1.0+<<===== VERSION =====<<+