{{script}}
from rlextra.rml2pdf.rml2pdf import __URL__, __version__
import re
BRANCH=re.sub('^.*/svn/private/(.*)/rlextra/rml2pdf/rml2pdf.py','\\1',__URL__[5:-1].strip())
REVISION = __version__.split()[2]
DATE = ' '.join(__version__.split()[3:5])
{{endscript}}<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="rml2pdf-userguide.pdf">
<!-- Last Modified:             $Date: 2009-09-28 16:22:06 +0100 (Mon, 28 Sep 2009) $ -->
<!-- Document Version Number:   $Revision: 35134 $            -->
<!-- THIS RML FILE WAS AUTOMATICALLY GENERATED FROM A PREPPY PREPROCESSOR SOURCE. -->
<!-- DO NOT EDIT THE GENERATED RML DIRECTLY. -->

{{script}}
### this is a "preppy" script for generating the rml user guide.
### It allows inline computations and function definitions.
### The generator should be run twice with the same dictionary
### in order to determine the "table of contents" rml description.

### shorthand
code = '<font face="Courier" color="indigo">'
endcode = '</font>'

### some generator functions have 2 versions: dull and simple vs not dull and complex

import string

# for a more interesting document set DULL to 0

DULL = 1
if dictionary.has_key("DULL"):
DULL = dictionary["DULL"]

# If this is the second or more preppy pass then contents_list will have the
# table of contents.

CONTENTS_LIST = dictionary["CONTENTS_LIST"] = dictionary.get("CONTENTS_LIST", [])
chapter = [0]
section = [0]

def partHeader(name, CONTENTS_LIST=CONTENTS_LIST):
"boilerplate part header"
d = {"n":name}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<h2>%(n)s .. <getName id="%(n)s" default="((last))"/></h2>
""" % d)
return """
<nextFrame/>
<spacer length="288"/>
<h1>%(n)s</h1>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

def partHeader_notDULL(name, CONTENTS_LIST=CONTENTS_LIST):
"boilerplate part header"
d = {"n":name}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<illustration height="1cm" width="0">
<fill color="black"/>
<rect x="0" y="0" width="16cm" height="0.8cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.6cm"/>
<drawString x="0.3cm" y="0.1cm">%(n)s</drawString>
<drawRightString x="15.7cm" y="0.1cm"><getName id="%(n)s" default="((last))"/></drawRightString>
</illustration>
""" % d)
return """
<nextFrame/>
<illustration height="1cm" width="0">
<fill color="black"/>
<rect x="0" y="0" width="16cm" height="0.8cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.6cm"/>
<drawCentredString x="8cm" y="0.1cm">%(n)s</drawCentredString>
</illustration>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

def chapterHeader_notDULL(name, CONTENTS_LIST=CONTENTS_LIST, chapter=chapter, section=section, chaptername=None):
"boilerplate chapter header text with contents entry"
if chaptername is not None:
c = chapter[0] = chaptername
c = chapter[0] = chapter[0]+1
section[0] = 0
d = {"n":name, "c": c}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<illustration height=".8cm" width="0">
<fill color="darkolivegreen"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.4cm"/>
<drawString x="0.3cm" y="0.1cm">%(c)s. %(n)s</drawString>
<drawRightString x="15.7cm" y="0.1cm"><getName id="%(n)s" default="((last))"/></drawRightString>
</illustration>
""" % d)
return """
<nextFrame/><!--<condPageBreak height="144"/>-->
<namedString id="%(n)s_number"><getName id="chapterNumber" default="???"/></namedString>
<namedString id="chapterNumber">%(c)s</namedString>
<illustration height=".8cm" width="0">
<fill color="darkolivegreen"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.4cm"/>
<drawCentredString x="8cm" y="0.1cm">%(c)s. %(n)s</drawCentredString>
</illustration>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

