metanorma-bipm 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db333f4baa39d62ca122b46d87efaeaa37e260f003c4c10390f515bf81b0ae2c
4
- data.tar.gz: 03b232eaa16fccc5405f47b957c289d754567c2de91a0040e7d19ec40eadff15
3
+ metadata.gz: dc14d497173a941f36ed2190583ad2aa327cf205b3c4dc12cd71638804523472
4
+ data.tar.gz: 6d3bb20478eacb30ae5141a2d5366dacef224393a51ccc9f1c413693e6c20b14
5
5
  SHA512:
6
- metadata.gz: be2b513686ecdaca070cdc4898841f5ebe95981625f8bb159c9471be9729b244640b1250e16ec349f5d1613c288245144812994bdcd4948020b2b39475ac9d93
7
- data.tar.gz: d8fd8eabacaeb7e25ce3b6918ea032cd2015af9d90972b6a693dcc2e5904a65fbcebfcdf8111e22c0eb395b23d01135f242545c0ad3cf6a0931b311f33c51ada
6
+ metadata.gz: fd4a51b12df8205cad882ea3c989109cba33302a75c6e35a694ec1e5359544ffe946254e47406ba9c2405a6fedf5ab17f12d5262f84e69a2f08561d43a67ce1a
7
+ data.tar.gz: a6288f12b640596488700982457eb7a9d92186afff22b0c43ee37163ffaf1429050d0dc5ee778149ce16358450b381215201afd19d17f630b2af8d22ab6a1dc4
@@ -4188,11 +4188,26 @@
4188
4188
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
4189
4189
  </xsl:if>
4190
4190
 
4191
- <xsl:value-of select="."/>
4191
+ <xsl:variable name="font_family" select="."/>
4192
4192
 
4193
- <xsl:if test="$additional_fonts != ''">
4194
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4195
- </xsl:if>
4193
+ <xsl:choose>
4194
+ <xsl:when test="$additional_fonts = ''">
4195
+ <xsl:value-of select="$font_family"/>
4196
+ </xsl:when>
4197
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
4198
+ <xsl:choose>
4199
+ <xsl:when test="contains($font_family, ',')">
4200
+ <xsl:value-of select="substring-before($font_family, ',')"/>
4201
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4202
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="$font_family"/>
4206
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4207
+ </xsl:otherwise>
4208
+ </xsl:choose>
4209
+ </xsl:otherwise>
4210
+ </xsl:choose>
4196
4211
  </xsl:attribute>
4197
4212
  </xsl:when>
4198
4213
  <xsl:otherwise>
@@ -6786,25 +6801,25 @@
6786
6801
 
6787
6802
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
6788
6803
 
6789
- <fo:block xsl:use-attribute-sets="table-note-style">
6804
+ <fo:block xsl:use-attribute-sets="table-note-style">
6790
6805
 
6791
- <xsl:call-template name="refine_table-note-style"/>
6806
+ <xsl:call-template name="refine_table-note-style"/>
6792
6807
 
6793
- <!-- Table's note/example name (NOTE, for example) -->
6794
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
6808
+ <!-- Table's note/example name (NOTE, for example) -->
6809
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
6795
6810
 
6796
- <xsl:call-template name="refine_table-note-name-style"/>
6811
+ <xsl:call-template name="refine_table-note-name-style"/>
6797
6812
 
6798
- <xsl:apply-templates select="*[local-name() = 'name']"/>
6813
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6799
6814
 
6800
- </fo:inline>
6815
+ </fo:inline>
6801
6816
 
6802
- <xsl:if test="ancestor::bipm:preface">
6803
- <fo:block> </fo:block>
6804
- </xsl:if>
6817
+ <xsl:if test="ancestor::bipm:preface">
6818
+ <fo:block> </fo:block>
6819
+ </xsl:if>
6805
6820
 
6806
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6807
- </fo:block>
6821
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6822
+ </fo:block>
6808
6823
 
6809
6824
  </xsl:template> <!-- table/note -->
6810
6825
 
