Skip to content

Commit e139845

Browse files
xslt update based on metanorma/mn-native-pdf@c942999
1 parent a7656be commit e139845

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

lib/isodoc/plateau/plateau.international-standard.xsl

+35-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77
<xsl:variable name="debug">false</xsl:variable>
88

9-
<xsl:variable name="isIgnoreComplexScripts">true</xsl:variable>
9+
<!-- <xsl:variable name="isIgnoreComplexScripts">true</xsl:variable> -->
1010

1111
<xsl:variable name="doctype" select="//plateau:plateau-standard[1]/plateau:bibdata/plateau:ext/plateau:doctype[@language = '' or not(@language)]"/>
1212

1313
<xsl:variable name="i18n_doctype_dict_annex"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">doctype_dict.annex</xsl:with-param></xsl:call-template></xsl:variable>
1414
<xsl:variable name="i18n_doctype_dict_technical_report"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">doctype_dict.technical-report</xsl:with-param></xsl:call-template></xsl:variable>
1515
<xsl:variable name="i18n_table_of_contents"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">table_of_contents</xsl:with-param></xsl:call-template></xsl:variable>
1616

17+
<xsl:variable name="vertical_layout" select="normalize-space(/*/plateau:metanorma-extension/plateau:presentation-metadata/plateau:vertical-layout)"/>
18+
1719
<xsl:variable name="page_header">
1820
<xsl:value-of select="/*/plateau:metanorma-extension/plateau:presentation-metadata/plateau:use-case"/>
1921
<xsl:text>_</xsl:text>
@@ -90,23 +92,47 @@
9092
</fo:simple-page-master>
9193

9294
<fo:simple-page-master master-name="document_preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
93-
<fo:region-body margin-top="50mm" margin-bottom="35mm" margin-left="26mm" margin-right="34mm"/>
95+
<xsl:if test="$vertical_layout = 'true'">
96+
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
97+
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
98+
</xsl:if>
99+
<fo:region-body margin-top="50mm" margin-bottom="35mm" margin-left="26mm" margin-right="34mm">
100+
<xsl:if test="$vertical_layout = 'true'">
101+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
102+
</xsl:if>
103+
</fo:region-body>
94104
<fo:region-before region-name="header" extent="50mm"/>
95105
<fo:region-after region-name="footer" extent="35mm"/>
96106
<fo:region-start region-name="left-region" extent="26mm"/>
97107
<fo:region-end region-name="right-region" extent="34mm"/>
98108
</fo:simple-page-master>
99109

100110
<fo:simple-page-master master-name="document_toc" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
101-
<fo:region-body margin-top="16.5mm" margin-bottom="22mm" margin-left="14.5mm" margin-right="22.3mm"/>
111+
<xsl:if test="$vertical_layout = 'true'">
112+
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
113+
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
114+
</xsl:if>
115+
<fo:region-body margin-top="16.5mm" margin-bottom="22mm" margin-left="14.5mm" margin-right="22.3mm">
116+
<xsl:if test="$vertical_layout = 'true'">
117+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
118+
</xsl:if>
119+
</fo:region-body>
102120
<fo:region-before region-name="header" extent="16.5mm"/>
103121
<fo:region-after region-name="footer" extent="22mm"/>
104122
<fo:region-start region-name="left-region" extent="14.5mm"/>
105123
<fo:region-end region-name="right-region" extent="22.3mm"/>
106124
</fo:simple-page-master>
107125

108126
<fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
109-
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
127+
<xsl:if test="$vertical_layout = 'true'">
128+
<xsl:attribute name="page-width"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
129+
<xsl:attribute name="page-height"><xsl:value-of select="$pageWidth"/>mm</xsl:attribute>
130+
</xsl:if>
131+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm">
132+
<xsl:if test="$vertical_layout = 'true'">
133+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
134+
</xsl:if>
135+
</fo:region-body>
110136
<fo:region-before region-name="header" extent="{$marginTop}mm"/>
111137
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
112138
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
@@ -235,6 +261,11 @@
235261
<fo:static-content flow-name="header" role="artifact" id="__internal_layout__preface_header_{generate-id()}">
236262
<!-- grey background -->
237263
<fo:block-container absolute-position="fixed" left="24.2mm" top="40mm" height="231.4mm" width="161mm" background-color="rgb(242,242,242)" id="__internal_layout__preface_header_{$num}_{generate-id()}">
264+
<xsl:if test="$vertical_layout = 'true'">
265+
<xsl:attribute name="top">24.2mm</xsl:attribute>
266+
<xsl:attribute name="left">40mm</xsl:attribute>
267+
<xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
268+
</xsl:if>
238269
<fo:block> </fo:block>
239270
</fo:block-container>
240271
</fo:static-content>

0 commit comments

Comments
 (0)