def chapterHeader(name, CONTENTS_LIST=CONTENTS_LIST, chapter=chapter, section=section, chaptername=None):
"boilerplate chapter header text with contents entry"
if chaptername is not None:
c = chapter[0] = chaptername
c = chapter[0] = chapter[0]+1
section[0] = 0
d = {"n":name, "c": c}
CONTENTS_LIST.append("""
<para style="contents">
<name id="chapterNumber" value="%(c)s"/>
<getName id="chapterNumber"/>.
%(n)s .. <getName id="%(n)s" default="((last))"/>
</para>
""" % d)
return """
<nextFrame/>
<condPageBreak height="144"/>
<namedString id="%(n)s_number"><getName id="chapterNumber" default="???"/></namedString>
<h2>
<name id="chapterNumber" value="%(c)s"/>
<seqReset id="sectionNumber"/>
<getName id="chapterNumber"/>.
%(n)s
</h2>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

def sectionHeader(name, CONTENTS_LIST=CONTENTS_LIST, chapter=chapter, section=section, chaptername=None):
"boilerplate section header text with contents entry"
c = chapter[0]
s = section[0] = section[0]+1
d = {"c": c, "s": s, "n": name}
CONTENTS_LIST.append("""
<para style="contents2">
%(c)s.%(s)s %(n)s ... <getName id="%(c)s.%(s)s %(n)s" default="((last))"/>
</para>
""" % d)
return """
<condPageBreak height="144"/>
<h3>
%(c)s.%(s)s %(n)s
</h3>
<namedString id="%(c)s.%(s)s %(n)s"><pageNumber/></namedString>
""" % d

def sectionHeader_notDULL(name, CONTENTS_LIST=CONTENTS_LIST, chapter=chapter, section=section, chaptername=None):
"boilerplate section header text with contents entry"
c = chapter[0]
s = section[0] = section[0]+1
d = {"c": c, "s": s, "n": name}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<illustration height=".8cm" width="0">
<fill color="slategray"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica" size="0.3cm"/>
<drawString x="1cm" y="0.1cm">%(c)s.%(s)s %(n)s </drawString>
<drawRightString x="15.7cm" y="0.1cm"><getName id="%(c)s.%(s)s %(n)s" default="((last))"/></drawRightString>
</illustration>
""" % d)
return """
<condPageBreak height="144"/>
<illustration height=".8cm" width="0">
<fill color="slategray"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.4cm"/>
<drawString x="1cm" y="0.1cm">%(c)s.%(s)s %(n)s</drawString>
</illustration>
<namedString id="%(c)s.%(s)s %(n)s"><pageNumber/></namedString>
""" % d

def appendixHeader(name, CONTENTS_LIST=CONTENTS_LIST):
"boilerplate appendes header"
d = {"n":name}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<h2>%(n)s .. <getName id="%(n)s" default="XXX"/></h2>
""" % d)
return """
<nextFrame/>
<h1>
%(n)s
</h1>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

def appendixHeader_notDULL(name, CONTENTS_LIST=CONTENTS_LIST):
"boilerplate appendes header"
d = {"n":name}
CONTENTS_LIST.append("""
<condPageBreak height="30"/>
<illustration height=".8cm" width="0">
<fill color="darkolivegreen"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.4cm"/>
<drawString x="0.3cm" y="0.1cm">%(n)s</drawString>
<drawRightString x="15.7cm" y="0.1cm"><getName id="%(n)s" default="((last))"/></drawRightString>
</illustration>
""" % d)
return """
<nextFrame/>
<illustration height=".8cm" width="0">
<fill color="darkolivegreen"/>
<rect x="0" y="0" width="16cm" height="0.6cm" fill="1" stroke="0"/>
<fill color="white"/>
<setFont name="Helvetica-Bold" size="0.4cm"/>
<drawCentredString x="8cm" y="0.1cm">%(n)s</drawCentredString>
</illustration>
<namedString id="%(n)s"><pageNumber/></namedString>
""" % d