@@ -9982,8 +9997,12 @@
9982
9997
  <xsl:variable name="isAdded" select="../@added"/>
9983
9998
  <xsl:variable name="isDeleted" select="../@deleted"/>
9984
9999
  <xsl:choose>
9985
- <xsl:when test="ancestor::*[local-name() = 'title']">
10000
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
9986
10001
  <fo:inline padding-left="1mm" padding-right="1mm">
10002
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
10003
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
10004
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
10005
+ </xsl:if>
9987
10006
  <xsl:variable name="src">
9988
10007
  <xsl:call-template name="image_src"/>
9989
10008
  </xsl:variable>
@@ -10016,7 +10035,7 @@
10016
10035
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10017
10036
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10018
10037
 
10019
- <xsl:if test="@width != '' and @width != 'auto'">
10038
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
10020
10039
  <xsl:attribute name="width">
10021
10040
  <xsl:value-of select="@width"/>
10022
10041
  </xsl:attribute>
@@ -4188,11 +4188,26 @@
4188
4188
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
4189
4189
  </xsl:if>
4190
4190
 
4191
- <xsl:value-of select="."/>
4191
+ <xsl:variable name="font_family" select="."/>
4192
4192
 
4193
- <xsl:if test="$additional_fonts != ''">
4194
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4195
- </xsl:if>
4193
+ <xsl:choose>
4194
+ <xsl:when test="$additional_fonts = ''">
4195
+ <xsl:value-of select="$font_family"/>
4196
+ </xsl:when>
4197
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
4198
+ <xsl:choose>
4199
+ <xsl:when test="contains($font_family, ',')">
4200
+ <xsl:value-of select="substring-before($font_family, ',')"/>
4201
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4202
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="$font_family"/>
4206
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4207
+ </xsl:otherwise>
4208
+ </xsl:choose>
4209
+ </xsl:otherwise>
4210
+ </xsl:choose>
4196
4211
  </xsl:attribute>
4197
4212
  </xsl:when>
4198
4213
  <xsl:otherwise>
@@ -6786,25 +6801,25 @@
6786
6801
 
6787
6802
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
6788
6803
 
6789
- <fo:block xsl:use-attribute-sets="table-note-style">
6804
+ <fo:block xsl:use-attribute-sets="table-note-style">
6790
6805
 
6791
- <xsl:call-template name="refine_table-note-style"/>
6806
+ <xsl:call-template name="refine_table-note-style"/>
6792
6807
 
6793
- <!-- Table's note/example name (NOTE, for example) -->
6794
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
6808
+ <!-- Table's note/example name (NOTE, for example) -->
6809
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
6795
6810
 
6796
- <xsl:call-template name="refine_table-note-name-style"/>
6811
+ <xsl:call-template name="refine_table-note-name-style"/>
6797
6812
 
6798
- <xsl:apply-templates select="*[local-name() = 'name']"/>
6813
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6799
6814
 
6800
- </fo:inline>
6815
+ </fo:inline>
6801
6816
 
6802
- <xsl:if test="ancestor::bipm:preface">
6803
- <fo:block> </fo:block>
6804
- </xsl:if>
6817
+ <xsl:if test="ancestor::bipm:preface">
6818
+ <fo:block> </fo:block>
6819
+ </xsl:if>
6805
6820
 
6806
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6807
- </fo:block>
6821
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6822
+ </fo:block>
6808
6823
 
6809
6824
  </xsl:template> <!-- table/note -->
6810
6825
 
@@ -9982,8 +9997,12 @@
9982
9997
  <xsl:variable name="isAdded" select="../@added"/>
9983
9998
  <xsl:variable name="isDeleted" select="../@deleted"/>
9984
9999
  <xsl:choose>
9985
- <xsl:when test="ancestor::*[local-name() = 'title']">
10000
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
9986
10001
  <fo:inline padding-left="1mm" padding-right="1mm">
10002
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
10003
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
10004
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
10005
+ </xsl:if>
9987
10006
  <xsl:variable name="src">
