Skip to content

Commit

Permalink
Handle footnotes smarter with aligned divisions
Browse files Browse the repository at this point in the history
If only one side has footnotes, don't use two columns for those notes.
  • Loading branch information
jhellingman committed Sep 21, 2024
1 parent d5a65bb commit a1cc62b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 14 deletions.
53 changes: 39 additions & 14 deletions modules/divisions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -816,20 +816,45 @@

<!-- Include footnotes if at div1 level (for both sides) -->
<xsl:if test="$a/../div1">
<xsl:if test="$a//note[f:is-footnote(.)] or $b//note[f:is-footnote(.)]">
<tr>
<td class="first">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$a"/>
</xsl:call-template>
</td>
<td class="second">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$b"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
<xsl:choose>
<!-- Only footnotes on left-hand side -->
<xsl:when test="$a//note[f:is-footnote(.)] and not($b//note[f:is-footnote(.)])">
<tr>
<td colspan="2">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$a"/>
</xsl:call-template>
</td>
</tr>
</xsl:when>

<!-- Only footnotes on right-hand side -->
<xsl:when test="not($a//note[f:is-footnote(.)]) and $b//note[f:is-footnote(.)]">
<tr>
<td colspan="2">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$b"/>
</xsl:call-template>
</td>
</tr>
</xsl:when>

<!-- Footnotes on either side -->
<xsl:when test="$a//note[f:is-footnote(.)] or $b//note[f:is-footnote(.)]">
<tr>
<td class="first">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$a"/>
</xsl:call-template>
</td>
<td class="second">
<xsl:call-template name="insert-footnotes">
<xsl:with-param name="div" select="$b"/>
</xsl:call-template>
</td>
</tr>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>

Expand Down
1 change: 1 addition & 0 deletions style/aligned-text.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

table.alignedText, table.alignedVerse {
border-collapse: collapse;
width: 100%;
}

table.alignedText td.first, table.alignedText td.second {
Expand Down

0 comments on commit a1cc62b

Please sign in to comment.