summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnMacFarlane <>2018-02-16 23:49:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-02-16 23:49:00 (GMT)
commitf89e3729991490c205ba3eb965231ef0d1f103a8 (patch)
treeb0d81c9f447361bb325794766466c89be9e9157f
parent8f1484954932bbbfc822204725b2ecb09f6c6f66 (diff)
version 0.14.1.40.14.1.4
-rw-r--r--changelog9
-rw-r--r--pandoc-citeproc.cabal2
-rw-r--r--src/Text/CSL/Eval.hs4
-rw-r--r--src/Text/CSL/Style.hs16
-rw-r--r--tests/issue320.expected.native61
-rw-r--r--tests/issue320.in.native4
-rw-r--r--tests/issue320a.expected.native19
-rw-r--r--tests/issue320a.in.native2
-rw-r--r--tests/jats.csl208
9 files changed, 111 insertions, 214 deletions
diff --git a/changelog b/changelog
index 70eb897..9002dc1 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,12 @@
+pandoc-citeproc (0.14.1.4)
+
+ * Fixed sort order bugs (#320):
+
+ + Disregard ayn and hamza in sorting Arabic names.
+ + Proper treatment of spaces: nothing comes before something,
+ but spaces INSIDE a given name or family name are ignored.
+ + Disregard punctuation and case.
+
pandoc-citeproc (0.14.1.3)
* Bump xml-conduit version bound.
diff --git a/pandoc-citeproc.cabal b/pandoc-citeproc.cabal
index aa8a3e4..91f57a6 100644
--- a/pandoc-citeproc.cabal
+++ b/pandoc-citeproc.cabal
@@ -1,5 +1,5 @@
name: pandoc-citeproc
-version: 0.14.1.3
+version: 0.14.1.4
cabal-version: >= 1.12
synopsis: Supports using pandoc with citeproc
diff --git a/src/Text/CSL/Eval.hs b/src/Text/CSL/Eval.hs
index dcca75f..06ccca6 100644
--- a/src/Text/CSL/Eval.hs
+++ b/src/Text/CSL/Eval.hs
@@ -84,6 +84,10 @@ evalSorting m l ms opts ss as mbr
render = renderPlain . formatOutputList . proc removeDelimAndLabel
removeDelimAndLabel OLabel{} = ONull
removeDelimAndLabel ODel{} = ONull
+ -- for sorting purposes, we need to distinguish between the space
+ -- inside a last name like ben Gurion, and the space between the
+ -- last name and the first. OSpace is used for the latter.
+ removeDelimAndLabel OSpace{} = OStr "," emptyFormatting
removeDelimAndLabel x = x
format (s,e) = applaySort s . render $ uncurry eval e
eval o e = evalLayout (Layout emptyFormatting [] [e]) m False l ms o as mbr
diff --git a/src/Text/CSL/Style.hs b/src/Text/CSL/Style.hs
index f7d6d78..50949c9 100644
--- a/src/Text/CSL/Style.hs
+++ b/src/Text/CSL/Style.hs
@@ -98,7 +98,8 @@ import Control.Monad (mplus)
import Data.Aeson hiding (Number)
import qualified Data.Aeson as Aeson
import Data.Aeson.Types (Pair)
-import Data.Char (isLetter, isPunctuation, isUpper)
+import Data.Char (isLetter, isPunctuation, isUpper, toLower)
+import qualified Data.Char as Char
import Data.Generics (Data, Typeable)
import Data.List (intercalate, intersperse, isInfixOf,
isPrefixOf, nubBy)
@@ -480,16 +481,21 @@ instance Ord Sorting where
compare' :: String -> String -> Ordering
compare' x y
= case (x, y) of
- ('-':_,'-':_) -> comp (dropPunct y) (dropPunct x)
+ ('-':_,'-':_) -> comp (normalize y) (normalize x)
('-':_, _ ) -> LT
(_ ,'-':_) -> GT
- _ -> comp (dropPunct x) (dropPunct y)
+ _ -> comp (normalize x) (normalize y)
where
- dropPunct = dropWhile isPunctuation
+ normalize = map (\c -> if c == ',' || c == '.' then ' ' else c) .
+ filter (\c -> c == ',' ||
+ not (isPunctuation c || Char.isSpace c
+ -- ayn/hamza in transliterated arabic:
+ || c == 'ʾ' || c == 'ʿ'
+ ))
#ifdef UNICODE_COLLATION
comp a b = T.collate (T.collator T.Current) (T.pack a) (T.pack b)
#else
- comp a b = compareUnicode a b
+ comp a b = compareUnicode (map toLower a) (map toLower b)
#endif
data Form
diff --git a/tests/issue320.expected.native b/tests/issue320.expected.native
new file mode 100644
index 0000000..eb04cf7
--- /dev/null
+++ b/tests/issue320.expected.native
@@ -0,0 +1,61 @@
+Pandoc (Meta {unMeta = fromList [("csl",MetaInlines [Str "tests/apa.csl"]),("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Benjamin"]),("given",MetaInlines [Str "A.",Space,Str "S."])])]),("id",MetaInlines [Str "itemA1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Yaakov"]),("given",MetaInlines [Str "D."]),("non-dropping-particle",MetaInlines [Str "ben"])])]),("id",MetaInlines [Str "itemA2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Brown"]),("given",MetaInlines [Str "J.",Space,Str "R."])])]),("id",MetaInlines [Str "itemA3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Browning"]),("given",MetaInlines [Str "A.",Space,Str "R."])])]),("id",MetaInlines [Str "itemA4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Girard"]),("given",MetaInlines [Str "J.-B."])])]),("id",MetaInlines [Str "itemA5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Girard-Perregaux"]),("given",MetaInlines [Str "A.",Space,Str "S."])])]),("id",MetaInlines [Str "itemA6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Ibn",Space,Str "Abdulaziz"]),("given",MetaInlines [Str "T."])])]),("id",MetaInlines [Str "itemA7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Ibn",Space,Str "Nidal"]),("given",MetaInlines [Str "A.",Space,Str "K.",Space,Str "M."])])]),("id",MetaInlines [Str "itemA8"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Lo\769pez"]),("given",MetaInlines [Str "M.",Space,Str "E."])])]),("id",MetaInlines [Str "itemA9"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Lo\769pez",Space,Str "de",Space,Str "Molina"]),("given",MetaInlines [Str "G."])])]),("id",MetaInlines [Str "itemA10"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Singh"]),("given",MetaInlines [Str "Y."])])]),("id",MetaInlines [Str "itemA11"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Singh",Space,Str "Siddhu"]),("given",MetaInlines [Str "N."])])]),("id",MetaInlines [Str "itemA12"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Villafuerte"]),("given",MetaInlines [Str "S.",Space,Str "A."])])]),("id",MetaInlines [Str "itemA13"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Villa-Lobos"]),("given",MetaInlines [Str "J."])])]),("id",MetaInlines [Str "itemA14"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macalister"]),("given",MetaInlines [Str "Donald"])])]),("id",MetaInlines [Str "itemB1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "MacAlister"]),("given",MetaInlines [Str "Paul"])])]),("id",MetaInlines [Str "itemB2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macauley"]),("given",MetaInlines [Str "Catharine"])])]),("id",MetaInlines [Str "itemB3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macmillan"]),("given",MetaInlines [Str "Harold"])])]),("id",MetaInlines [Str "itemB4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Madison"]),("given",MetaInlines [Str "James"])])]),("id",MetaInlines [Str "itemB5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McAllister"]),("given",MetaInlines [Str "Ward"])])]),("id",MetaInlines [Str "itemB6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McAuley"]),("given",MetaInlines [Str "Catherine"])])]),("id",MetaInlines [Str "itemB7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McMillan"]),("given",MetaInlines [Str "Edwin",Space,Str "M."])])]),("id",MetaInlines [Str "itemB8"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Sainte-Beuve"]),("given",MetaInlines [Str "Charles-Augustin"])])]),("id",MetaInlines [Str "itemC1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Saint-Gaudens"]),("given",MetaInlines [Str "Augustus"])])]),("id",MetaInlines [Str "itemC2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Saint-Sa\235ns"]),("given",MetaInlines [Str "Camille"])])]),("id",MetaInlines [Str "itemC3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("dropping-particle",MetaInlines [Str "de"]),("family",MetaInlines [Str "San",Space,Str "Martin"]),("given",MetaInlines [Str "Jos\233"])])]),("id",MetaInlines [Str "itemC4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "St.\160Denis"]),("given",MetaInlines [Str "Ruth"])])]),("id",MetaInlines [Str "itemC5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "St.\160Laurent"]),("given",MetaInlines [Str "Louis",Space,Str "Stephen"])])]),("id",MetaInlines [Str "itemC6"])])])]})
+[Para [Str "Foo",Space,Cite [Citation {citationId = "itemA1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 1},Citation {citationId = "itemA2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 2},Citation {citationId = "itemA3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 3},Citation {citationId = "itemA4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 4},Citation {citationId = "itemA5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 5},Citation {citationId = "itemA6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 6},Citation {citationId = "itemA7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 7},Citation {citationId = "itemA8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 8},Citation {citationId = "itemA9", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 9},Citation {citationId = "itemA10", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 10},Citation {citationId = "itemA11", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 11},Citation {citationId = "itemA12", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 12},Citation {citationId = "itemA13", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 13},Citation {citationId = "itemA14", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 14}] [Str "(Benjamin,",Space,Str "n.d.;",Space,Str "ben",Space,Str "Yaakov,",Space,Str "n.d.;",Space,Str "Brown,",Space,Str "n.d.;",Space,Str "Browning,",Space,Str "n.d.;",Space,Str "Girard,",Space,Str "n.d.;",Space,Str "Girard-Perregaux,",Space,Str "n.d.;",Space,Str "Ibn",Space,Str "Abdulaziz,",Space,Str "n.d.;",Space,Str "Ibn",Space,Str "Nidal,",Space,Str "n.d.;",Space,Str "Lo\769pez,",Space,Str "n.d.;",Space,Str "Lo\769pez",Space,Str "de",Space,Str "Molina,",Space,Str "n.d.;",Space,Str "Singh,",Space,Str "n.d.;",Space,Str "Singh",Space,Str "Siddhu,",Space,Str "n.d.;",Space,Str "Villafuerte,",Space,Str "n.d.;",Space,Str "Villa-Lobos,",Space,Str "n.d.)"],Str "."]
+,Para [Str "Foo",Space,Cite [Citation {citationId = "itemB1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 15},Citation {citationId = "itemB2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 16},Citation {citationId = "itemB3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 17},Citation {citationId = "itemB4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 18},Citation {citationId = "itemB5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 19},Citation {citationId = "itemB6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 20},Citation {citationId = "itemB7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 21},Citation {citationId = "itemB8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 22}] [Str "(Macalister,",Space,Str "n.d.;",Space,Str "MacAlister,",Space,Str "n.d.;",Space,Str "Macauley,",Space,Str "n.d.;",Space,Str "Macmillan,",Space,Str "n.d.;",Space,Str "Madison,",Space,Str "n.d.;",Space,Str "McAllister,",Space,Str "n.d.;",Space,Str "McAuley,",Space,Str "n.d.;",Space,Str "McMillan,",Space,Str "n.d.)"],Str "."]
+,Para [Str "Foo",Space,Cite [Citation {citationId = "itemC1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 23},Citation {citationId = "itemC2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 24},Citation {citationId = "itemC3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 25},Citation {citationId = "itemC4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 26},Citation {citationId = "itemC5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 27},Citation {citationId = "itemC6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 28}] [Str "(Sainte-Beuve,",Space,Str "n.d.;",Space,Str "Saint-Gaudens,",Space,Str "n.d.;",Space,Str "Saint-Sa\235ns,",Space,Str "n.d.;",Space,Str "San",Space,Str "Martin,",Space,Str "n.d.;",Space,Str "St.\160Denis,",Space,Str "n.d.;",Space,Str "St.\160Laurent,",Space,Str "n.d.)"],Str "."]
+,Div ("refs",["references"],[])
+ [Div ("ref-itemA1",[],[])
+ [Para [Str "Benjamin,",Space,Str "A.",Space,Str "S.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA2",[],[])
+ [Para [Str "ben",Space,Str "Yaakov,",Space,Str "D.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA3",[],[])
+ [Para [Str "Brown,",Space,Str "J.",Space,Str "R.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA4",[],[])
+ [Para [Str "Browning,",Space,Str "A.",Space,Str "R.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA5",[],[])
+ [Para [Str "Girard,",Space,Str "J.-B.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA6",[],[])
+ [Para [Str "Girard-Perregaux,",Space,Str "A.",Space,Str "S.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA7",[],[])
+ [Para [Str "Ibn",Space,Str "Abdulaziz,",Space,Str "T.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA8",[],[])
+ [Para [Str "Ibn",Space,Str "Nidal,",Space,Str "A.",Space,Str "K.",Space,Str "M.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA9",[],[])
+ [Para [Str "Lo\769pez,",Space,Str "M.",Space,Str "E.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA10",[],[])
+ [Para [Str "Lo\769pez",Space,Str "de",Space,Str "Molina,",Space,Str "G.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB1",[],[])
+ [Para [Str "Macalister,",Space,Str "D.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB2",[],[])
+ [Para [Str "MacAlister,",Space,Str "P.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB3",[],[])
+ [Para [Str "Macauley,",Space,Str "C.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB4",[],[])
+ [Para [Str "Macmillan,",Space,Str "H.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB5",[],[])
+ [Para [Str "Madison,",Space,Str "J.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB6",[],[])
+ [Para [Str "McAllister,",Space,Str "W.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB7",[],[])
+ [Para [Str "McAuley,",Space,Str "C.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemB8",[],[])
+ [Para [Str "McMillan,",Space,Str "E.",Space,Str "M.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC1",[],[])
+ [Para [Str "Sainte-Beuve,",Space,Str "C.-A.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC2",[],[])
+ [Para [Str "Saint-Gaudens,",Space,Str "A.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC3",[],[])
+ [Para [Str "Saint-Sa\235ns,",Space,Str "C.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC4",[],[])
+ [Para [Str "San",Space,Str "Martin,",Space,Str "J.",Space,Str "de.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA11",[],[])
+ [Para [Str "Singh,",Space,Str "Y.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA12",[],[])
+ [Para [Str "Singh",Space,Str "Siddhu,",Space,Str "N.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC5",[],[])
+ [Para [Str "St.\160Denis,",Space,Str "R.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemC6",[],[])
+ [Para [Str "St.\160Laurent,",Space,Str "L.",Space,Str "S.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA13",[],[])
+ [Para [Str "Villafuerte,",Space,Str "S.",Space,Str "A.",Space,Str "(n.d.)."]]
+ ,Div ("ref-itemA14",[],[])
+ [Para [Str "Villa-Lobos,",Space,Str "J.",Space,Str "(n.d.)."]]]]
diff --git a/tests/issue320.in.native b/tests/issue320.in.native
new file mode 100644
index 0000000..c69c53b
--- /dev/null
+++ b/tests/issue320.in.native
@@ -0,0 +1,4 @@
+Pandoc (Meta {unMeta = fromList [("csl",MetaInlines [Str "tests/apa.csl"]),("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Benjamin"]),("given",MetaInlines [Str "A.",Space,Str "S."])])]),("id",MetaInlines [Str "itemA1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Yaakov"]),("given",MetaInlines [Str "D."]),("non-dropping-particle",MetaInlines [Str "ben"])])]),("id",MetaInlines [Str "itemA2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Brown"]),("given",MetaInlines [Str "J.",Space,Str "R."])])]),("id",MetaInlines [Str "itemA3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Browning"]),("given",MetaInlines [Str "A.",Space,Str "R."])])]),("id",MetaInlines [Str "itemA4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Girard"]),("given",MetaInlines [Str "J.-B."])])]),("id",MetaInlines [Str "itemA5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Girard-Perregaux"]),("given",MetaInlines [Str "A.",Space,Str "S."])])]),("id",MetaInlines [Str "itemA6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Ibn",Space,Str "Abdulaziz"]),("given",MetaInlines [Str "T."])])]),("id",MetaInlines [Str "itemA7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Ibn",Space,Str "Nidal"]),("given",MetaInlines [Str "A.",Space,Str "K.",Space,Str "M."])])]),("id",MetaInlines [Str "itemA8"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Lo\769pez"]),("given",MetaInlines [Str "M.",Space,Str "E."])])]),("id",MetaInlines [Str "itemA9"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Lo\769pez",Space,Str "de",Space,Str "Molina"]),("given",MetaInlines [Str "G."])])]),("id",MetaInlines [Str "itemA10"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Singh"]),("given",MetaInlines [Str "Y."])])]),("id",MetaInlines [Str "itemA11"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Singh",Space,Str "Siddhu"]),("given",MetaInlines [Str "N."])])]),("id",MetaInlines [Str "itemA12"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Villafuerte"]),("given",MetaInlines [Str "S.",Space,Str "A."])])]),("id",MetaInlines [Str "itemA13"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Villa-Lobos"]),("given",MetaInlines [Str "J."])])]),("id",MetaInlines [Str "itemA14"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macalister"]),("given",MetaInlines [Str "Donald"])])]),("id",MetaInlines [Str "itemB1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "MacAlister"]),("given",MetaInlines [Str "Paul"])])]),("id",MetaInlines [Str "itemB2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macauley"]),("given",MetaInlines [Str "Catharine"])])]),("id",MetaInlines [Str "itemB3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Macmillan"]),("given",MetaInlines [Str "Harold"])])]),("id",MetaInlines [Str "itemB4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Madison"]),("given",MetaInlines [Str "James"])])]),("id",MetaInlines [Str "itemB5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McAllister"]),("given",MetaInlines [Str "Ward"])])]),("id",MetaInlines [Str "itemB6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McAuley"]),("given",MetaInlines [Str "Catherine"])])]),("id",MetaInlines [Str "itemB7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "McMillan"]),("given",MetaInlines [Str "Edwin",Space,Str "M."])])]),("id",MetaInlines [Str "itemB8"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Sainte-Beuve"]),("given",MetaInlines [Str "Charles-Augustin"])])]),("id",MetaInlines [Str "itemC1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Saint-Gaudens"]),("given",MetaInlines [Str "Augustus"])])]),("id",MetaInlines [Str "itemC2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Saint-Sa\235ns"]),("given",MetaInlines [Str "Camille"])])]),("id",MetaInlines [Str "itemC3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("dropping-particle",MetaInlines [Str "de"]),("family",MetaInlines [Str "San",Space,Str "Martin"]),("given",MetaInlines [Str "Jos\233"])])]),("id",MetaInlines [Str "itemC4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "St.\160Denis"]),("given",MetaInlines [Str "Ruth"])])]),("id",MetaInlines [Str "itemC5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "St.\160Laurent"]),("given",MetaInlines [Str "Louis",Space,Str "Stephen"])])]),("id",MetaInlines [Str "itemC6"])])])]})
+[Para [Str "Foo",Space,Cite [Citation {citationId = "itemA1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA9", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA10", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA11", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA12", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA13", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemA14", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@itemA1;",Space,Str "@itemA2;",Space,Str "@itemA3;",Space,Str "@itemA4;",Space,Str "@itemA5;",Space,Str "@itemA6;",Space,Str "@itemA7;",Space,Str "@itemA8;",Space,Str "@itemA9;",Space,Str "@itemA10;",Space,Str "@itemA11;",Space,Str "@itemA12;",Space,Str "@itemA13;",Space,Str "@itemA14]"],Str "."]
+,Para [Str "Foo",Space,Cite [Citation {citationId = "itemB1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemB8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@itemB1;",Space,Str "@itemB2;",Space,Str "@itemB3;",Space,Str "@itemB4;",Space,Str "@itemB5;",Space,Str "@itemB6;",Space,Str "@itemB7;",Space,Str "@itemB8]"],Str "."]
+,Para [Str "Foo",Space,Cite [Citation {citationId = "itemC1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemC2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemC3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemC4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemC5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "itemC6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@itemC1;",Space,Str "@itemC2;",Space,Str "@itemC3;",Space,Str "@itemC4;",Space,Str "@itemC5;",Space,Str "@itemC6]"],Str "."]]
diff --git a/tests/issue320a.expected.native b/tests/issue320a.expected.native
new file mode 100644
index 0000000..bd5a4a1
--- /dev/null
+++ b/tests/issue320a.expected.native
@@ -0,0 +1,19 @@
+Pandoc (Meta {unMeta = fromList [("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\702Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "ayn"])])]),("id",MetaInlines [Str "item1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\703Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "hamza"])])]),("id",MetaInlines [Str "item2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "'Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "straight",Space,Str "apostrophe"])])]),("id",MetaInlines [Str "item3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\8216Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "inverted",Space,Str "apostrophe",Space,Str "=",Space,Str "opening",Space,Str "single",Space,Str "curly",Space,Str "quote",Space,Str "(for",Space,Str "ayn)"])])]),("id",MetaInlines [Str "item4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\8217Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "apostrophe",Space,Str "=",Space,Str "closing",Space,Str "single",Space,Str "curly",Space,Str "quote",Space,Str "(for",Space,Str "hamza)"])])]),("id",MetaInlines [Str "item5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Uch"]),("given",MetaInlines [Str "Ann"])])]),("id",MetaInlines [Str "item6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Uebel"]),("given",MetaInlines [Str "Joe"])])]),("id",MetaInlines [Str "item7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Zzz"]),("given",MetaInlines [Str "Zoe"])])]),("id",MetaInlines [Str "item8"])])])]})
+[Para [Str "Foo",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 1},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 2},Citation {citationId = "item3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 3},Citation {citationId = "item4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 4},Citation {citationId = "item5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 5},Citation {citationId = "item6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 6},Citation {citationId = "item7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 7},Citation {citationId = "item8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 8}] [Str "(al-\702Udhr\299,",Space,Str "n.d.;",Space,Str "al-\703Udhr\299,",Space,Str "n.d.;",Space,Str "al-'Udhr\299,",Space,Str "n.d.;",Space,Str "al-\8216Udhr\299,",Space,Str "n.d.;",Space,Str "al-\8217Udhr\299,",Space,Str "n.d.;",Space,Str "Uch,",Space,Str "n.d.;",Space,Str "Uebel,",Space,Str "n.d.;",Space,Str "Zzz,",Space,Str "n.d.)"],Str "."]
+,Div ("refs",["references"],[])
+ [Div ("ref-item6",[],[])
+ [Para [Str "Uch,",Space,Str "Ann.",Space,Str "n.d."]]
+ ,Div ("ref-item1",[],[])
+ [Para [Str "\702Udhr\299,",Space,Str "Jam\299l",Space,Str "al-.",Space,Str "n.d."]]
+ ,Div ("ref-item2",[],[])
+ [Para [Str "\703Udhr\299,",Space,Str "Jam\299l",Space,Str "al-.",Space,Str "n.d."]]
+ ,Div ("ref-item3",[],[])
+ [Para [Str "'Udhr\299,",Space,Str "Jam\299l",Space,Str "al-.",Space,Str "n.d."]]
+ ,Div ("ref-item4",[],[])
+ [Para [Str "\8216Udhr\299,",Space,Str "Jam\299l",Space,Str "al-.",Space,Str "n.d."]]
+ ,Div ("ref-item5",[],[])
+ [Para [Str "\8217Udhr\299,",Space,Str "Jam\299l",Space,Str "al-.",Space,Str "n.d."]]
+ ,Div ("ref-item7",[],[])
+ [Para [Str "Uebel,",Space,Str "Joe.",Space,Str "n.d."]]
+ ,Div ("ref-item8",[],[])
+ [Para [Str "Zzz,",Space,Str "Zoe.",Space,Str "n.d."]]]]
diff --git a/tests/issue320a.in.native b/tests/issue320a.in.native
new file mode 100644
index 0000000..93d9ee1
--- /dev/null
+++ b/tests/issue320a.in.native
@@ -0,0 +1,2 @@
+Pandoc (Meta {unMeta = fromList [("references",MetaList [MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\702Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "ayn"])])]),("id",MetaInlines [Str "item1"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\703Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "hamza"])])]),("id",MetaInlines [Str "item2"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "'Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "straight",Space,Str "apostrophe"])])]),("id",MetaInlines [Str "item3"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\8216Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "inverted",Space,Str "apostrophe",Space,Str "=",Space,Str "opening",Space,Str "single",Space,Str "curly",Space,Str "quote",Space,Str "(for",Space,Str "ayn)"])])]),("id",MetaInlines [Str "item4"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "\8217Udhr\299"]),("given",MetaInlines [Str "Jam\299l"]),("non-dropping-particle",MetaInlines [Str "al-"]),("note",MetaInlines [Str "apostrophe",Space,Str "=",Space,Str "closing",Space,Str "single",Space,Str "curly",Space,Str "quote",Space,Str "(for",Space,Str "hamza)"])])]),("id",MetaInlines [Str "item5"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Uch"]),("given",MetaInlines [Str "Ann"])])]),("id",MetaInlines [Str "item6"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Uebel"]),("given",MetaInlines [Str "Joe"])])]),("id",MetaInlines [Str "item7"])]),MetaMap (fromList [("author",MetaList [MetaMap (fromList [("family",MetaInlines [Str "Zzz"]),("given",MetaInlines [Str "Zoe"])])]),("id",MetaInlines [Str "item8"])])])]})
+[Para [Str "Foo",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item4", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item5", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item6", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item7", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item8", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@item1;",Space,Str "@item2;",Space,Str "@item3;",Space,Str "@item4;",Space,Str "@item5;",Space,Str "@item6;",Space,Str "@item7;",Space,Str "@item8]"],Str "."]]
diff --git a/tests/jats.csl b/tests/jats.csl
deleted file mode 100644
index 6487286..0000000
--- a/tests/jats.csl
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US">
- <info>
- <title>Journal Article Tag Suite</title>
- <title-short>JATS</title-short>
- <id>http://www.zotero.org/styles/journal-article-tag-suite</id>
- <link href="https://github.com/MartinPaulEve/JATS-CSL/blob/master/jats.csl" rel="self"/>
- <link rel="documentation" href="http://jats.nlm.nih.gov/archiving/tag-library/1.0/index.html"/>
- <author>
- <name>Martin Paul Eve</name>
- <email>martin@martineve.com</email>
- </author>
- <category citation-format="numeric"/>
- <category field="medicine"/>
- <category field="biology"/>
- <summary>Use this style to generate bibliographic data in Journal Article Tagging Suite (JATS) 1.0 XML format</summary>
- <updated>2014-06-21T17:41:26+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. Originally by Martin Fenner.</rights>
- </info>
- <locale xml:lang="en">
- <terms>
- <term name="et-al">{{jats}}&lt;etal/&gt;{{/jats}}</term>
- </terms>
- </locale>
- <macro name="citation-number">
- <text variable="citation-number" prefix="{{jats}}id=&quot;ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
- </macro>
- <macro name="author">
- <names variable="author">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
- </name>
- <substitute>
- <names variable="editor"/>
- </substitute>
- </names>
- </macro>
-
- <macro name="editor">
- <names variable="editor" prefix="{{jats}}&lt;person-group person-group-type=&quot;editor&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
- </name>
- <substitute>
- <names variable="editor"/>
- </substitute>
- </names>
- </macro>
-
- <macro name="editor">
- <group delimiter=": ">
- <names variable="editor">
- <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
- <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
- <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;given-names&gt;{{/jats}}"/>
- </name>
- </names>
- </group>
- </macro>
- <macro name="title">
- <choose>
- <if type="book" match="any">
- <group prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}">
- <text variable="title"/>
- </group>
- </if>
- <else>
- <group prefix="{{jats}}&lt;article-title&gt;{{/jats}}" suffix="{{jats}}&lt;/article-title&gt;{{/jats}}">
- <text variable="title"/>
- </group>
- </else>
- </choose>
- </macro>
- <macro name="container-title">
- <text variable="container-title" form="short" prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}"/>
- </macro>
- <macro name="publisher">
- <text variable="publisher" prefix="{{jats}}&lt;publisher-name&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-name&gt;{{/jats}}"/>
- <text variable="publisher-place" prefix="{{jats}}&lt;publisher-loc&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-loc&gt;{{/jats}}"/>
- </macro>
- <macro name="link">
- <choose>
- <if match="any" variable="DOI">
- <group prefix="{{jats}}&lt;pub-id pub-id-type=&quot;doi&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/pub-id&gt;{{/jats}}">
- <text variable="DOI"/>
- </group>
- </if>
- </choose>
- <choose>
- <if match="any" variable="PMID">
- <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;pmid&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
- <text variable="PMID" prefix="{{jats}}xlink:href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
- <text variable="PMID"/>
- </group>
- </if>
- </choose>
- <choose>
- <if variable="URL" match="any">
- <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;uri&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
- <text variable="URL" prefix="{{jats}}xlink:href=&quot;{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
- <text variable="URL"/>
- </group>
- </if>
- </choose>
- </macro>
- <macro name="date">
- <choose>
- <if type="article-journal article-magazine article-newspaper report patent book" match="any">
- <group prefix="{{jats}}&lt;date&gt;{{/jats}}" suffix="{{jats}}&lt;/date&gt;{{/jats}}">
- <date variable="issued">
- <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
- <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
- </date>
- </group>
- </if>
- <else>
- <group prefix="{{jats}}&lt;date-in-citation content-type=&quot;access-date&quot;{{/jats}}" suffix="{{jats}}&lt;/date-in-citation&gt;{{/jats}}">
- <date variable="accessed" prefix="{{jats}} iso-8601-date=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
- <date-part name="year"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
- <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
- </date>
- <date variable="accessed">
- <date-part name="day" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
- <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
- <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
- </date>
- </group>
- </else>
- </choose>
- </macro>
- <macro name="location">
- <choose>
- <if type="article-journal article-magazine" match="any">
- <text variable="volume" prefix="{{jats}}&lt;volume&gt;{{/jats}}" suffix="{{jats}}&lt;/volume&gt;{{/jats}}"/>
- <text variable="issue" prefix="{{jats}}&lt;issue&gt;{{/jats}}" suffix="{{jats}}&lt;/issue&gt;{{/jats}}"/>
- </if>
- </choose>
- <choose>
- <if type="article-journal article-magazine article-newspaper chapter" match="any">
- <text variable="page-first" prefix="{{jats}}&lt;fpage&gt;{{/jats}}" suffix="{{jats}}&lt;/fpage&gt;{{/jats}}"/>
- </if>
- </choose>
- </macro>
- <macro name="publication-type">
- <group prefix="{{jats}} publication-type=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
- <choose>
- <if type="article-journal article-magazine article-newspaper" match="any">
- <text value="journal"/>
- </if>
- <else-if type="book" match="any">
- <text value="book"/>
- </else-if>
- <else-if type="chapter" match="any">
- <text value="bookchapter"/>
- </else-if>
- <else-if type="dataset" match="any">
- <text value="dataset"/>
- </else-if>
- <else-if type="patent" match="any">
- <text value="patent"/>
- </else-if>
- <else-if type="report" match="any">
- <text value="report"/>
- </else-if>
- <else-if type="review" match="any">
- <text value="review"/>
- </else-if>
- <else>
- <text value="standard"/>
- </else>
- </choose>
- </group>
- </macro>
- <citation collapse="citation-number">
- <sort>
- <key variable="citation-number"/>
- </sort>
- <layout delimiter=",">
- <group prefix="{{jats}}&lt;xref ref-type=&quot;bibr&quot; rid=&quot;{{/jats}}" suffix="{{jats}}&lt;/xref&gt;{{/jats}}">
- <text variable="citation-number" prefix="{{jats}}ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
- <text variable="citation-number"/>
- </group>
- </layout>
- </citation>
- <bibliography sort-separator="">
- <layout>
- <group prefix="{{jats}}&lt;ref {{/jats}}" suffix="{{jats}}&lt;/ref&gt;{{/jats}}">
- <text macro="citation-number"/>
- <group prefix="{{jats}}&lt;element-citation{{/jats}}" suffix="{{jats}}&lt;/element-citation&gt;{{/jats}}">
- <text macro="publication-type"/>
- <text macro="author" prefix="{{jats}}&lt;person-group person-group-type=&quot;author&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}"/>
- <text macro="title" />
- <text macro="container-title"/>
- <text macro="editor"/>
- <text macro="publisher"/>
- <text macro="date"/>
- <text macro="location"/>
- <text macro="link"/>
- </group>
- </group>
- </layout>
- </bibliography>
-</style>
-