9988
10007
  <xsl:call-template name="image_src"/>
9989
10008
  </xsl:variable>
@@ -10016,7 +10035,7 @@
10016
10035
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10017
10036
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10018
10037
 
10019
- <xsl:if test="@width != '' and @width != 'auto'">
10038
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
10020
10039
  <xsl:attribute name="width">
10021
10040
  <xsl:value-of select="@width"/>
10022
10041
  </xsl:attribute>
@@ -4188,11 +4188,26 @@
4188
4188
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
4189
4189
  </xsl:if>
4190
4190
 
4191
- <xsl:value-of select="."/>
4191
+ <xsl:variable name="font_family" select="."/>
4192
4192
 
4193
- <xsl:if test="$additional_fonts != ''">
4194
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4195
- </xsl:if>
4193
+ <xsl:choose>
4194
+ <xsl:when test="$additional_fonts = ''">
4195
+ <xsl:value-of select="$font_family"/>
4196
+ </xsl:when>
4197
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
4198
+ <xsl:choose>
4199
+ <xsl:when test="contains($font_family, ',')">
4200
+ <xsl:value-of select="substring-before($font_family, ',')"/>
4201
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4202
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="$font_family"/>
4206
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4207
+ </xsl:otherwise>
4208
+ </xsl:choose>
4209
+ </xsl:otherwise>
4210
+ </xsl:choose>
4196
4211
  </xsl:attribute>
4197
4212
  </xsl:when>
4198
4213
  <xsl:otherwise>
@@ -6786,25 +6801,25 @@
6786
6801
 
6787
6802
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
6788
6803
 
6789
- <fo:block xsl:use-attribute-sets="table-note-style">
6804
+ <fo:block xsl:use-attribute-sets="table-note-style">
6790
6805
 
6791
- <xsl:call-template name="refine_table-note-style"/>
6806
+ <xsl:call-template name="refine_table-note-style"/>
6792
6807
 
6793
- <!-- Table's note/example name (NOTE, for example) -->
6794
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
6808
+ <!-- Table's note/example name (NOTE, for example) -->
6809
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
6795
6810
 
6796
- <xsl:call-template name="refine_table-note-name-style"/>
6811
+ <xsl:call-template name="refine_table-note-name-style"/>
6797
6812
 
6798
- <xsl:apply-templates select="*[local-name() = 'name']"/>
6813
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6799
6814
 
6800
- </fo:inline>
6815
+ </fo:inline>
6801
6816
 
6802
- <xsl:if test="ancestor::bipm:preface">
6803
- <fo:block> </fo:block>
6804
- </xsl:if>
6817
+ <xsl:if test="ancestor::bipm:preface">
6818
+ <fo:block> </fo:block>
6819
+ </xsl:if>
6805
6820
 
6806
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6807
- </fo:block>
6821
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6822
+ </fo:block>
6808
6823
 
6809
6824
  </xsl:template> <!-- table/note -->
6810
6825
 
@@ -9982,8 +9997,12 @@
9982
9997
  <xsl:variable name="isAdded" select="../@added"/>
9983
9998
  <xsl:variable name="isDeleted" select="../@deleted"/>
9984
9999
  <xsl:choose>
9985
- <xsl:when test="ancestor::*[local-name() = 'title']">
10000
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
9986
10001
  <fo:inline padding-left="1mm" padding-right="1mm">
10002
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
10003
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
10004
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
10005
+ </xsl:if>
9987
10006
  <xsl:variable name="src">
9988
10007
  <xsl:call-template name="image_src"/>
9989
10008
  </xsl:variable>
@@ -10016,7 +10035,7 @@
10016
10035
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10017
10036
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10018
10037
 
10019
- <xsl:if test="@width != '' and @width != 'auto'">
10038
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
10020
10039
  <xsl:attribute name="width">
10021
10040
  <xsl:value-of select="@width"/>
10022
10041
  </xsl:attribute>
@@ -4188,11 +4188,26 @@
4188
4188
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
4189
4189
  </xsl:if>
