bundle IDS citation style as ids.csl and make it the default

Include the IDS citation style (based on the style developed for
ICLC-10 2023 in Mannheim) as resources/ids.csl and pass it to pandoc
unless the document specifies a csl of its own. Drop the now-redundant
remote csl URL from examples/ids.Rmd.

Change-Id: Iaaff300bfb9d9b7ea80471b73de3bf6019fb9f93
diff --git a/NEWS.md b/NEWS.md
index cb9f6de..160a1bb 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
 # revealjs.ids (development version)
 
+- Documents with a `bibliography:` in their YAML header are now formatted with the bundled IDS citation style by default (`ids.csl`, based on the style developed for ICLC-10 2023 in Mannheim). A `csl:` entry in the document's YAML header still takes precedence.
+
 - Speaker timing comments in the source `.Rmd` (e.g. `<!-- JD 00:30 -->` for "John Doe needs 30 seconds for this slide", or just `<!-- 00:30 -->` for single-speaker talks, ported from the old Google Docs workflow) are now converted into `data-timing` attributes on the rendered slides' `<section>` elements, activating the pacing timer in the reveal.js speaker view (the calculated grand total is passed as the `totalTime` config value; a `totalTime` or `defaultTiming` set by the document itself, e.g. to start from a known time budget, takes precedence). A per-speaker time summary is printed during rendering, and the new `slide_timing()` function computes slide, speaker, and grand totals directly from an `.Rmd` file without rendering it.
 
 - `ids` theme: bold ("highlighted") text now uses orange Fira Sans Condensed (600, 90% size) instead of just an orange colour in the serif body face, as in the IDS reference decks.
diff --git a/R/revealjs_presentation.R b/R/revealjs_presentation.R
index c35cdeb..950b8b8 100644
--- a/R/revealjs_presentation.R
+++ b/R/revealjs_presentation.R
@@ -119,6 +119,13 @@
 #'     toggleNotesButton: true
 #'     toggleChalkboardButton: true
 #' ```
+#' ## Bibliography and citations
+#' 
+#' Documents with a `bibliography:` in their YAML header are formatted with
+#' the bundled IDS citation style (`ids.csl`, based on the style developed
+#' for ICLC-10 2023 in Mannheim) by default. To use a different style,
+#' specify it as usual with `csl:` in the YAML header.
+#' 
 #' @inheritParams rmarkdown::beamer_presentation
 #' @inheritParams rmarkdown::pdf_document
 #' @inheritParams rmarkdown::html_document
@@ -380,6 +387,12 @@
     # highlight
     args <- c(args, pandoc_highlight_args(highlight, default = "pygments"))
 
+    # default to the bundled IDS citation style unless the document
+    # specifies a style of its own
+    if (is.null(metadata$csl)) {
+      args <- c(args, "--csl", pandoc_path_arg(reveal_resources("ids.csl")))
+    }
+
     # return additional args
     args
   }
diff --git a/README.Rmd b/README.Rmd
index be3d9f4..57e9cfa 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -489,7 +489,9 @@
 
 ## Bibliography and Appendix Slides
 
-When you cite with `[@key]` and set a `bibliography:` in the yaml header, pandoc/citeproc generates the reference list **at the very end of the document body**. That is fine when the references are your last content:
+When you cite with `[@key]` and set a `bibliography:` in the yaml header, the references are formatted with the bundled IDS citation style by default (based on the style developed for ICLC-10 2023 in Mannheim). To use a different style, specify it as usual with `csl:` in the yaml header.
+
+Pandoc/citeproc generates the reference list **at the very end of the document body**. That is fine when the references are your last content:
 
 ```markdown
 # References
diff --git a/README.md b/README.md
index 3b8752e..b3c2dab 100644
--- a/README.md
+++ b/README.md
@@ -594,7 +594,12 @@
 ## Bibliography and Appendix Slides
 
 When you cite with `[@key]` and set a `bibliography:` in the yaml
-header, pandoc/citeproc generates the reference list **at the very end
+header, the references are formatted with the bundled IDS citation
+style by default (based on the style developed for ICLC-10 2023 in
+Mannheim). To use a different style, specify it as usual with `csl:`
+in the yaml header.
+
+Pandoc/citeproc generates the reference list **at the very end
 of the document body**. That is fine when the references are your last
 content:
 
diff --git a/examples/ids.Rmd b/examples/ids.Rmd
index 4f6ea73..3339b44 100644
--- a/examples/ids.Rmd
+++ b/examples/ids.Rmd
@@ -21,7 +21,6 @@
         numbers: true
 lang: en
 bibliography: references.bib
-csl: "https://raw.githubusercontent.com/ICLC-10/Zotero/master/styles/ICLC-10.csl"
 ---
 
 ```{r setup, include=FALSE}
