metanorma-itu 2.2.2 → 2.2.3

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: 25b4c143474afcc4b66a14b88d85e1582a67fddb74e940688c50e0776e8989c2
4
- data.tar.gz: 3854ef509f74fa0d98c9b5d437db4e322a47f57f20f7ae88590f0b82f17920cf
3
+ metadata.gz: 173c5756503e5cabac9ec47af49876a114258a4114a287ed6a779048fbc7f0c7
4
+ data.tar.gz: ae582fdab10dcc80e74671cc36b88b0eee8a643a49d79e96044236f7caa30b2d
5
5
  SHA512:
6
- metadata.gz: 5d3aec91fa3c7536c7cf103afd3058c2c0ec2c58f81d06060528a11fdbaf65503fee68e025def555852853b332bce97763e0b5034cb8f8188cd54d9cbfba038e
7
- data.tar.gz: fdfe10c0fb9aeb70393e837c58e41423773cfc6e18c888e89d745d4d164b0e11d56ce1b4a497229adf8d67dfeb2643b6e5eb25ba90aa6954f5105cc37c7ac10d
6
+ metadata.gz: 9066be84a7d34c4a90ad93a5ea1dd83d3d724d3d30eae457d91239403263e30bd564254fd358eee6c9a5c9ddfbe6523bffc11ed8975cb1ca6fe58276c2e14d6c
7
+ data.tar.gz: 07a1167f51f635152294ed34349373c967cf937db1ef405265ea675a7888ffd02ff090bfa592de47638daa269f0f0827604580b9125a56ce2ec7f1414c8ca4b4
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #standard-band {
128
157
  background-color: #0AC442; }
129
158
 
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #recommendation-band {
128
157
  background-color: #a3d88f; }
129
158
 
@@ -370,6 +399,35 @@ a.FootnoteRef + a.FootnoteRef:before {
370
399
  color: red;
371
400
  text-decoration: line-through; }
372
401
 
402
+ /* code highlighting with line numbers */
403
+ table.rouge-line-table td.rouge-gutter {
404
+ -moz-user-select: none;
405
+ -ms-user-select: none;
406
+ -webkit-user-select: none;
407
+ user-select: none;
408
+ padding-right: 1em; }
409
+
410
+ table.rouge-line-table td.rouge-code {
411
+ -moz-user-select: all;
412
+ -ms-user-select: all;
413
+ -webkit-user-select: all;
414
+ user-select: all; }
415
+
416
+ table.rouge-line-table,
417
+ table.rouge-line-table th,
418
+ table.rouge-line-table td {
419
+ width: auto;
420
+ border: none;
421
+ margin: 0;
422
+ padding: 0;
423
+ font-size: 100%; }
424
+
425
+ table.rouge-line-table pre {
426
+ margin: 0;
427
+ padding: 0;
428
+ overflow-x: visible;
429
+ font-size: 100%; }
430
+
373
431
  #recommendation-band {
374
432
  background-color: #a3d88f; }
375
433
 
@@ -1138,7 +1196,7 @@ table:not(.biblio) {
1138
1196
  table:not(.biblio) th, table:not(.biblio) td {
1139
1197
  padding: 1em; }
1140
1198
  table:not(.biblio) td.header {
1141
- font-weigth: 400; }
1199
+ font-weight: 400; }
1142
1200
  table:not(.biblio), table:not(.biblio) th, table:not(.biblio) td {
1143
1201
  border: none !important; }
1144
1202
  table:not(.biblio) tr:nth-child(even) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -4667,7 +4667,7 @@
4667
4667
  </fn>
4668
4668
  -->
4669
4669
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
4670
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
4670
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4671
4671
 
4672
4672
  <!-- list of footnotes to calculate actual footnotes number -->
4673
4673
  <xsl:variable name="p_fn_">
@@ -4724,8 +4724,7 @@
4724
4724
  </fo:basic-link>
4725
4725
  </fo:inline>
4726
4726
  </xsl:variable>
4727
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
4728
- gen_id=<xsl:value-of select="$gen_id"/> -->
4727
+
4729
4728
  <xsl:choose>
4730
4729
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4731
4730
  <xsl:copy-of select="$footnote_inline"/>
@@ -4784,7 +4783,7 @@
4784
4783
  <!-- commented:
4785
4784
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4786
4785
  because 'fn' there is in biblio-tag -->
4787
- <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4786
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4788
4787
  <!-- copy unique fn -->
4789
4788
  <fn gen_id="{generate-id(.)}">
4790
4789
  <xsl:copy-of select="@*"/>
@@ -7350,7 +7349,9 @@
7350
7349
 
7351
7350
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
7352
7351
  <xsl:if test="number($scale) &lt; 100">
7353
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7352
+
7353
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7354
+
7354
7355
  </xsl:if>
7355
7356
 
7356
7357
  </xsl:if>
@@ -8365,6 +8366,12 @@
8365
8366
  </xsl:attribute>
8366
8367
  </xsl:for-each>
8367
8368
 
8369
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
8370
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8371
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8372
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8373
+ </xsl:if>
8374
+
8368
8375
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8369
8376
  </fo:block>
8370
8377
 
@@ -8413,7 +8420,7 @@
8413
8420
  </xsl:template>
8414
8421
 
8415
8422
  <!-- outer table with line numbers for sourcecode -->
8416
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8423
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
8417
8424
  <fo:block>
8418
8425
  <fo:table width="100%" table-layout="fixed">
8419
8426
  <xsl:copy-of select="@id"/>
@@ -8425,16 +8432,16 @@
8425
8432
  </fo:table>
8426
8433
  </fo:block>
8427
8434
  </xsl:template>
8428
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8435
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
8429
8436
  <xsl:apply-templates/>
8430
8437
  </xsl:template>
8431
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8438
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
8432
8439
  <fo:table-row>
8433
8440
  <xsl:apply-templates/>
8434
8441
  </fo:table-row>
8435
8442
  </xsl:template>
8436
8443
  <!-- first td with line numbers -->
8437
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8444
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8438
8445
  <fo:table-cell>
8439
8446
  <fo:block>
8440
8447
 
@@ -8454,8 +8461,9 @@
8454
8461
  </fo:block>
8455
8462
  </fo:table-cell>
8456
8463
  </xsl:template>
8464
+
8457
8465
  <!-- second td with sourcecode -->
8458
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8466
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8459
8467
  <fo:table-cell>
8460
8468
  <fo:block>
8461
8469
  <xsl:apply-templates/>
@@ -8693,7 +8701,25 @@
8693
8701
  <xsl:template match="*[local-name()='pre']" name="pre">
8694
8702
  <fo:block xsl:use-attribute-sets="pre-style">
8695
8703
  <xsl:copy-of select="@id"/>
8696
- <xsl:apply-templates/>
8704
+ <xsl:choose>
8705
+
8706
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
8707
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
8708
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8709
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8710
+ </xsl:if>
8711
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
8712
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
8713
+ <mtext><xsl:value-of select="."/></mtext>
8714
+ </math>
8715
+ </fo:instream-foreign-object>
8716
+ </xsl:when>
8717
+
8718
+ <xsl:otherwise>
8719
+ <xsl:apply-templates/>
8720
+ </xsl:otherwise>
8721
+
8722
+ </xsl:choose>
8697
8723
  </fo:block>
8698
8724
  </xsl:template>
8699
8725
  <!-- =============== -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -4667,7 +4667,7 @@
4667
4667
  </fn>
4668
4668
  -->
4669
4669
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
4670
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
4670
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4671
4671
 
4672
4672
  <!-- list of footnotes to calculate actual footnotes number -->
4673
4673
  <xsl:variable name="p_fn_">
@@ -4724,8 +4724,7 @@
4724
4724
  </fo:basic-link>
4725
4725
  </fo:inline>
4726
4726
  </xsl:variable>
4727
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
4728
- gen_id=<xsl:value-of select="$gen_id"/> -->
4727
+
4729
4728
  <xsl:choose>
4730
4729
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4731
4730
  <xsl:copy-of select="$footnote_inline"/>
@@ -4784,7 +4783,7 @@
4784
4783
  <!-- commented:
4785
4784
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4786
4785
  because 'fn' there is in biblio-tag -->
4787
- <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4786
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4788
4787
  <!-- copy unique fn -->
4789
4788
  <fn gen_id="{generate-id(.)}">
4790
4789
  <xsl:copy-of select="@*"/>
@@ -7350,7 +7349,9 @@
7350
7349
 
7351
7350
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
7352
7351
  <xsl:if test="number($scale) &lt; 100">
7353
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7352
+
7353
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7354
+
7354
7355
  </xsl:if>
7355
7356
 
7356
7357
  </xsl:if>
@@ -8365,6 +8366,12 @@
8365
8366
  </xsl:attribute>
8366
8367
  </xsl:for-each>
8367
8368
 
8369
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
8370
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8371
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8372
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8373
+ </xsl:if>
8374
+
8368
8375
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8369
8376
  </fo:block>
8370
8377
 
@@ -8413,7 +8420,7 @@
8413
8420
  </xsl:template>
8414
8421
 
8415
8422
  <!-- outer table with line numbers for sourcecode -->
8416
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8423
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
8417
8424
  <fo:block>
8418
8425
  <fo:table width="100%" table-layout="fixed">
8419
8426
  <xsl:copy-of select="@id"/>
@@ -8425,16 +8432,16 @@
8425
8432
  </fo:table>
8426
8433
  </fo:block>
8427
8434
  </xsl:template>
8428
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8435
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
8429
8436
  <xsl:apply-templates/>
8430
8437
  </xsl:template>
8431
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8438
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
8432
8439
  <fo:table-row>
8433
8440
  <xsl:apply-templates/>
8434
8441
  </fo:table-row>
8435
8442
  </xsl:template>
8436
8443
  <!-- first td with line numbers -->
8437
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8444
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8438
8445
  <fo:table-cell>
8439
8446
  <fo:block>
8440
8447
 
@@ -8454,8 +8461,9 @@
8454
8461
  </fo:block>
8455
8462
  </fo:table-cell>
8456
8463
  </xsl:template>
8464
+
8457
8465
  <!-- second td with sourcecode -->
8458
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8466
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8459
8467
  <fo:table-cell>
8460
8468
  <fo:block>
8461
8469
  <xsl:apply-templates/>
@@ -8693,7 +8701,25 @@
8693
8701
  <xsl:template match="*[local-name()='pre']" name="pre">
8694
8702
  <fo:block xsl:use-attribute-sets="pre-style">
8695
8703
  <xsl:copy-of select="@id"/>
8696
- <xsl:apply-templates/>
8704
+ <xsl:choose>
8705
+
8706
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
8707
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
8708
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8709
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8710
+ </xsl:if>
8711
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
8712
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
8713
+ <mtext><xsl:value-of select="."/></mtext>
8714
+ </math>
8715
+ </fo:instream-foreign-object>
8716
+ </xsl:when>
8717
+
8718
+ <xsl:otherwise>
8719
+ <xsl:apply-templates/>
8720
+ </xsl:otherwise>
8721
+
8722
+ </xsl:choose>
8697
8723
  </fo:block>
8698
8724
  </xsl:template>
8699
8725
  <!-- =============== -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -4667,7 +4667,7 @@
4667
4667
  </fn>
4668
4668
  -->
4669
4669
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
4670
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
4670
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4671
4671
 
4672
4672
  <!-- list of footnotes to calculate actual footnotes number -->
4673
4673
  <xsl:variable name="p_fn_">
@@ -4724,8 +4724,7 @@
4724
4724
  </fo:basic-link>
4725
4725
  </fo:inline>
4726
4726
  </xsl:variable>
4727
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
4728
- gen_id=<xsl:value-of select="$gen_id"/> -->
4727
+
4729
4728
  <xsl:choose>
4730
4729
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4731
4730
  <xsl:copy-of select="$footnote_inline"/>
@@ -4784,7 +4783,7 @@
4784
4783
  <!-- commented:
4785
4784
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4786
4785
  because 'fn' there is in biblio-tag -->
4787
- <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4786
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4788
4787
  <!-- copy unique fn -->
4789
4788
  <fn gen_id="{generate-id(.)}">
4790
4789
  <xsl:copy-of select="@*"/>
@@ -7350,7 +7349,9 @@
7350
7349
 
7351
7350
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
7352
7351
  <xsl:if test="number($scale) &lt; 100">
7353
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7352
+
7353
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7354
+
7354
7355
  </xsl:if>
7355
7356
 
7356
7357
  </xsl:if>
@@ -8365,6 +8366,12 @@
8365
8366
  </xsl:attribute>
8366
8367
  </xsl:for-each>
8367
8368
 
8369
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
8370
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8371
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8372
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8373
+ </xsl:if>
8374
+
8368
8375
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8369
8376
  </fo:block>
8370
8377
 
@@ -8413,7 +8420,7 @@
8413
8420
  </xsl:template>
8414
8421
 
8415
8422
  <!-- outer table with line numbers for sourcecode -->
8416
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8423
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
8417
8424
  <fo:block>
8418
8425
  <fo:table width="100%" table-layout="fixed">
8419
8426
  <xsl:copy-of select="@id"/>
@@ -8425,16 +8432,16 @@
8425
8432
  </fo:table>
8426
8433
  </fo:block>
8427
8434
  </xsl:template>
8428
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8435
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
8429
8436
  <xsl:apply-templates/>
8430
8437
  </xsl:template>
8431
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8438
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
8432
8439
  <fo:table-row>
8433
8440
  <xsl:apply-templates/>
8434
8441
  </fo:table-row>
8435
8442
  </xsl:template>
8436
8443
  <!-- first td with line numbers -->
8437
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8444
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8438
8445
  <fo:table-cell>
8439
8446
  <fo:block>
8440
8447
 
@@ -8454,8 +8461,9 @@
8454
8461
  </fo:block>
8455
8462
  </fo:table-cell>
8456
8463
  </xsl:template>
8464
+
8457
8465
  <!-- second td with sourcecode -->
8458
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8466
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8459
8467
  <fo:table-cell>
8460
8468
  <fo:block>
8461
8469
  <xsl:apply-templates/>
@@ -8693,7 +8701,25 @@
8693
8701
  <xsl:template match="*[local-name()='pre']" name="pre">
8694
8702
  <fo:block xsl:use-attribute-sets="pre-style">
8695
8703
  <xsl:copy-of select="@id"/>
8696
- <xsl:apply-templates/>
8704
+ <xsl:choose>
8705
+
8706
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
8707
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
8708
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8709
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8710
+ </xsl:if>
8711
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
8712
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
8713
+ <mtext><xsl:value-of select="."/></mtext>
8714
+ </math>
8715
+ </fo:instream-foreign-object>
8716
+ </xsl:when>
8717
+
8718
+ <xsl:otherwise>
8719
+ <xsl:apply-templates/>
8720
+ </xsl:otherwise>
8721
+
8722
+ </xsl:choose>
8697
8723
  </fo:block>
8698
8724
  </xsl:template>
8699
8725
  <!-- =============== -->
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -4667,7 +4667,7 @@
4667
4667
  </fn>
4668
4668
  -->
4669
4669
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
4670
- <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
4670
+ <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4671
4671
 
4672
4672
  <!-- list of footnotes to calculate actual footnotes number -->
4673
4673
  <xsl:variable name="p_fn_">
@@ -4724,8 +4724,7 @@
4724
4724
  </fo:basic-link>
4725
4725
  </fo:inline>
4726
4726
  </xsl:variable>
4727
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
4728
- gen_id=<xsl:value-of select="$gen_id"/> -->
4727
+
4729
4728
  <xsl:choose>
4730
4729
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4731
4730
  <xsl:copy-of select="$footnote_inline"/>
@@ -4784,7 +4783,7 @@
4784
4783
  <!-- commented:
4785
4784
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4786
4785
  because 'fn' there is in biblio-tag -->
4787
- <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4786
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4788
4787
  <!-- copy unique fn -->
4789
4788
  <fn gen_id="{generate-id(.)}">
4790
4789
  <xsl:copy-of select="@*"/>
@@ -7350,7 +7349,9 @@
7350
7349
 
7351
7350
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
7352
7351
  <xsl:if test="number($scale) &lt; 100">
7353
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7352
+
7353
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7354
+
7354
7355
  </xsl:if>
7355
7356
 
7356
7357
  </xsl:if>
@@ -8365,6 +8366,12 @@
8365
8366
  </xsl:attribute>
8366
8367
  </xsl:for-each>
8367
8368
 
8369
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
8370
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8371
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8372
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8373
+ </xsl:if>
8374
+
8368
8375
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8369
8376
  </fo:block>
8370
8377
 
@@ -8413,7 +8420,7 @@
8413
8420
  </xsl:template>
8414
8421
 
8415
8422
  <!-- outer table with line numbers for sourcecode -->
8416
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8423
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
8417
8424
  <fo:block>
8418
8425
  <fo:table width="100%" table-layout="fixed">
8419
8426
  <xsl:copy-of select="@id"/>
@@ -8425,16 +8432,16 @@
8425
8432
  </fo:table>
8426
8433
  </fo:block>
8427
8434
  </xsl:template>
8428
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8435
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
8429
8436
  <xsl:apply-templates/>
8430
8437
  </xsl:template>
8431
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8438
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
8432
8439
  <fo:table-row>
8433
8440
  <xsl:apply-templates/>
8434
8441
  </fo:table-row>
8435
8442
  </xsl:template>
8436
8443
  <!-- first td with line numbers -->
8437
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8444
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8438
8445
  <fo:table-cell>
8439
8446
  <fo:block>
8440
8447
 
@@ -8454,8 +8461,9 @@
8454
8461
  </fo:block>
8455
8462
  </fo:table-cell>
8456
8463
  </xsl:template>
8464
+
8457
8465
  <!-- second td with sourcecode -->
8458
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8466
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
8459
8467
  <fo:table-cell>
8460
8468
  <fo:block>
8461
8469
  <xsl:apply-templates/>
@@ -8693,7 +8701,25 @@
8693
8701
  <xsl:template match="*[local-name()='pre']" name="pre">
8694
8702
  <fo:block xsl:use-attribute-sets="pre-style">
8695
8703
  <xsl:copy-of select="@id"/>
8696
- <xsl:apply-templates/>
8704
+ <xsl:choose>
8705
+
8706
+ <xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
8707
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
8708
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8709
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8710
+ </xsl:if>
8711
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
8712
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
8713
+ <mtext><xsl:value-of select="."/></mtext>
8714
+ </math>
8715
+ </fo:instream-foreign-object>
8716
+ </xsl:when>
8717
+
8718
+ <xsl:otherwise>
8719
+ <xsl:apply-templates/>
8720
+ </xsl:otherwise>
8721
+
8722
+ </xsl:choose>
8697
8723
  </fo:block>
8698
8724
  </xsl:template>
8699
8725
  <!-- =============== -->