4190
4190
 
4191
- <xsl:value-of select="."/>
4191
+ <xsl:variable name="font_family" select="."/>
4192
4192
 
4193
- <xsl:if test="$additional_fonts != ''">
4194
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4195
- </xsl:if>
4193
+ <xsl:choose>
4194
+ <xsl:when test="$additional_fonts = ''">
4195
+ <xsl:value-of select="$font_family"/>
4196
+ </xsl:when>
4197
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
4198
+ <xsl:choose>
4199
+ <xsl:when test="contains($font_family, ',')">
4200
+ <xsl:value-of select="substring-before($font_family, ',')"/>
4201
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4202
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="$font_family"/>
4206
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4207
+ </xsl:otherwise>
4208
+ </xsl:choose>
4209
+ </xsl:otherwise>
4210
+ </xsl:choose>
4196
4211
  </xsl:attribute>
4197
4212
  </xsl:when>
4198
4213
  <xsl:otherwise>
@@ -6786,25 +6801,25 @@
6786
6801
 
6787
6802
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
6788
6803
 
6789
- <fo:block xsl:use-attribute-sets="table-note-style">
6804
+ <fo:block xsl:use-attribute-sets="table-note-style">
6790
6805
 
6791
- <xsl:call-template name="refine_table-note-style"/>
6806
+ <xsl:call-template name="refine_table-note-style"/>
6792
6807
 
6793
- <!-- Table's note/example name (NOTE, for example) -->
6794
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
6808
+ <!-- Table's note/example name (NOTE, for example) -->
6809
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
6795
6810
 
6796
- <xsl:call-template name="refine_table-note-name-style"/>
6811
+ <xsl:call-template name="refine_table-note-name-style"/>
6797
6812
 
6798
- <xsl:apply-templates select="*[local-name() = 'name']"/>
6813
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6799
6814
 
6800
- </fo:inline>
6815
+ </fo:inline>
6801
6816
 
6802
- <xsl:if test="ancestor::bipm:preface">
6803
- <fo:block> </fo:block>
6804
- </xsl:if>
6817
+ <xsl:if test="ancestor::bipm:preface">
6818
+ <fo:block> </fo:block>
6819
+ </xsl:if>
6805
6820
 
6806
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6807
- </fo:block>
6821
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6822
+ </fo:block>
6808
6823
 
6809
6824
  </xsl:template> <!-- table/note -->
6810
6825
 
@@ -9982,8 +9997,12 @@
9982
9997
  <xsl:variable name="isAdded" select="../@added"/>
9983
9998
  <xsl:variable name="isDeleted" select="../@deleted"/>
9984
9999
  <xsl:choose>
9985
- <xsl:when test="ancestor::*[local-name() = 'title']">
10000
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
9986
10001
  <fo:inline padding-left="1mm" padding-right="1mm">
10002
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
10003
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
10004
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
10005
+ </xsl:if>
9987
10006
  <xsl:variable name="src">
9988
10007
  <xsl:call-template name="image_src"/>
9989
10008
  </xsl:variable>
@@ -10016,7 +10035,7 @@
10016
10035
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10017
10036
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10018
10037
 
10019
- <xsl:if test="@width != '' and @width != 'auto'">
10038
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
10020
10039
  <xsl:attribute name="width">
10021
10040
  <xsl:value-of select="@width"/>
10022
10041
  </xsl:attribute>
@@ -21,10 +21,13 @@ module IsoDoc
21
21
  end
22
22
 
23
23
  def omit_docid_prefix(prefix)
24
- return true if %w(BIPM BIPM-long).include? prefix
25
-
24
+ %w(BIPM BIPM-long).include? prefix and return true
26
25
  super
27
26
  end
27
+
28
+ def amd?(_text)
29
+ false
30
+ end
28
31
  end
29
32
  end
30
33
  end
@@ -2045,11 +2045,26 @@
2045
2045
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
2046
2046
  </xsl:if>
2047
2047
 