diff --git a/inst/rmarkdown/templates/revealjs_presentation/resources/ids.csl b/inst/rmarkdown/templates/revealjs_presentation/resources/ids.csl
new file mode 100644
index 0000000..8042de4
--- /dev/null
+++ b/inst/rmarkdown/templates/revealjs_presentation/resources/ids.csl
@@ -0,0 +1,331 @@
+<?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">
+  <info>
+    <title>ICLC-10 2023 (Mannheim)</title>
+    <id>http://www.zotero.org/styles/ICLC-10</id>
+    <link href="http://www.zotero.org/styles/ICLC-10" rel="self" />
+    <link href="http://www.zotero.org/styles/euralex-2022-mannheim" rel="template" />
+    <link href="http://www.zotero.org/styles/harvard-cite-them-right-11th-edition" rel="template" />
+    <author>
+      <name>Marc Kupietz</name>
+      <uri>https://orcid.org/0000-0001-8997-8256</uri>
+    </author>
+    <category citation-format="author-date" />
+    <category field="generic-base" />
+    <summary>Style for ICLC-10 (Mannheim) Conference Proceedings. Based on the style for Euralex 2022 (Mannheim) Conference Proceedings (https://github.com/elexis-eu/elexifinder) authored by David Lindemann (http://www.wikidata.org/entity/Q57694630). Based on "Cite Them Right 11th edition - Harvard", by Patrick O'Brien</summary>
+    <updated>2024-11-29T18:19:02+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="editor" form="short">
+        <single>ed.</single>
+        <multiple>eds.</multiple>
+      </term>
+      <term name="editortranslator" form="verb">edited and translated by</term>
+      <term name="edition" form="short">edn.</term>
+      <term name="in">In:</term>
+    </terms>
+  </locale>
+  <locale xml:lang="de">
+    <terms>
+      <term name="editor" form="short">
+        <single>Hg.</single>
+        <multiple>Hgg.</multiple>
+      </term>
+      <term name="editortranslator" form="verb">bearbeitet und übersetzt von</term>
+      <term name="edition" form="short">Ausg.</term>
+      <term name="et-al">et al.</term>
+      <term name="in">In:</term>
+    </terms>
+  </locale>
+  <macro name="editor">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <names variable="container-author" delimiter="/">
+          <name delimiter="/" delimiter-precedes-last="always" initialize="false" initialize-with=". " sort-separator="/" name-as-sort-order="all"/>
+        </names>
+        <choose>
+          <if variable="container-author" match="none">
+            <names variable="editor translator" delimiter="/">
+              <name delimiter="/" delimiter-precedes-last="always" initialize="false" initialize-with="." name-as-sort-order="all"/>
+              <label form="short" prefix=" (" suffix=")"/>
+            </names>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name delimiter="/" delimiter-precedes-last="always" initialize="false" initialize-with="."/>
+        </names>
+      </if>
+      <else-if variable="container-author" match="any">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name initialize="false" initialize-with=". " delimiter="/"/>
+        </names>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name delimiter="/" delimiter-precedes-last="always" initialize="false" initialize-with="." name-as-sort-order="all"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <choose>
+          <if type="article-newspaper article-magazine" match="any">
+            <text variable="container-title" text-case="title"/>
+          </if>
+          <else>
+            <text macro="title"/>
+          </else>
+        </choose>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" delimiter="/" delimiter-precedes-last="always" initialize="false" initialize-with=". "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <choose>
+          <if type="article-newspaper article-magazine" match="any">
+            <text variable="container-title" text-case="title"/>
+          </if>
+          <else>
+            <text macro="title"/>
+          </else>
+        </choose>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="DOI">
+        <text variable="DOI" prefix="https://doi.org/"/>
+      </if>
+      <else-if variable="URL">
+        <text variable="URL"/>
+        <choose>
+            <if type="chapter paper-conference article-journal article article-magazine book review review-book thesis" match="none">
+                <group prefix=" (" delimiter=": " suffix=")">
+                  <text value="last access"/>
+                  <date form="text" variable="accessed">
+                    <date-part name="day"/>
+                    <date-part name="month"/>
+                    <date-part name="year"/>
+                  </date>
+                </group>
+            </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="number-volumes">
+    <choose>
+      <if variable="volume" match="none">
+        <group delimiter=" " prefix="(" suffix=")">
+          <text variable="number-of-volumes"/>
+          <label variable="volume" form="short" strip-periods="true"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book legal_case legislation motion_picture report song thesis webpage graphic" match="any">
+        <group delimiter=". ">
+          <group delimiter=" ">
+            <group delimiter=" ">
+              <text variable="title"/>
+              <text variable="medium" prefix="[" suffix="]"/>
+            </group>
+            <text macro="number-volumes"/>
+          </group>
+          <text macro="edition"/>
+        </group>
+      </if>
+      <else>
+        <text variable="title" form="long"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="thesis">
+        <group delimiter=". ">
+          <text variable="genre"/>
+          <text variable="publisher"/>
+        </group>
+      </if>
+      <else-if type="report">
+        <group delimiter=". ">
+          <group delimiter=" ">
+            <text variable="genre"/>
+            <text variable="number"/>
+          </group>
+          <group delimiter=": ">
+            <text variable="publisher-place"/>
+            <text variable="publisher"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="article-journal article-newspaper article-magazine" match="none">
+        <group delimiter=" ">
+          <group delimiter=", ">
+            <choose>
+              <if type="speech" variable="event" match="any">
+                <text variable="event" font-style="italic"/>
+              </if>
+            </choose>
+            <group delimiter=": ">
+              <text variable="publisher-place"/>
+              <text variable="publisher"/>
+            </group>
+          </group>
+          <group prefix="(" suffix=")" delimiter=", ">
+            <text variable="collection-title"/>
+            <text variable="collection-number"/>
+          </group>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="year-date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+        <text variable="year-suffix"/>
+      </if>
+      <else>
+        <text term="no date"/>
+        <text variable="year-suffix" prefix=" "/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locator">
+    <choose>
+      <if type="article-journal">
+        <text variable="volume"/>
+        <text variable="issue" prefix="(" suffix=")"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="published-date">
+    <choose>
+      <if type="article-newspaper article-magazine post-weblog speech" match="any">
+        <date variable="issued">
+          <date-part name="day" suffix=" "/>
+          <date-part name="month" form="long"/>
+        </date>
+      </if>
+    </choose>
+  </macro>
+  <macro name="pages">
+    <choose>
+      <if type="chapter paper-conference article-journal article article-magazine article-newspaper book review review-book report" match="any">
+        <group delimiter=" ">
+          <label variable="page" form="short"/>
+          <text variable="page"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if variable="container-title">
+        <group delimiter=". ">
+          <group delimiter=" ">
+            <text variable="container-title"/>
+          </group>
+          <text macro="edition"/>
+        </group>
+      </if>
+      <else>
+        <choose>
+            <if type="speech" variable="event" match="any">
+                <text variable="event"/>
+            </if>
+        </choose>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <text term="edition" form="short" strip-periods="true"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="container-prefix">
+    <choose>
+      <if type="chapter paper-conference article-journal article article-magazine article-newspaper" match="any">
+        <text term="in"/>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year">
+    <sort>
+      <key macro="year-date"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <group delimiter=" ">
+          <text macro="author-short"/>
+          <text macro="year-date"/>
+        </group>
+        <group>
+          <label variable="locator" form="short" suffix=" "/>
+          <text variable="locator"/>
+        </group>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="1">
+    <sort>
+      <key macro="author"/>
+      <key macro="year-date"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <group delimiter=" ">
+          <text macro="author"/>
+          <text macro="year-date" prefix="(" suffix="):"/>
+          <group delimiter=". ">
+            <text macro="title"/>
+            <group delimiter=" ">
+              <text macro="container-prefix"/>
+              <text macro="editor" suffix=":"/>
+              <text macro="container-title"/>
+            </group>
+          </group>
+        </group>
+        <text macro="secondary-contributors"/>
+        <text macro="publisher"/>
+      </group>
+      <group delimiter=", " prefix=", ">
+        <text macro="locator"/>
+        <text macro="published-date"/>
+        <text macro="pages"/>
+      </group>
+      <text macro="access" prefix=". "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/man/revealjs_presentation.Rd b/man/revealjs_presentation.Rd
index ba10ef0..827370e 100644
--- a/man/revealjs_presentation.Rd
+++ b/man/revealjs_presentation.Rd
@@ -268,6 +268,14 @@
     toggleChalkboardButton: true
 }\if{html}{\out{</div>}}
 }
+
+\subsection{Bibliography and citations}{
+
+Documents with a \verb{bibliography:} in their YAML header are formatted with
+the bundled IDS citation style (\code{ids.csl}, based on the style developed
+for ICLC-10 2023 in Mannheim) by default. To use a different style,
+specify it as usual with \verb{csl:} in the YAML header.
+}
 }
 
 \examples{