packages feed

pandoc-citeproc 0.11.1 → 0.11.1.1

raw patch · 23 files changed

+319/−55 lines, 23 filesdep ~containersdep ~xml-conduitPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: containers, xml-conduit

API changes (from Hackage documentation)

Files

changelog view
@@ -1,3 +1,17 @@+pandoc-citeproc (0.11.1.1)++  * Added containers to build deps for test-pandoc-citeproc.+  * Fix titlecase when a colon is inside an emph (#301).+  * Titlecasing: never lowercase anything except stop words (#301).+  * Text.CSL.Compat.Pandoc: disable `bracketed_spans` extension.+    We want to stay compatible with CSL standards, which understand a span+    tag but not the brackets.+  * Titlecase transform: start new sentence after ".".  "Foo bar. An essay."+  * Use set for short words lookup (performance).+  * Case transform:  recognize mixed upper+punct as all uppercase (#301).+    This helps with things like "N.R. Kerr".+  * Add 'static' Cabal flag.+ pandoc-citeproc (0.11.1)   * Don't produce ??? with empty suppress-author citation (#156).
compat/Text/CSL/Compat/Pandoc.hs view
@@ -19,6 +19,9 @@ import Data.ByteString as B import Text.Pandoc (Pandoc, ReaderOptions(..), def, WrapOption(..),         WriterOptions(..))+#if MIN_VERSION_pandoc(1,19,0)+import Text.Pandoc (Extension(..), pandocExtensions)+#endif import qualified Text.Pandoc as Pandoc import qualified Text.Pandoc.Process #if MIN_VERSION_pandoc(2,0,0)@@ -28,9 +31,9 @@ import Text.Pandoc.Class (runPure, runIO) import qualified Text.Pandoc.Class (fetchItem) import Control.Monad.Except (runExceptT, lift)-import Text.Pandoc.Extensions (extensionsFromList, Extension(..),-          pandocExtensions, disableExtension)+import Text.Pandoc.Extensions (extensionsFromList, disableExtension) #else+import Data.Set as Set import System.IO (stderr) import qualified Text.Pandoc.Shared (fetchItem) @@ -57,7 +60,9 @@ readNative = either mempty id . runPure . Pandoc.readNative def . T.pack  writeMarkdown = either mempty T.unpack . runPure . Pandoc.writeMarkdown-   def{ writerExtensions = disableExtension Ext_smart pandocExtensions,+   def{ writerExtensions = disableExtension Ext_smart $+                           disableExtension Ext_bracketed_spans $+                           pandocExtensions,         writerWrapText = WrapNone }  writePlain = either mempty T.unpack . runPure . Pandoc.writePlain def@@ -80,7 +85,13 @@  readNative = either mempty id . Pandoc.readNative -writeMarkdown = Pandoc.writeMarkdown def{ writerWrapText = WrapNone }+writeMarkdown = Pandoc.writeMarkdown def{+    writerWrapText = WrapNone+  , writerColumns = 72+#if MIN_VERSION_pandoc(1,19,0)+  , writerExtensions = Set.delete Ext_bracketed_spans pandocExtensions+#endif+  }  writePlain = Pandoc.writePlain def 
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name:               pandoc-citeproc-version:            0.11.1+version:            0.11.1.1 cabal-version:      >= 1.12 synopsis:           Supports using pandoc with citeproc @@ -71,6 +71,10 @@   description: Turn on debug tracing.   default:     False +flag static+  description: Use static linking.+  default:     False+ library     hs-source-dirs:   src, prelude, compat     exposed-modules:  Text.CSL.Pandoc@@ -106,7 +110,7 @@                       aeson >= 0.7 && < 1.3,                       text,                       vector,-                      xml-conduit >= 1.2 && < 1.6,+                      xml-conduit >= 1.2 && < 1.7,                       unordered-containers >= 0.2 && < 0.3,                       data-default,                       setenv >= 0.1 && < 0.2,@@ -156,6 +160,9 @@                       Prelude     default-language: Haskell2010     ghc-options:      -funbox-strict-fields -Wall -fno-warn-unused-do-bind+    if flag(static)+      ld-options:     -static -pthread+      ghc-options:    -funbox-strict-fields -Wall -fno-warn-unused-do-bind -fPIC     if flag(bibutils)        default-extensions: CPP        cpp-options:     -DUSE_BIBUTILS@@ -172,7 +179,7 @@   build-depends:  base >= 4, aeson, directory, text, mtl,                   pandoc-types >= 1.16 && < 1.18,                   pandoc >= 1.16 && < 2.1,-                  filepath,+                  filepath, containers,                   bytestring, pandoc-citeproc, process, temporary >= 1.1,                   yaml >= 0.8.8.7, containers >= 0.4, vector >= 0.10   ghc-options:    -funbox-strict-fields -Wall -fno-warn-unused-do-bind@@ -187,7 +194,7 @@   Hs-Source-Dirs: tests, prelude, compat   build-depends:  base >= 4, aeson, directory, text,                   pandoc-types >= 1.16 && < 1.18, mtl,-                  pandoc >= 1.16 && < 2.1, filepath,+                  pandoc >= 1.16 && < 2.1, filepath, containers,                   bytestring, pandoc-citeproc, process, temporary >= 1.1,                   yaml >= 0.8.8.7   ghc-options:    -funbox-strict-fields -Wall -fno-warn-unused-do-bind
src/Text/CSL/Input/Bibtex.hs view
@@ -27,7 +27,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Generic (bottomUp) import Data.List.Split (splitOn, splitWhen, wordsBy)-import Data.List (intercalate)+import Data.List (intercalate, foldl') import Data.Maybe import Data.Char (toLower, isUpper, toUpper, isDigit, isAlphaNum) import Control.Monad@@ -1223,7 +1223,7 @@ toLocale x            = x  concatWith :: Char -> [Formatted] -> Formatted-concatWith sep = Formatted . foldl go mempty . map unFormatted+concatWith sep = Formatted . foldl' go mempty . map unFormatted   where go :: [Inline] -> [Inline] -> [Inline]         go accum [] = accum         go accum s  = case reverse accum of
src/Text/CSL/Util.hs view
@@ -58,6 +58,7 @@ import Control.Monad.State import Data.Generics ( Typeable, Data, everywhere, everywhereM, mkM,                        everywhere', everything, mkT, mkQ )+import qualified Data.Set as Set import System.FilePath import System.Directory (doesFileExist) import qualified Data.Yaml.Builder as Y@@ -247,32 +248,38 @@                           case (x:xs) of                            s | not (isAscii x) -> Str s                              | isShortWord s   -> Str s-                             | all isUpper s   -> Str s+                             | all isUpperOrPunct s   -> Str s                              | isMixedCase s   -> Str s-                             | otherwise       -> Str (toUpper x:map toLower xs)+                             | otherwise       -> Str (toUpper x:xs)                         WordBoundary ->                           case (x:xs) of                            s | not (isAscii x) -> Str s-                             | all isUpper s   -> Str s+                             | all isUpperOrPunct s   -> Str s                              | isShortWord s   -> Str (map toLower s)                              | isMixedCase s   -> Str s-                             | otherwise       -> Str (toUpper x:map toLower xs)+                             | otherwise       -> Str (toUpper x:xs)                         SentenceBoundary ->-                           if isMixedCase (x:xs) || (all isUpper (x:xs))+                           if isMixedCase (x:xs) || (all isUpperOrPunct (x:xs))                               then Str (x:xs)                               else Str (toUpper x : xs)                         _ -> Str (x:xs)         tc (Span ("",["nocase"],[]) xs) = return $ Span ("",["nocase"],[]) xs         tc x = return x-        isShortWord  s = map toLower s `elem`-                      ["a","an","and","as","at","but","by","c","ca","d","de"-                      ,"down","et","for","from"-                      ,"in","into","nor","of","on","onto","or","over","so"-                      ,"the","till","to","up","van","von","via","with","yet"]+        isShortWord  s = map toLower s `Set.member` shortWords +shortWords :: Set.Set String+shortWords = Set.fromList+                 ["a","an","and","as","at","but","by","c","ca","d","de"+                 ,"down","et","for","from"+                 ,"in","into","nor","of","on","onto","or","over","so"+                 ,"the","till","to","up","van","von","via","with","yet"]+ isMixedCase :: String -> Bool isMixedCase xs = any isUpper xs && any isLower xs +isUpperOrPunct :: Char -> Bool+isUpperOrPunct c = isUpper c || isPunctuation c+ data CaseTransformState = WordBoundary                         | LastWordBoundary                         | SentenceBoundary@@ -285,16 +292,15 @@                modify (\st ->                  case st of                       SentenceBoundary -> SentenceBoundary-                      _                ->-                          case acc of-                                (Str [x]:_)-                                  | x `elem` "?!:"   -> SentenceBoundary-                                _                    -> WordBoundary)+                      _                -> WordBoundary)                return $ Space : acc         go acc LineBreak = do                put WordBoundary                return $ Space : acc         go acc (Str [c])+          | c `elem` ".?!:" = do+               put SentenceBoundary+               return $ Str [c] : acc           | c `elem` "-/\x2013\x2014\160" = do                put WordBoundary                return $ Str [c] : acc
stack.yaml view
@@ -9,13 +9,18 @@ - '.' - location:     git: https://github.com/jgm/pandoc.git-    commit: ae61d5f57dc8094eb40a9e83427db7fb02afcefb+    commit: 5849b89e52de64a5bbebbc815772ad6bbc883c1d   extra-dep: true extra-deps:+- texmath-0.9.4.2 - hslua-0.8.0-- skylighting-0.3.3+- skylighting-0.3.4.1 - cmark-gfm-0.1.1 - QuickCheck-2.10.0.1 - tasty-quickcheck-0.9.1 - haddock-library-1.4.3-resolver: lts-9.0+- pandoc-types-1.17.1+# needed for now:+- hs-bibutils-5.5+- rfc5051-0.1.0.3+resolver: lts-9.1
tests/biblio2yaml/book-averroes.biblatex view
@@ -66,7 +66,8 @@   title: The epistle on the possibility of conjunction with the active intellect by     Ibn Rushd with the commentary of Moses Narboni   title-short: Possibility of conjunction-  collection-title: '[Moreshet: Studies in Jewish History, Literature and Thought]{.nocase}'+  collection-title: '<span class="nocase">Moreshet: Studies in Jewish History, Literature+    and Thought</span>'   collection-number: '7'   publisher: Jewish Theological Seminary of America   publisher-place: New York
tests/biblio2yaml/incollection.biblatex view
@@ -112,8 +112,8 @@     given: Isadore   issued:   - year: '1979'-  title: The limitations of human knowledge according to Al-Farabi, [ibn Bajja]{.nocase},-    and Maimonides+  title: The limitations of human knowledge according to Al-Farabi, <span class="nocase">ibn+    Bajja</span>, and Maimonides   title-short: Limitations of human knowledge   container-title: Studies in medieval Jewish history and literature   publisher: Harvard University Press
tests/biblio2yaml/itzhaki.biblatex view
@@ -62,7 +62,8 @@   - year: '1996'     month: '3'     day: '11'-  title: Some remarks on ’[t Hooft’s]{.nocase} S-matrix for black holes+  title: Some remarks on ’<span class="nocase">t Hooft’s</span> S-matrix for black+    holes   version: '1'   annote: An online reference from arXiv. Note the eprint and eprinttype fields. Also     note that the arXiv reference is transformed into a clickable link if hyperref
tests/biblio2yaml/malinowski.biblatex view
@@ -49,7 +49,7 @@   issued:   - year: '1972'   title: 'Argonauts of the Western Pacific: An account of native enterprise and-    adventure in the [Archipelagoes of Melanesian New Guinea]{.nocase}'+    adventure in the <span class="nocase">Archipelagoes of Melanesian New Guinea</span>'   title-short: Argonauts   publisher: Routledge and Kegan Paul   publisher-place: London
tests/biblio2yaml/murray.biblatex view
@@ -85,7 +85,8 @@   issued:   - year: '1998'   title: 'Alkanethiolate gold cluster molecules with core diameters from 1.5 to-    5.2 [nm]{.nocase}: Core and monolayer properties as a function of core size'+    5.2 <span class="nocase">nm</span>: Core and monolayer properties as a function+    of core size'   title-short: Alkanethiolate gold cluster molecules   container-title: Langmuir   page: '17-30'
tests/biblio2yaml/pandoc-2/ctan.biblatex view
@@ -59,11 +59,11 @@     day: '1'   title: 'CTAN: The Comprehensive TeX Archive Network'   title-short: CTAN-  annote: This is an online entry. The [url]{.smallcaps}, which is given in the url-    field, is transformed into a clickable link if hyperref support has been enabled.-    Note the format of the urldate field (yyyy-mm-dd) in the database file. Also note-    the label field which may be used as a fallback by citation styles which need-    an author and/or a year+  annote: This is an online entry. The <span class="smallcaps">url</span>, which is+    given in the url field, is transformed into a clickable link if hyperref support+    has been enabled. Note the format of the urldate field (yyyy-mm-dd) in the database+    file. Also note the label field which may be used as a fallback by citation styles+    which need an author and/or a year   URL: http://www.ctan.org   language: en-US ...
tests/biblio2yaml/pandoc-2/formatting.biblatex view
@@ -10,6 +10,6 @@ references: - id: item1   type: article-journal-  title: 'The title: *Italics*, **bold**, ~subscript~, ^superscript^, [small-caps]{.smallcaps}'+  title: 'The title: *Italics*, **bold**, ~subscript~, ^superscript^, <span class="smallcaps">small-caps</span>'   title-short: The title ...
tests/biblio2yaml/pandoc-2/jaffe.biblatex view
@@ -66,7 +66,7 @@   - year: '1885'   - year: '1888'   title: Regesta Pontificum Romanorum ab condita ecclesia ad annum post Christum natum-    [mcxcviii]{.smallcaps}+    <span class="smallcaps">mcxcviii</span>   title-short: Regesta Pontificum Romanorum   publisher-place: Leipzig   number-of-volumes: '2'
tests/biblio2yaml/pandoc-2/kastenholz.biblatex view
@@ -92,7 +92,7 @@     from molecular simulations   container-title: J. Chem. Phys.   volume: '124'-  annote: An article entry with an eid and a doi field. Note that the [doi]{.smallcaps}+  annote: An article entry with an eid and a doi field. Note that the <span class="smallcaps">doi</span>     is transformed into a clickable link if hyperref support has been enabled   abstract: The computation of ionic solvation free energies from atomistic simulations     is a surprisingly difficult problem that has found no satisfactory solution for
tests/biblio2yaml/pandoc-2/online.biblatex view
@@ -57,11 +57,11 @@     day: '1'   title: 'CTAN: The Comprehensive TeX Archive Network'   title-short: CTAN-  annote: This is an online entry. The [url]{.smallcaps}, which is given in the url-    field, is transformed into a clickable link if hyperref support has been enabled.-    Note the format of the urldate field (yyyy-mm-dd) in the database file. Also note-    the label field which may be used as a fallback by citation styles which need-    an author and/or a year+  annote: This is an online entry. The <span class="smallcaps">url</span>, which is+    given in the url field, is transformed into a clickable link if hyperref support+    has been enabled. Note the format of the urldate field (yyyy-mm-dd) in the database+    file. Also note the label field which may be used as a fallback by citation styles+    which need an author and/or a year   URL: http://www.ctan.org   language: en-US ...
tests/biblio2yaml/pandoc-2/sigfridsson.biblatex view
@@ -79,8 +79,9 @@   page: '377-395'   volume: '19'   issue: '4'-  annote: An article entry with volume, number, and doi fields. Note that the [doi]{.smallcaps}-    is transformed into a clickable link if hyperref support has been enabled+  annote: An article entry with volume, number, and doi fields. Note that the <span+    class="smallcaps">doi</span> is transformed into a clickable link if hyperref+    support has been enabled   abstract: 'Four methods for deriving partial atomic charges from the quantum chemical     electrostatic potential (CHELP, CHELPG, Merz-Kollman, and RESP) have been compared     and critically evaluated. It is shown that charges strongly depend on how and
tests/biblio2yaml/pines.biblatex view
@@ -58,8 +58,8 @@     given: Isadore   issued:   - year: '1979'-  title: The limitations of human knowledge according to Al-Farabi, [ibn Bajja]{.nocase},-    and Maimonides+  title: The limitations of human knowledge according to Al-Farabi, <span class="nocase">ibn+    Bajja</span>, and Maimonides   title-short: Limitations of human knowledge   container-title: Studies in medieval Jewish history and literature   publisher: Harvard University Press
tests/biblio2yaml/test-case-conversion.biblatex view
@@ -59,9 +59,9 @@     given: Ann   issued:   - year: '2013'-  title: A title, in English, with a Proper Name and an ACRONYM and a [camelCase]{.nocase}-    word and some units, 400 [nm]{.nocase}, 3 [cm]{.nocase}, and a quote, *Alea [iacta-    est]{.nocase}*+  title: A title, in English, with a Proper Name and an ACRONYM and a <span class="nocase">camelCase</span>+    word and some units, 400 <span class="nocase">nm</span>, 3 <span class="nocase">cm</span>,+    and a quote, *Alea <span class="nocase">iacta est</span>*   container-title: Journal   language: en-US ...
tests/biblio2yaml/textnormal.biblatex view
@@ -6,5 +6,5 @@ references: - id: item1   type: book-  title: The title [of this book]{.nodecor}+  title: The title <span class="nodecor">of this book</span> ...
+ tests/issue301.expected.native view
@@ -0,0 +1,7 @@+Pandoc (Meta {unMeta = fromList [("references",MetaList [MetaMap (fromList [("id",MetaInlines [Str "test"]),("title",MetaInlines [Str "Essays",Space,Str "presented",Space,Str "to",Space,Str "N.R.",Space,Str "Ker",Space,Str "(On",Space,Str "Art)"])]),MetaMap (fromList [("id",MetaInlines [Str "test2"]),("title",MetaInlines [Emph [Str "Test:"],Space,Str "An",Space,Str "experiment:",Space,Str "An",Space,Str "abridgement"])])])]})+[Para [Cite [Citation {citationId = "test", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 1}] [Str "(",Str "\8220Essays",Space,Str "Presented",Space,Str "to",Space,Str "N.R.",Space,Str "Ker",Space,Str "(on",Space,Str "Art),\8221",Space,Str "n.d.)"],Str ";",Space,Cite [Citation {citationId = "test2", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 2}] [Str "(",Str "\8220",Emph [Str "Test:"],Space,Str "An",Space,Str "Experiment:",Space,Str "An",Space,Str "Abridgement,\8221",Space,Str "n.d.)"]]+,Div ("refs",["references"],[])+ [Div ("ref-test",[],[])+  [Para [Str "\8220",Str "Essays",Space,Str "Presented",Space,Str "to",Space,Str "N.R.",Space,Str "Ker",Space,Str "(on",Space,Str "Art).\8221",Space,Str "n.d."]]+ ,Div ("ref-test2",[],[])+  [Para [Str "\8220",Emph [Str "Test:"],Space,Str "An",Space,Str "Experiment:",Space,Str "An",Space,Str "Abridgement.\8221",Space,Str "n.d."]]]]
+ tests/issue301.in.native view
@@ -0,0 +1,2 @@+Pandoc (Meta {unMeta = fromList [("references",MetaList [MetaMap (fromList [("id",MetaInlines [Str "test"]),("title",MetaInlines [Str "Essays",Space,Str "presented",Space,Str "to",Space,Str "N.R.",Space,Str "Ker",Space,Str "(On",Space,Str "Art)"])]),MetaMap (fromList [("id",MetaInlines [Str "test2"]),("title",MetaInlines [Emph [Str "Test:"],Space,Str "An",Space,Str "experiment:",Space,Str "An",Space,Str "abridgement"])])])]})+[Para [Cite [Citation {citationId = "test", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@test"],Str ";",Space,Cite [Citation {citationId = "test2", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@test2"]]]
+ tests/jats.csl view
@@ -0,0 +1,208 @@+<?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>+