2048
- <xsl:value-of select="."/>
2048
+ <xsl:variable name="font_family" select="."/>
2049
2049
 
2050
- <xsl:if test="$additional_fonts != ''">
2051
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2052
- </xsl:if>
2050
+ <xsl:choose>
2051
+ <xsl:when test="$additional_fonts = ''">
2052
+ <xsl:value-of select="$font_family"/>
2053
+ </xsl:when>
2054
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
2055
+ <xsl:choose>
2056
+ <xsl:when test="contains($font_family, ',')">
2057
+ <xsl:value-of select="substring-before($font_family, ',')"/>
2058
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2059
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
2060
+ </xsl:when>
2061
+ <xsl:otherwise>
2062
+ <xsl:value-of select="$font_family"/>
2063
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
2064
+ </xsl:otherwise>
2065
+ </xsl:choose>
2066
+ </xsl:otherwise>
2067
+ </xsl:choose>
2053
2068
  </xsl:attribute>
2054
2069
  </xsl:when>
2055
2070
  <xsl:otherwise>
@@ -4646,21 +4661,21 @@
4646
4661
 
4647
4662
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4648
4663
 
4649
- <fo:block xsl:use-attribute-sets="table-note-style">
4664
+ <fo:block xsl:use-attribute-sets="table-note-style">
4650
4665
 
4651
- <xsl:call-template name="refine_table-note-style"/>
4666
+ <xsl:call-template name="refine_table-note-style"/>
4652
4667
 
4653
- <!-- Table's note/example name (NOTE, for example) -->
4654
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4668
+ <!-- Table's note/example name (NOTE, for example) -->
4669
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4655
4670
 
4656
- <xsl:call-template name="refine_table-note-name-style"/>
4671
+ <xsl:call-template name="refine_table-note-name-style"/>
4657
4672
 
4658
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4673
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4659
4674
 
4660
- </fo:inline>
4675
+ </fo:inline>
4661
4676
 
4662
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4663
- </fo:block>
4677
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4678
+ </fo:block>
4664
4679
 
4665
4680
  </xsl:template> <!-- table/note -->
4666
4681
 
@@ -7798,8 +7813,12 @@
7798
7813
  <xsl:variable name="isAdded" select="../@added"/>
7799
7814
  <xsl:variable name="isDeleted" select="../@deleted"/>
7800
7815
  <xsl:choose>
7801
- <xsl:when test="ancestor::*[local-name() = 'title']">
7816
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7802
7817
  <fo:inline padding-left="1mm" padding-right="1mm">
7818
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7819
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7820
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7821
+ </xsl:if>
7803
7822
  <xsl:variable name="src">
7804
7823
  <xsl:call-template name="image_src"/>
7805
7824
  </xsl:variable>
@@ -7832,7 +7851,7 @@
7832
7851
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7833
7852
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7834
7853
 
7835
- <xsl:if test="@width != '' and @width != 'auto'">
7854
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7836
7855
  <xsl:attribute name="width">
7837
7856
  <xsl:value-of select="@width"/>
7838
7857
  </xsl:attribute>
@@ -12,8 +12,8 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def parse(docxml)
15
- @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
16
- "@acronym"))&.value == "JCGM"
15
+ @jcgm = docxml.at(ns("//bibdata/ext/editorialgroup/committee/" \
16
+ "@acronym"))&.value == "JCGM"
17
17
  @annexlbl =
18
18
  if @jcgm then @labels["iso_annex"]
19
19
  elsif docxml.at(ns("//bibdata/ext/structuredidentifier/appendix"))
@@ -33,32 +33,30 @@ module IsoDoc
33
33
  @anchors[ref["id"]][:xref] = wrap_brackets(@anchors[ref["id"]][:xref])
34
34
  end
35
35
 
