pretext icon indicating copy to clipboard operation
pretext copied to clipboard

images in slides don't support width

Open kcrisman opened this issue 2 years ago • 0 comments

I don't think an issue has been opened for this yet.

The normal html conversion supports image width being specified, at least for images not part of a side-by-side (probably there too). This is extremely useful for revealjs slides, since often otherwise the "native" image width would preclude very much text on a slide. However, this is overridden in the revealjs template here.

A stupidly naive fix I am currently using is this. (See also #1889.) However, I presume it would not handle side-by-side and other things. More to the point, probably the code for images in slides should reuse at least some of the html code. But as far as I can tell from my limited knowledge of the recursive nature of xsltproc, it's completely overridden.

 <xsl:template match="image">
   <img>
+    <xsl:attribute name="style">
+    <xsl:text>width: </xsl:text>
+    <xsl:value-of select="@width" />
+    </xsl:attribute>
+    <xsl:attribute name="alt">
+      <xsl:apply-templates select="description" />
+    </xsl:attribute>
     <xsl:attribute name="src">
         <xsl:value-of select="@source" />
     </xsl:attribute>

kcrisman avatar Jan 02 '23 20:01 kcrisman