lib/isodoc/iho/iho.specification.xsl in metanorma-iho-0.2.8 vs lib/isodoc/iho/iho.specification.xsl in metanorma-iho-0.2.9

- old
+ new

@@ -36,11 +36,11 @@ </xsl:variable> <xsl:template match="/"> <xsl:variable name="xslfo"> - <fo:root font-family="Helvetica Neue, Cambria Math" font-size="12pt" xml:lang="{$lang}"> + <fo:root font-family="Arial, Cambria Math" font-size="12pt" xml:lang="{$lang}"> <fo:layout-master-set> <!-- cover page --> <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}"> <fo:region-body margin-top="0mm" margin-bottom="5mm" margin-left="0mm" margin-right="5mm"/> </fo:simple-page-master> @@ -860,14 +860,14 @@ <xsl:choose> <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash --> <xsl:otherwise> <!-- for ordered lists --> <xsl:choose> <xsl:when test="../@type = 'arabic'"> - <xsl:number format="a)"/> + <xsl:number format="a)" lang="en"/> </xsl:when> <xsl:when test="../@type = 'alphabet'"> - <xsl:number format="a)"/> + <xsl:number format="a)" lang="en"/> </xsl:when> <xsl:otherwise> <xsl:number format="1."/> </xsl:otherwise> </xsl:choose> @@ -1123,11 +1123,11 @@ - <xsl:attribute name="font-family">SF Mono</xsl:attribute> + <xsl:attribute name="font-family">Fira Code</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="line-height">113%</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="permission-style"> @@ -1530,14 +1530,16 @@ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> --> <xsl:variable name="colwidths"> - <xsl:call-template name="calculate-column-widths"> - <xsl:with-param name="cols-count" select="$cols-count"/> - <xsl:with-param name="table" select="$simple-table"/> - </xsl:call-template> + <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])"> + <xsl:call-template name="calculate-column-widths"> + <xsl:with-param name="cols-count" select="$cols-count"/> + <xsl:with-param name="table" select="$simple-table"/> + </xsl:call-template> + </xsl:if> </xsl:variable> <!-- colwidths=<xsl:copy-of select="$colwidths"/> --> <!-- <xsl:variable name="colwidths2"> <xsl:call-template name="calculate-column-widths"> @@ -1608,20 +1610,29 @@ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/> <xsl:if test="$isNoteOrFnExist = 'true'"> <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer --> </xsl:if> - <xsl:for-each select="xalan:nodeset($colwidths)//column"> - <xsl:choose> - <xsl:when test=". = 1 or . = 0"> - <fo:table-column column-width="proportional-column-width(2)"/> - </xsl:when> - <xsl:otherwise> - <fo:table-column column-width="proportional-column-width({.})"/> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> + <xsl:choose> + <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']"> + <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']"> + <fo:table-column column-width="{@width}"/> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="xalan:nodeset($colwidths)//column"> + <xsl:choose> + <xsl:when test=". = 1 or . = 0"> + <fo:table-column column-width="proportional-column-width(2)"/> + </xsl:when> + <xsl:otherwise> + <fo:table-column column-width="proportional-column-width({.})"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> <xsl:choose> <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']"> <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/> </xsl:when> @@ -1630,14 +1641,16 @@ </xsl:otherwise> </xsl:choose> </fo:table> + <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/> <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody --> <xsl:call-template name="insertTableFooterInSeparateTable"> <xsl:with-param name="table_attributes" select="$table_attributes"/> <xsl:with-param name="colwidths" select="$colwidths"/> + <xsl:with-param name="colgroup" select="$colgroup"/> </xsl:call-template> </xsl:for-each> <!-- insert footer as table --> <!-- <fo:table> @@ -1887,16 +1900,26 @@ </xsl:if> </xsl:template><xsl:template name="insertTableFooterInSeparateTable"> <xsl:param name="table_attributes"/> <xsl:param name="colwidths"/> + <xsl:param name="colgroup"/> <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/> <xsl:if test="$isNoteOrFnExist = 'true'"> - <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/> + <xsl:variable name="cols-count"> + <xsl:choose> + <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> + <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <fo:table keep-with-previous="always"> <xsl:for-each select="xalan:nodeset($table_attributes)/attribute"> <xsl:choose> <xsl:when test="@name = 'border-top'"> @@ -1910,20 +1933,29 @@ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:for-each> - <xsl:for-each select="xalan:nodeset($colwidths)//column"> - <xsl:choose> - <xsl:when test=". = 1 or . = 0"> - <fo:table-column column-width="proportional-column-width(2)"/> - </xsl:when> - <xsl:otherwise> - <fo:table-column column-width="proportional-column-width({.})"/> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> + <xsl:choose> + <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> + <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']"> + <fo:table-column column-width="{@width}"/> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="xalan:nodeset($colwidths)//column"> + <xsl:choose> + <xsl:when test=". = 1 or . = 0"> + <fo:table-column column-width="proportional-column-width(2)"/> + </xsl:when> + <xsl:otherwise> + <fo:table-column column-width="proportional-column-width({.})"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> <fo:table-body> <fo:table-row> <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}"> @@ -4117,11 +4149,12 @@ <fo:table-column column-width="20mm"/> <fo:table-column column-width="23mm"/> <fo:table-column column-width="107mm"/> <fo:table-column column-width="15mm"/> <fo:table-body> - <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white"> + <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white"> + <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell> </fo:table-row> @@ -4135,9 +4168,13 @@ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*"> <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm"> <fo:block><xsl:apply-templates/></fo:block> </fo:table-cell> </xsl:template><xsl:template name="processBibitem"> + + + <!-- end BIPM bibitem processing--> + <!-- start IHO bibtem processing --> \ No newline at end of file