# use non-dull generators if not dull
if not DULL:
partHeader = partHeader_notDULL
chapterHeader = chapterHeader_notDULL
sectionHeader = sectionHeader_notDULL
appendixHeader = appendixHeader_notDULL

# the following is provided for fancy annotations
def circular(data, illustration=1, radius=3, segments=12, xcenter=297):
from string import join
(minu, minv) = (maxu, maxv) = center = (0,0)
from math import sin, cos, pi
unitradians = 2*pi/segments
unitrho = radius/3.0
L = []
x,y = 0,0
for i in range(segments):
for (dx, dy) in data:
x = x+dx
y = y+dy
theta = x*unitradians
rho = radius*0.5 + 2*unitrho*y
u = rho*sin(theta)
v = rho*cos(theta)
#print "theta, rho", theta, rho
if not L: L = ['<path x="%scm" y="%scm" fill="1" stroke="1"> <curvesto>' %(u,v)]
L.append("%scm %scm" % (u,v))
maxu = max(u, maxu)
maxv = max(v, maxv)
minu = min(u, minu)
minv = min(v, minv)
L.append("</curvesto></path>")
path = join(L, "\n")
#path = """
#<fill color="darkolivegreen"/>
#<stroke color="black"/>
#<lineMode width="5"/>
#%s
#""" % path
if not illustration:
return path
illustration = """
<illustration height="%scm" width="0cm">
<translate dx="%s" dy="%s"/>
%s
</illustration>""" % ((maxv-minv), xcenter, -minv, path)
return illustration

def makeTagRef():
import tagref
return tagref.returnFullTagRef(standalone=0)

tagref = makeTagRef()

{{endscript}}
-->

<template pageSize="(595, 842)"
leftMargin="72"
showBoundary="0"
title="RML User Guide"
author="Reportlab Inc"
>

<pageTemplate id="cover">
<pageGraphics>
{{if DULL}}
<setFont name="Times-Bold" size="48"/>
{{else}}
<fill color="darkred"/>
<setFont name="Helvetica-BoldOblique" size="48"/>
<fill color="indigo"/>
{{endif}}
<drawCentredString x="297" y="516">RML User Guide</drawCentredString>
<setFont name="Times-Bold" size="12"/>
<drawCentredString x="297" y="414">Report Markup Language</drawCentredString>

{{if not DULL}}
<fill color="firebrick"/>
{{endif}}

<lines>
72 132 523 132
</lines>

<image file="images/replogo.gif" x="155" y="626"/>

<setFont name="Times-Roman" size="10"/>
<drawString x="72" y="110">ReportLab Europe Ltd.</drawString>
<drawString x="72" y="98">Media House</drawString>
<drawString x="72" y="86">3 Palmerston Road</drawString>
<drawString x="72" y="74">Wimbledon</drawString>
<drawString x="72" y="62">London SW19 1PG, UK</drawString>
{{if not DULL}}
<translate dx="297" dy="273"/>
<scale sx="2.0" sy="1.0"/>
<fill color="goldenrod"/>
<circle x="0" y="0" radius="3cm" fill="1" stroke="0"/>
<fill color="darkorange"/>
<stroke color="indianred"/>
{{ circular([(1, 0), (0,1), (-1, 0), (0,-1),
(1, 0), (0,1), (-1, 0), (0,-1),
(1, 0), (0,1), (-1, 0), (0,-1),
(1, 0), (0,1), (-1, 0), (0,-1),
(1,0)], illustration=0) }}
{{endif}}
</pageGraphics>
<frame id="first" x1="72" y1="72" width="451" height="698"/>
</pageTemplate>

<pageTemplate id="contents">
<pageGraphics>
</pageGraphics>
<frame id="first" x1="72" y1="72" width="451" height="698"/>
</pageTemplate>