36
- def clause_names(docxml, sect_num)
37
- if @jcgm then clause_names_jcgm(docxml, sect_num)
38
- else clause_names_bipm(docxml, sect_num)
39
- end
40
- end
41
-
42
- def clause_names_jcgm(docxml, sect_num)
43
- docxml.xpath(ns("//clause[parent::sections][not(@type = 'scope')]" \
44
- "[not(descendant::terms)][not(descendant::references)]"))
45
- .each do |c|
46
- section_names(c, sect_num, 1)
47
- end
48
- end
49
-
50
36
  UNNUM = "@unnumbered = 'true'".freeze
51
37
 
52
- def clause_names_bipm(docxml, _sect_num)
38
+ def clause_order_main(docxml)
39
+ @jcgm and return @iso.clause_order_main(docxml)
40
+ [{ path: "//sections/clause[not(#{UNNUM})] | " \
41
+ "//sections/terms[not(#{UNNUM})] | " \
42
+ "//sections/definitions[not(#{UNNUM})] | " \
43
+ "//sections/references[not(#{UNNUM})]", multi: true },
44
+ { path: "//sections/clause[#{UNNUM}] | " \
45
+ "//sections/terms[#{UNNUM}] | " \
46
+ "//sections/definitions[#{UNNUM}] | " \
47
+ "//sections/references[#{UNNUM}]", multi: true }]
48
+ end
49
+
50
+ def main_anchor_names(xml)
51
+ @jcgm and return super
52
+ t = clause_order_main(xml)
53
53
  n = Counter.new
54
- docxml.xpath(ns("//sections/clause[not(#{UNNUM})] | " \
55
- "//sections/terms[not(#{UNNUM})] | " \
56
- "//sections/definitions[not(#{UNNUM})]"))
57
- .each { |c| section_names(c, n, 1) }
58
- docxml.xpath(ns("//sections/clause[#{UNNUM}] | " \
59
- "//sections/terms[#{UNNUM}] | " \
60
- "//sections/definitions[#{UNNUM}]"))
61
- .each { |c| unnumbered_section_names(c, 1) }
54
+ t.each_with_index do |a, i|
55
+ xml.xpath(ns(a[:path])).each do |c|
56
+ i.zero? ? section_names(c, n, 1) : unnumbered_section_names(c, 1)
57
+ a[:multi] or break
58
+ end
59
+ end
62
60
  end
63
61
 
64
62
  NUMBERED_SUBCLAUSES =
@@ -79,8 +77,7 @@ module IsoDoc
79
77
  end
80
78
 
81
79
  def section_names(clause, num, lvl)
82
- return num if clause.nil?
83
-
80
+ clause.nil? and return num
84
81
  num.increment(clause)
85
82
  @anchors[clause["id"]] = section_name_anchors(clause, num, lvl)
86
83
  i = Counter.new
@@ -95,9 +92,8 @@ module IsoDoc
95
92
  end
96
93
 
97
94
  def unnumbered_section_names(clause, lvl)
98
- return if clause.nil?
99
-
100
- lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
95
+ clause.nil? and return num
96
+ lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
101
97
  @anchors[clause["id"]] = { label: lbl, xref: l10n(%{"#{lbl}"}),
102
98
  level: lvl, type: "clause" }
103
99
  clause.xpath(ns(SUBCLAUSES)).each do |c|
@@ -125,7 +121,7 @@ module IsoDoc
125
121
  end
126
122
 
127
123
  def unnumbered_section_names1(clause, level)
128
- lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
124
+ lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
129
125
  @anchors[clause["id"]] =
130
126
  { label: lbl, xref: l10n(%{"#{lbl}"}), level: level, type: "clause" }
131
127
  clause.xpath(ns(SUBCLAUSES)).each do |c|
@@ -133,16 +129,22 @@ module IsoDoc
133
129
  end
134
130
  end
135
131
 
