~ubuntu-branches/ubuntu/wily/dblatex/wily

« back to all changes in this revision

Viewing changes to xsl/fasttext.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Hoenen
  • Date: 2008-08-11 20:28:56 UTC
  • mfrom: (4.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080811202856-d2qjg24ut53mgufx
Tags: 0.2.9-3
* Improve CJK (Chinese/Japanese/Korean) support:
  + Let XSL configuration parameter cjk.font default to gkai (instead of the
    cyberbit font not included in Debian).
  + Add Suggests dependency on latex-cjk-all for the gkai fonts.
  + Fix the db2latex style not to collide with the CJKutf8.sty file.
  Thanks to W. Martin Borgert for reporting and hints.
  Closes: #482857, #492350
* Fix a name clash with TeXLive for spanish documents in native style.
  Thanks to W. Martin Borgert for reporting.  Closes: #492304
* Support underscore characters in xreflabel attributes.  Thanks to
  Sébastien Villemot for reporting.  Closes: #492959

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version='1.0' encoding="iso-8859-1"?>
 
2
<!DOCTYPE xsl:stylesheet [
 
3
<!ENTITY t1 "&#x370;t">
 
4
<!ENTITY t2 "&#x371;t">
 
5
<!ENTITY u1 "&#x370;u">
 
6
<!ENTITY u2 "&#x371;u">
 
7
<!ENTITY v1 "&#x370;u">
 
8
<!ENTITY v2 "&#x371;u">
 
9
]>
2
10
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
11
                xmlns:m="http://www.w3.org/1998/Math/MathML"
4
12
                version='1.0'>
8
16
    ############################################################################ -->
9
17
 
10
18
<!-- These templates boost the text processing but needs some post-parsing
11
 
     to escape the TeX characters. -->
 
19
     to escape the TeX characters and do the encoding. -->
12
20
 
 
21
<!-- use Reserved Unicode characters as delimiters -->
13
22
<xsl:template name="scape" >
14
23
  <xsl:param name="string"/>
15
 
  <xsl:text>&lt;t&gt;</xsl:text>
 
24
  <xsl:text>&t1;</xsl:text>
16
25
  <xsl:value-of select="$string"/>
17
 
  <xsl:text>&lt;/t&gt;</xsl:text>
 
26
  <xsl:text>&t2;</xsl:text>
18
27
</xsl:template>
19
28
 
20
 
<!-- tag the text for the perl script -->
 
29
<!-- tag the text for post-processing -->
21
30
<xsl:template match="text()">
22
 
  <xsl:text>&lt;t&gt;</xsl:text>
 
31
  <xsl:text>&t1;</xsl:text>
23
32
  <xsl:value-of select="."/>
24
 
  <!--
25
 
  <xsl:value-of select="normalize-space(.)"/>
26
 
  -->
27
 
  <xsl:text>&lt;/t&gt;</xsl:text>
 
33
  <xsl:text>&t2;</xsl:text>
 
34
</xsl:template>
 
35
 
 
36
<xsl:template match="text()" mode="latex.programlisting">
 
37
  <xsl:text>&v1;</xsl:text>
 
38
  <xsl:value-of select="."/> 
 
39
  <xsl:text>&v2;</xsl:text>
 
40
</xsl:template>
 
41
 
 
42
<xsl:template match="text()" mode="latex.verbatim">
 
43
  <xsl:text>&v1;</xsl:text>
 
44
  <xsl:value-of select="."/> 
 
45
  <xsl:text>&v2;</xsl:text>
 
46
</xsl:template>
 
47
 
 
48
 
 
49
<!-- replace some text in a string *as is* the string is already escaped.
 
50
     Here it ends to inserting raw text between tags. -->
 
51
<xsl:template name="scape-replace" >
 
52
  <xsl:param name="string"/>
 
53
  <xsl:param name="from"/>
 
54
  <xsl:param name="to"/>
 
55
  <xsl:call-template name="string-replace">
 
56
    <xsl:with-param name="string" select="$string"/>
 
57
    <xsl:with-param name="from" select="$from"/>
 
58
    <xsl:with-param name="to" select="concat('&t2;',$to,'&t1;')"/>
 
59
  </xsl:call-template>
 
60
</xsl:template>
 
61
 
 
62
<!-- just ask for encoding -->
 
63
<xsl:template name="scape-encode" >
 
64
  <xsl:param name="string"/>
 
65
  <xsl:text>&u1;</xsl:text>
 
66
  <xsl:value-of select="$string"/>
 
67
  <xsl:text>&u2;</xsl:text>
28
68
</xsl:template>
29
69
 
30
70
<!-- specific behaviour for MML -->