<pageTemplate id="inside">
<pageGraphics>
<lines>
72 796 523 796
</lines>
<setFont name="Times-Roman" size="10"/>
<drawString x="72" y="808">RML User Guide</drawString>
<drawRightString x="523" y="808">{{BRANCH}} {{REVISION}} {{DATE}}</drawRightString>
<drawCentredString x="297.5" y="60">Page <pageNumber/> of <getName id="LASTPAGENO" default="((last))"/></drawCentredString>
</pageGraphics>
<frame id="first" x1="72" y1="72" width="451" height="698"/>
</pageTemplate>

<pageTemplate id="ColorsAppendix">
<pageGraphics>
<lines>
72 796 523 796
</lines>
<setFont name="Times-Roman" size="10"/>
<drawString x="72" y="808">RML User Guide</drawString>
<drawRightString x="523" y="808">{{BRANCH}} {{REVISION}} {{DATE}}</drawRightString>
<drawCentredString x="297.5" y="60">Page <pageNumber/> of <getName id="LASTPAGENO" default="((last))"/></drawCentredString>
</pageGraphics>
<frame id="title" x1="72" y1="717" width="451" height="66"/>
<frame id="columnOne" x1="72" y1="72" width="212" height="641"/>
<frame id="columnTwo" x1="311" y1="72" width="212" height="641"/>
</pageTemplate>

<pageTemplate id="ColorsAppendixTwo">
<pageGraphics>
<lines>
72 796 523 796
</lines>
<setFont name="Times-Roman" size="10"/>
<drawString x="72" y="808">RML User Guide</drawString>
<drawRightString x="523" y="808">{{BRANCH}} {{REVISION}} {{DATE}}</drawRightString>
<drawCentredString x="297.5" y="60">Page <pageNumber/> of <getName id="LASTPAGENO" default="((last))"/></drawCentredString>
</pageGraphics>
<frame id="columnOne" x1="72" y1="72" width="212" height="707"/>
<frame id="columnTwo" x1="311" y1="72" width="212" height="707"/>
</pageTemplate>


<pageTemplate id="GreekAppendix">
<pageGraphics>
<lines>
72 796 523 796
</lines>
<setFont name="Times-Roman" size="10"/>
<drawString x="72" y="808">RML User Guide</drawString>
<drawRightString x="523" y="808">{{BRANCH}} {{REVISION}} {{DATE}}</drawRightString>
<drawCentredString x="297.5" y="60">Page <pageNumber/> of <getName id="LASTPAGENO" default="((last))"/></drawCentredString>
</pageGraphics>
<frame id="title" x1="72" y1="747" width="451" height="36"/>
<frame id="columnOne" x1="45" y1="72" width="106" height="671"/>
<frame id="columnTwo" x1="151" y1="72" width="106" height="671"/>
<frame id="columnThree" x1="281" y1="72" width="106" height="671"/>
<frame id="columnFour" x1="387" y1="72" width="106" height="671"/>
</pageTemplate>

</template>

<stylesheet>
<initialize>
<name id="RMLVersionNumber" value="&RMLVersionNumber;"/>
<name id="RMLDTDFileName" value="&RMLDTDFileName;"/>
<name id="RMLVersionString" value="&RMLVersionString;"/>
<alias id="style.normal" value="style.Normal"/>
<alias id="pre.defaultStyle" value="preStyle"/>
</initialize>

<blockTableStyle id="colorsTableStyle">
<blockValign value="TOP" stop="(1,89)"/>
<blockAlignment value="LEFT" stop="1,89"/>
<blockFont name="Courier" size="8" leading="1"/>
<blockLeading length="1" start="(1,1)" stop="(1,1)"/>
<blockFont name="Courier-Bold" size="12" leading="12" start="(0, 0)" stop="(1, 0)"/>
<blockFont name="Courier-Bold" size="12" leading="12" start="(0, 45)" stop="(1, 45)"/>
</blockTableStyle>