136
- def back_anchor_names(docxml)
137
- super
138
- i = @jcgm ? Counter.new("@", skip_i: true) : Counter.new(0)
139
- docxml.xpath(ns("//annex[not(#{UNNUM})]")).each do |c|
140
- i.increment(c)
141
- annex_names(c, i.print)
132
+ def clause_order_annex(_docxml)
133
+ [{ path: "//annex[not(#{UNNUM})]", multi: true },
134
+ { path: "//annex[#{UNNUM}]", multi: true }]
135
+ end
136
+
137
+ def annex_anchor_names(docxml)
138
+ n = @jcgm ? Counter.new("@", skip_i: true) : Counter.new(0)
139
+ clause_order_annex(docxml).each_with_index do |a, i|
140
+ docxml.xpath(ns(a[:path])).each do |c|
141
+ if i.zero?
142
+ n.increment(c)
143
+ annex_names(c, n.print)
144
+ else unnumbered_annex_names(c) end
145
+ a[:multi] or break
146
+ end
142
147
  end
143
- docxml.xpath(ns("//annex[#{UNNUM}]"))
144
- .each { |c| unnumbered_annex_names(c) }
145
- docxml.xpath(ns("//indexsect")).each { |b| preface_names(b) }
146
148
  end
147
149
 
148
150
  def annex_name_anchors(clause, num)
@@ -174,7 +176,7 @@ module IsoDoc
174
176
  end
175
177
 
176
178
  def unnumbered_annex_names(clause)
177
- lbl = clause&.at(ns("./title"))&.text || "[#{clause['id']}]"
179
+ lbl = clause.at(ns("./title"))&.text || "[#{clause['id']}]"
178
180
  @anchors[clause["id"]] = unnumbered_annex_anchors(lbl)
179
181
  if @klass.single_term_clause?(clause)
180
182
  annex_names1(clause.at(ns("./references | ./terms | ./definitions")),
@@ -217,9 +219,7 @@ module IsoDoc
217
219
 
218
220
  def sequential_formula_names(clause)
219
221
  c = Counter.new
220
- clause.xpath(ns(".//formula")).each do |t|
221
- next if t["id"].nil? || t["id"].empty?
222
-
222
+ clause.xpath(ns(".//formula")).noblank.each do |t|
223
223
  @anchors[t["id"]] = anchor_struct(
224
224
  c.increment(t).print, nil,
225
225
  t["inequality"] ? @labels["inequality"] : @labels["formula"],
@@ -237,19 +237,15 @@ module IsoDoc
237
237
  end
238
238
 
239
239
  def sequential_figure_names(clause)
240
- if @jcgm
241
- @iso.sequential_figure_names(clause)
242
- @anchors.merge!(@iso.get)
243
- else super
244
- end
240
+ @jcgm or return super
241
+ @iso.sequential_figure_names(clause)
242
+ @anchors.merge!(@iso.get)
245
243
  end
246
244
 
247
245
  def hierarchical_figure_names(clause, num)
248
- if @jcgm
249
- @iso.hierarchical_figure_names(clause, num)
250
- @anchors.merge!(@iso.get)
251
- else super
252
- end
246
+ @jcgm or return super
247
+ @iso.hierarchical_figure_names(clause, num)
248
+ @anchors.merge!(@iso.get)
253
249
  end
254
250
  end
255
251
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.3 -->
20
+ <!-- VERSION v1.2.4 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -2068,6 +2068,9 @@
2068
2068
  </define>
2069
2069
  <define name="termdefinition">
2070
2070
  <element name="definition">
2071
+ <optional>
2072
+ <attribute name="type"/>
2073
+ </optional>
2071
2074
  <choice>
2072
2075
  <ref name="verbaldefinition"/>
2073
2076
  <ref name="nonverbalrep"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.3.0".freeze
3
+ VERSION = "2.3.1".freeze
4
4
  end
5
5
  end
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.5.0"
31
- spec.add_dependency "metanorma-iso", "~> 2.5.0"
30
+ spec.add_dependency "metanorma-generic", "~> 2.5.1"
31
+ spec.add_dependency "metanorma-iso", "~> 2.5.1"
32
32
 
33
33
  spec.add_development_dependency "debug"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.5.0
19
+ version: 2.5.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.5.0
26
+ version: 2.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: metanorma-iso
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.5.0
33
+ version: 2.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.5.0
40
+ version: 2.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement