metanorma-itu 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25b4c143474afcc4b66a14b88d85e1582a67fddb74e940688c50e0776e8989c2
4
- data.tar.gz: 3854ef509f74fa0d98c9b5d437db4e322a47f57f20f7ae88590f0b82f17920cf
3
+ metadata.gz: '094600fa0601e8d0d0d1cc785753b36f303708857c814d1137c949b0a170a11a'
4
+ data.tar.gz: '0489e85d27e58fa185ec6e0d70b8a35bb602cf343ae7f662b5f14626dd470507'
5
5
  SHA512:
6
- metadata.gz: 5d3aec91fa3c7536c7cf103afd3058c2c0ec2c58f81d06060528a11fdbaf65503fee68e025def555852853b332bce97763e0b5034cb8f8188cd54d9cbfba038e
7
- data.tar.gz: fdfe10c0fb9aeb70393e837c58e41423773cfc6e18c888e89d745d4d164b0e11d56ce1b4a497229adf8d67dfeb2643b6e5eb25ba90aa6954f5105cc37c7ac10d
6
+ metadata.gz: 3467eeb6c89581fca56cea3ef51a69fa0426d865d2d313d15ad0861240c2dd400a0d5240551225a1a4f9c9f468ff1d931692d248ab0adb802f607be4bf661cf4
7
+ data.tar.gz: c5eb014d0f82ee0b76f10d03511aae57747433a4d5a893a0de53c2e67d6155104efd335d4e50e1e4cd7a5937ff0d29762384767b1a31d33a5b46ef9b5e528b2e
@@ -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
 
@@ -1298,21 +1298,42 @@
1298
1298
  <!-- PREFACE (Summary, History, ...) -->
1299
1299
  <!-- ============================= -->
1300
1300
 
1301
+ <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="3">
1302
+ <xsl:choose>
1303
+ <xsl:when test="preceding-sibling::*">
1304
+ <!-- page-break before 2nd and next elements only -->
1305
+ <fo:block break-after="page"/>
1306
+ </xsl:when>
1307
+ <xsl:otherwise>
1308
+ <fo:block font-size="12pt">
1309
+ <xsl:value-of select="$linebreak"/>
1310
+ <xsl:value-of select="$linebreak"/>
1311
+ </fo:block>
1312
+ </xsl:otherwise>
1313
+ </xsl:choose>
1314
+ <fo:block>
1315
+ <xsl:call-template name="setId"/>
1316
+ <xsl:apply-templates/>
1317
+ </fo:block>
1318
+ </xsl:template>
1319
+
1301
1320
  <!-- Summary -->
1302
1321
  <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']" priority="3">
1303
1322
  <fo:block font-size="12pt">
1304
1323
  <xsl:value-of select="$linebreak"/>
1305
1324
  <xsl:value-of select="$linebreak"/>
1306
1325
  </fo:block>
1307
- <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt">
1308
- <xsl:variable name="title-summary">
1309
- <xsl:call-template name="getTitle">
1310
- <xsl:with-param name="name" select="'title-summary'"/>
1311
- </xsl:call-template>
1312
- </xsl:variable>
1313
- <xsl:value-of select="$title-summary"/>
1326
+ <fo:block id="{@id}">
1327
+ <fo:block font-weight="bold" keep-with-next="always" margin-top="18pt" margin-bottom="18pt" role="H2">
1328
+ <xsl:variable name="title-summary">
1329
+ <xsl:call-template name="getTitle">
1330
+ <xsl:with-param name="name" select="'title-summary'"/>
1331
+ </xsl:call-template>
1332
+ </xsl:variable>
1333
+ <xsl:value-of select="$title-summary"/>
1334
+ </fo:block>
1335
+ <xsl:apply-templates/>
1314
1336
  </fo:block>
1315
- <xsl:apply-templates/>
1316
1337
  </xsl:template>
1317
1338
  <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
1318
1339
 
@@ -2113,14 +2134,14 @@
2113
2134
  BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
2114
2135
 
2115
2136
  <!--
2116
- <misc-container>
2137
+ <metanorma-extension>
2117
2138
  <presentation-metadata>
2118
2139
  <papersize>letter</papersize>
2119
2140
  </presentation-metadata>
2120
- </misc-container>
2141
+ </metanorma-extension>
2121
2142
  -->
2122
2143
 
2123
- <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
2144
+ <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
2124
2145
  <xsl:variable name="papersize_width_">
2125
2146
  <xsl:choose>
2126
2147
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -2235,7 +2256,7 @@
2235
2256
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
2236
2257
 
2237
2258
  <xsl:variable name="title-list-tables">
2238
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
2259
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
2239
2260
  <xsl:value-of select="$toc_table_title"/>
2240
2261
  <xsl:if test="normalize-space($toc_table_title) = ''">
2241
2262
  <xsl:call-template name="getTitle">
@@ -2245,7 +2266,7 @@
2245
2266
  </xsl:variable>
2246
2267
 
2247
2268
  <xsl:variable name="title-list-figures">
2248
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
2269
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
2249
2270
  <xsl:value-of select="$toc_figure_title"/>
2250
2271
  <xsl:if test="normalize-space($toc_figure_title) = ''">
2251
2272
  <xsl:call-template name="getTitle">
@@ -2255,7 +2276,7 @@
2255
2276
  </xsl:variable>
2256
2277
 
2257
2278
  <xsl:variable name="title-list-recommendations">
2258
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
2279
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
2259
2280
  <xsl:value-of select="$toc_requirement_title"/>
2260
2281
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
2261
2282
  <xsl:call-template name="getTitle">
@@ -2327,7 +2348,7 @@
2327
2348
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
2328
2349
 
2329
2350
  <xsl:variable name="additional_fonts_">
2330
- <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2351
+ <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2331
2352
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
2332
2353
  </xsl:for-each>
2333
2354
  </xsl:variable>
@@ -3049,17 +3070,28 @@
3049
3070
  <!-- admonition -->
3050
3071
  <xsl:attribute-set name="admonition-style">
3051
3072
 
3073
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3074
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
3075
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3076
+
3052
3077
  </xsl:attribute-set> <!-- admonition-style -->
3053
3078
 
3054
3079
  <xsl:attribute-set name="admonition-container-style">
3055
3080
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3056
3081
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
3057
3082
 
3083
+ <xsl:attribute name="padding">2mm</xsl:attribute>
3084
+ <xsl:attribute name="padding-top">3mm</xsl:attribute>
3085
+
3058
3086
  </xsl:attribute-set> <!-- admonition-container-style -->
3059
3087
 
3060
3088
  <xsl:attribute-set name="admonition-name-style">
3061
3089
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3062
3090
 
3091
+ <xsl:attribute name="text-align">center</xsl:attribute>
3092
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3093
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3094
+
3063
3095
  </xsl:attribute-set> <!-- admonition-name-style -->
3064
3096
 
3065
3097
  <xsl:attribute-set name="admonition-p-style">
@@ -3381,10 +3413,10 @@
3381
3413
 
3382
3414
  <xsl:template name="processTablesFigures_Contents">
3383
3415
  <xsl:param name="always"/>
3384
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3416
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3385
3417
  <xsl:call-template name="processTables_Contents"/>
3386
3418
  </xsl:if>
3387
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3419
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3388
3420
  <xsl:call-template name="processFigures_Contents"/>
3389
3421
  </xsl:if>
3390
3422
  </xsl:template>
@@ -3730,6 +3762,8 @@
3730
3762
 
3731
3763
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
3732
3764
 
3765
+ <xsl:call-template name="setBordersTableArray"/>
3766
+
3733
3767
  <xsl:if test="$doctype = 'service-publication'">
3734
3768
  <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute>
3735
3769
  </xsl:if>
@@ -3878,6 +3912,10 @@
3878
3912
 
3879
3913
  </xsl:template>
3880
3914
 
3915
+ <xsl:template name="setBordersTableArray">
3916
+
3917
+ </xsl:template>
3918
+
3881
3919
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3882
3920
  <xsl:param name="continued"/>
3883
3921
  <xsl:if test="normalize-space() != ''">
@@ -4367,6 +4405,8 @@
4367
4405
  <xsl:attribute name="border">none</xsl:attribute>
4368
4406
  </xsl:if>
4369
4407
 
4408
+ <xsl:call-template name="setBordersTableArray"/>
4409
+
4370
4410
  <!-- fn will be processed inside 'note' processing -->
4371
4411
 
4372
4412
  <xsl:if test="$doctype = 'service-publication'">
@@ -4492,6 +4532,8 @@
4492
4532
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
4493
4533
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
4494
4534
 
4535
+ <xsl:call-template name="setBordersTableArray"/>
4536
+
4495
4537
  <xsl:if test="$doctype = 'service-publication'">
4496
4538
  <xsl:attribute name="border-bottom">1.1pt solid black</xsl:attribute>
4497
4539
  </xsl:if>
@@ -4519,6 +4561,8 @@
4519
4561
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4520
4562
  </xsl:if>
4521
4563
 
4564
+ <xsl:call-template name="setBordersTableArray"/>
4565
+
4522
4566
  <xsl:call-template name="setTableRowAttributes"/>
4523
4567
  <xsl:apply-templates/>
4524
4568
  </fo:table-row>
@@ -4542,6 +4586,8 @@
4542
4586
  <xsl:with-param name="default">center</xsl:with-param>
4543
4587
  </xsl:call-template>
4544
4588
 
4589
+ <xsl:call-template name="setBordersTableArray"/>
4590
+
4545
4591
  <xsl:if test="ancestor::*[local-name()='preface']">
4546
4592
  <xsl:if test="$doctype != 'service-publication'">
4547
4593
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
@@ -4605,6 +4651,8 @@
4605
4651
 
4606
4652
  <!-- bsi -->
4607
4653
 
4654
+ <xsl:call-template name="setBordersTableArray"/>
4655
+
4608
4656
  <xsl:if test="ancestor::*[local-name()='preface']">
4609
4657
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
4610
4658
  </xsl:if>
@@ -4667,7 +4715,7 @@
4667
4715
  </fn>
4668
4716
  -->
4669
4717
  <!-- 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">
4718
+ <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
4719
 
4672
4720
  <!-- list of footnotes to calculate actual footnotes number -->
4673
4721
  <xsl:variable name="p_fn_">
@@ -4724,8 +4772,7 @@
4724
4772
  </fo:basic-link>
4725
4773
  </fo:inline>
4726
4774
  </xsl:variable>
4727
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
4728
- gen_id=<xsl:value-of select="$gen_id"/> -->
4775
+
4729
4776
  <xsl:choose>
4730
4777
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
4731
4778
  <xsl:copy-of select="$footnote_inline"/>
@@ -4784,7 +4831,7 @@
4784
4831
  <!-- commented:
4785
4832
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4786
4833
  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])]">
4834
+ <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
4835
  <!-- copy unique fn -->
4789
4836
  <fn gen_id="{generate-id(.)}">
4790
4837
  <xsl:copy-of select="@*"/>
@@ -7350,7 +7397,9 @@
7350
7397
 
7351
7398
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
7352
7399
  <xsl:if test="number($scale) &lt; 100">
7353
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7400
+
7401
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7402
+
7354
7403
  </xsl:if>
7355
7404
 
7356
7405
  </xsl:if>
@@ -8276,7 +8325,7 @@
8276
8325
  <!-- sourcecode -->
8277
8326
  <!-- =============== -->
8278
8327
 
8279
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
8328
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
8280
8329
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
8281
8330
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
8282
8331
 
@@ -8365,6 +8414,12 @@
8365
8414
  </xsl:attribute>
8366
8415
  </xsl:for-each>
8367
8416
 
8417
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
8418
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
8419
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8420
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8421
+ </xsl:if>
8422
+
8368
8423
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8369
8424
  </fo:block>
8370
8425
 
@@ -8413,7 +8468,7 @@
8413
8468
  </xsl:template>
8414
8469
 
8415
8470
  <!-- outer table with line numbers for sourcecode -->
8416
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8471
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
8417
8472
  <fo:block>
8418
8473
  <fo:table width="100%" table-layout="fixed">
8419
8474
  <xsl:copy-of select="@id"/>
@@ -8425,16 +8480,16 @@
8425
8480
  </fo:table>
8426
8481
  </fo:block>
8427
8482
  </xsl:template>
8428
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8483
+ <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
8484
  <xsl:apply-templates/>
8430
8485
  </xsl:template>
8431
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8486
+ <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
8487
  <fo:table-row>
8433
8488
  <xsl:apply-templates/>
8434
8489
  </fo:table-row>
8435
8490
  </xsl:template>
8436
8491
  <!-- 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">
8492
+ <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
8493
  <fo:table-cell>
8439
8494
  <fo:block>
8440
8495
 
@@ -8454,8 +8509,9 @@
8454
8509
  </fo:block>
8455
8510
  </fo:table-cell>
8456
8511
  </xsl:template>
8512
+
8457
8513
  <!-- second td with sourcecode -->
8458
- <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8514
+ <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
8515
  <fo:table-cell>
8460
8516
  <fo:block>
8461
8517
  <xsl:apply-templates/>
@@ -8693,7 +8749,25 @@
8693
8749
  <xsl:template match="*[local-name()='pre']" name="pre">
8694
8750
  <fo:block xsl:use-attribute-sets="pre-style">
8695
8751
  <xsl:copy-of select="@id"/>
8696
- <xsl:apply-templates/>
8752
+ <xsl:choose>
8753
+
8754
+ <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' -->
8755
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
8756
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8757
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8758
+ </xsl:if>
8759
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
8760
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
8761
+ <mtext><xsl:value-of select="."/></mtext>
8762
+ </math>
8763
+ </fo:instream-foreign-object>
8764
+ </xsl:when>
8765
+
8766
+ <xsl:otherwise>
8767
+ <xsl:apply-templates/>
8768
+ </xsl:otherwise>
8769
+
8770
+ </xsl:choose>
8697
8771
  </fo:block>
8698
8772
  </xsl:template>
8699
8773
  <!-- =============== -->
@@ -10342,8 +10416,8 @@
10342
10416
 
10343
10417
  <xsl:variable name="toc_level">
10344
10418
  <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
10345
- <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
10346
- <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
10419
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
10420
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
10347
10421
  <xsl:choose>
10348
10422
  <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
10349
10423
  <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
@@ -11335,6 +11409,7 @@
11335
11409
  <xsl:choose>
11336
11410
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
11337
11411
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
11412
+ <xsl:when test="$align = 'justified'">justify</xsl:when>
11338
11413
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
11339
11414
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
11340
11415
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>