<blockTableStyle id="colorsTableStylePageTwo">
<blockValign value="TOP" stop="(1,27)"/>
<blockAlignment value="LEFT" stop="1,27"/>
<blockFont name="Courier" size="8" leading="1"/>
<blockLeading length="1" start="(1,1)" stop="(1,1)"/>
<blockFont name="Courier-Bold" size="12" leading="12" start="(0, 0)" stop="(1, 0)"/>
</blockTableStyle>

<blockTableStyle id="simpleStyle">
<lineStyle kind="GRID" colorName="black"/>
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>

<blockTableStyle id="myBlockTableStyle1">
<!-- Used in Example 10                                      -->
<!-- for comments look in the annotated version later in doc -->
<blockFont name="Courier-Bold" start="0,1" stop="-1,-1"/>
<blockFont name="Helvetica-BoldOblique" size="24" start="0,0" stop="3,0"/>
<blockTextColor colorName="black"/>
<blockTextColor colorName="white" start="0,0" stop="3,0"/>
<blockTextColor colorName="blue" start="1,1" stop="1,6"/>
<blockBackground colorName="red" start="0,0" stop="3,0"/>
<blockBackground colorName="cornsilk" start="0,1" stop="-1,-1"/>
<blockBackground colorName="lightcoral" start="3,3" stop="3,3"/>
</blockTableStyle>

<blockTableStyle id="myBlockTableStyle2">
<!-- This is for EXAMPLE 11 -->
<blockFont name="Courier-Bold" size="10" start="0,1" stop="-1,-1"/>
<blockFont name="Helvetica-BoldOblique" size="10" start="0,0" stop="3,0"/>
<blockTextColor colorName="black"/>
<blockTextColor colorName="green" start="2,2" stop="3,3"/>
<blockAlignment value="CENTER"/>
<blockAlignment value="RIGHT" start="3,0" stop="3,-1"/>
<blockAlignment value="LEFT" start="0,1" stop="0,-1"/>
<blockValign value="TOP" start="0,0" stop="-1,0"/>
<blockValign value="MIDDLE" start="2,2" stop="3,3"/>
<lineStyle kind="GRID" colorName="silver"/>
<lineStyle kind="LINEBELOW" colorName="orangered" start="0,0" stop="-1,0" thickness="5"/>
<lineStyle kind="LINEAFTER" colorName="maroon" start="1,1" stop="1,6" thickness="1"/>
</blockTableStyle>

<blockTableStyle id="myBlockTableStyle3">
<!-- For use with EXAMPLE 12 -->
<blockBackground colorName="silver" start="0,0" stop="-1,0"/>
<blockBackground colorName="darkslategray" start="0,1" stop="-1,1"/>
<blockBackground colorName="silver" start="0,2" stop="-1,2"/>
<blockBackground colorName="darkslategray" start="0,3" stop="-1,3"/>
<blockBackground colorName="silver" start="0,4" stop="-1,4"/>
<blockBackground colorName="darkslategray" start="0,5" stop="-1,5"/>
<blockAlignment value="CENTER"/>
<blockValign value="MIDDLE"/>
<blockFont name="Helvetica-BoldOblique" size="10"/>
<blockLeftPadding length="20" start="0,0" stop="0,-1"/>
<blockRightPadding length="20" start="2,0" stop="2,-1"/>
<blockBottomPadding length="40" start="0,0" stop="-1,0"/>
<blockTopPadding length="40" start="0,2" stop="-1,2"/>
<blockBottomPadding length="40" start="-1,4" stop="-1,4"/>
<blockTopPadding length="40" start="0,4" stop="0,4"/>
<lineStyle kind="GRID" colorName="darkblue"/>
</blockTableStyle>


<boxStyle name="special1"
labelFontName="Helvetica"
fontSize="10"
alignment="RIGHT"
textColor="red"
fontName="Helvetica"
labelFontSize="10"
labelAlignment="RIGHT"
labelTextColor="blue"
boxStrokeColor="red"
boxFillColor="pink"/>

