Thanks for your help with this. Adding the xml:id didn't change the issue, I think you're probably right that slides are not numbered.
I know that <slide> as an element of <book> is not officially supported, and I don't think it makes sense to keep the slides all together in a book for the long term. I'll just go crazy if I need to keep going between a dozen different PreTeXt documents as I try to put them together, and a nice feature of PreTeXt is it lets the reader easily switch between focusing on the big and small picture.
My hope was to create an xsl file to extend the pretext-html.xsl that would help with this use case.
Playing around with pretext-html.xsl, I have found that the following file causes the numbering errors to go away, but it no longer formats the titles of the slides as bold. I found both blocks of code by searching pretext-html.xsl for "paragraphs", since they are un-numbered.
I've tried copying all the rows where the match includes "paragraphs" and changing it to match="slides". Is there more going on behind the scenes than I realize?
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:import href="./core/pretext-html.xsl"/>
<xsl:template match="slide">
<xsl:param name="b-original" select="true()" />
<xsl:variable name="hidden">
<xsl:apply-templates select="." mode="is-hidden" />
</xsl:variable>
<xsl:choose>
<!-- born-hidden case -->
<xsl:when test="$hidden = 'true'">
<xsl:apply-templates select="." mode="born-hidden">
<xsl:with-param name="b-original" select="$b-original" />
</xsl:apply-templates>
</xsl:when>
<!-- born-visible case -->
<xsl:otherwise>
<!-- pass-thru of b-original mandatory -->
<xsl:apply-templates select="." mode="born-visible">
<xsl:with-param name="b-original" select="$b-original" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- All of the implementations above use the same -->
<!-- template for their body, it relies on various -->
<!-- templates but most of the work comes via the -->
<!-- "wrapped-content" template. Here is that -->
<!-- "body" template. The items in the "match" -->
<!-- are in the order presented above: simple first, -->
<!-- and top-down when components are also knowled. -->
<xsl:template match="paragraphs" mode="body">
<xsl:param name="b-original" select="true()"/>
<xsl:param name="block-type"/>
<!-- prelude beforehand, when original -->
<xsl:if test="$b-original">
<xsl:apply-templates select="prelude">
<xsl:with-param name="b-original" select="$b-original" />
</xsl:apply-templates>
</xsl:if>
<xsl:variable name="body-elt">
<xsl:apply-templates select="." mode="body-element" />
</xsl:variable>
<xsl:element name="{$body-elt}">
<xsl:attribute name="class">
<xsl:apply-templates select="." mode="body-css-class" />
<xsl:if test="$block-type = 'hidden'">
<xsl:text> knowl__content</xsl:text>
</xsl:if>
</xsl:attribute>
<!-- Label original, but not if embedded -->
<!-- Then id goes onto the knowl text, so locatable -->
<xsl:if test="$b-original and not($block-type = 'hidden')">
<xsl:apply-templates select="." mode="html-id-attribute"/>
<xsl:apply-templates select="." mode="permid-attribute"/>
</xsl:if>
<!-- If visible, heading interior to article -->
<xsl:if test="$block-type = 'visible'">
<xsl:apply-templates select="." mode="heading-birth" />
</xsl:if>
<!-- If xref-knowl, heading interior to article -->
<xsl:if test="$block-type = 'xref'">
<xsl:apply-templates select="." mode="heading-xref-knowl" />
</xsl:if>
<!-- After the heading, and before the actual guts, we -->
<!-- sometimes annotate with a knowl showing the source -->
<!-- of the current element. This calls a stub, unless -->
<!-- a separate stylesheet is used to define the template, -->
<!-- and the method is defined there. An "fn" necessarily -->
<!-- comes through here since it is realized as a knowl, -->
<!-- but it is a silly thing to annotate. We skip it -->
<!-- promptly on the receiving end, instead of adding -->
<!-- clutter here. -->
<xsl:apply-templates select="." mode="view-source-knowl"/>
<!-- Then actual content, respecting b-original flag -->
<!-- Pass $block-type for Sage cells to know environs -->
<xsl:apply-templates select="." mode="wrapped-content">
<xsl:with-param name="b-original" select="$b-original" />
<xsl:with-param name="block-type" select="$block-type" />
</xsl:apply-templates>
</xsl:element>
<!-- postlude afterward, when original -->
<xsl:if test="$b-original">
<xsl:apply-templates select="postlude">
<xsl:with-param name="b-original" select="$b-original" />
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<!-- TEMPORARY: var/li is a WeBWorK popup or radio button, -->
<!-- which is not a cross-reference target (it originates -->
<!-- in PG-code), and an error results when the heading in -->
<!-- the knowl content tries to compute a number -->
<xsl:template match="slide" mode="xref-as-knowl">
<xsl:param name="link" select="/.." />
<xsl:choose>
<xsl:when test="$b-skip-knowls or $html-xref-knowled = 'never'">
<xsl:value-of select="false()"/>
</xsl:when>
<xsl:when test="$html-xref-knowled = 'maximum'">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:otherwise>
<!-- Case $html-xref-knowled = 'cross-page' -->
<!-- Find the nearest common ancestor of the link and target -->
<xsl:variable name="nearest-common-ancestor"
select="./ancestor::*[count(. | $link/ancestor::*) = count($link/ancestor::*)] [1]"/>
<xsl:variable name="nearest-ancestor-level">
<xsl:apply-templates select="$nearest-common-ancestor" mode="enclosing-level"/>
</xsl:variable>
<!-- remove not(), replace operator with <, then radically different behavior -->
<xsl:value-of select="not($nearest-ancestor-level >= $chunk-level)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Paragraphs -->
<!-- Technically a division, but small enough to xref knowl -->
<!-- Never born-hidden, does not make sense -->
<xsl:template match="slide" mode="is-hidden">
<xsl:text>false</xsl:text>
</xsl:template>
<!-- Overall enclosing element -->
<xsl:template match="slide" mode="body-element">
<xsl:text>section</xsl:text>
</xsl:template>
<!-- And its CSS class -->
<xsl:template match="slide" mode="body-css-class">
<xsl:value-of select="local-name()"/>
</xsl:template>
<!-- When born use this heading -->
<xsl:template match="slide" mode="heading-birth">
<xsl:apply-templates select="." mode="heading-title-paragraphs" />
</xsl:template>
<!-- Heading for interior of xref-knowl content -->
<xsl:template match="slide" mode="heading-xref-knowl">
<xsl:apply-templates select="." mode="heading-title-paragraphs" />
</xsl:template>
<!-- Primary content of generic "body" template -->
<!-- Pass along b-original flag -->
<!-- Simply process contents, could restrict here -->
<xsl:template match="slide" mode="wrapped-content">
<xsl:param name="b-original" select="true()" />
<xsl:apply-templates>
<xsl:with-param name="b-original" select="$b-original" />
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>