<boxStyle name="special2"
parent="special1"
fontName="Courier"
fontSize="11"
textColor="green"
labelFontName="Courier"
labelFontSize="11"
labelTextColor="green"
boxFillColor="yellow"
boxStrokeColor="red"/>

<paraStyle name="style.h1"
fontName="Times-Bold"
fontSize="20"
leading="36"
/>

<paraStyle name="style.h2"
fontName="Times-Bold"
fontSize="20"
leading="36"
/>

<paraStyle name="style.h3"
fontName="Times-Bold"
fontSize="12"
leading="15"
/>

<paraStyle name="contents"
fontName="Times-Bold"
fontSize="12"
endDots="."
/>

<paraStyle name="contents2"
fontName="Times-Roman"
fontSize="12"
leftIndent="20"
endDots="."
/>

<paraStyle name="contents2a"
fontName="Times-Roman"
fontSize="12"
leftIndent="20"
spaceAfter="12"
endDots="."
/>

<paraStyle name="contents2h"
fontName="Times-Bold"
fontSize="12"
leftIndent="20"
endDots="."
/>

<paraStyle name="contents3"
fontName="Times-Roman"
fontSize="12"
leftIndent="40"
endDots="."
/>

<paraStyle name="contents3a"
fontName="Times-Roman"
fontSize="12"
leftIndent="40"
spaceAfter="12"
endDots="."
/>

<paraStyle name="contents3h"
fontName="Times-Bold"
fontSize="12"
leftIndent="40" 
endDots="."
/>

<paraStyle name="style.Normal"
fontName="Times-Roman"
fontSize="10"
leading="12"
spaceAfter="12"
firstLineIndent="0"
/>

<paraStyle name="programListing"
parent="style.Normal"
fontName="Courier-Bold"
fontSize="8"
leading="10"
spaceBefore="0"
spaceAfter="0"
textColor="darkblue"
leftIndent="1.2cm"
/>

<paraStyle name="programListingConventionLabel"
parent="programListing"
spaceAfter="0"
leftIndent="0"
/>

<paraStyle name="bulletList"
parent="style.Normal"
bulletFontName="ZapfDingbats"
bulletFontSize="5"
bulletIndent="20"
leftIndent="35"
spaceAfter="6"
/>

<paraStyle name="bulletNospace"
parent="bulletList"
spaceAfter="0"
/>

<paraStyle name="nospace"
spaceAfter="0"
parent="style.Normal"
/>

<paraStyle name="preStyle"
parent="style.Code"
firstLineIndent="35"
leftIndent="35"
spaceBefore="10"
spaceAfter="10"
/>

<paraStyle name="figureCaption"
spaceBefore="0"
spaceAfter="15"
alignment="CENTER"
fontSize="8"
fontName="Times-Italic"
/>

<paraStyle name="GreekPara"
parent="style.normal"
alignment="CENTER"
/>

<paraStyle name="paddingTableStyle"
fontName="Helvetica-BoldOblique"
fontSize="10"
textColor="white"
alignment="CENTER"
/>

</stylesheet>


<story>

<!--
<h1>This is the last page <getName id="LASTPAGENO" default="((last))"/></h1>

<para>one less than that is
<evalString default="XXXX" imports="string">
string.split(repr(<getName id="LASTPAGENO" default="-999"/> - 1))
</evalString>
</para>
-->

<setNextTemplate name="cover"/>

<setNextTemplate name="contents"/>
<nextFrame/>


<h1>RML User Guide</h1>

<h2>Contents</h2>

{{if CONTENTS_LIST}}
{{ string.join(CONTENTS_LIST, "\n") }}
{{script}}
CONTENTS_LIST[:] = [] # reset contents list
{{endscript}}

{{else}}
<para> FIRST PASS: NO CONTENTS LIST PREPPY SHOULD RUN TWICE! </para>
{{endif}}

<setNextTemplate name="inside"/>
<nextFrame/>



