RML Example 6: Paragraphs RML Example 5: Paragraphs RML (Report Markup Language) is ReportLab's own language for specifying the appearance of a printed page, which is converted into PDF by the utility rml2pdf.These RML samples showcase techniques and features for generating various types of ouput and are distributed within our commercial package as test cases. Each should be self explanatory and stand alone.style='indexstyle', dot='.', tableStyle='indexTableStyle'Paragraph 1: About this pageThis page tests out a number of attributes of the paraStyle tag.
This paragraph is in a style we have called "style1". It should be a normal paragraph, set in Courier 12 pt.
It should be a normal paragraph, set in Courier (not bold).
It should be a normal paragraph, set in Courier 12 pt. This <span> should be red.Paragraph 2: Indent LeftThis paragraph is in a style we have called "style2". It should be indented on the left.
It should be indented on the left by 1 inch.
It should be indented on the left. This should be struck out.Paragraph 3: Indent RightThis paragraph is in a style we have called "style3". It should be indented on the right. It should be indented on the right by 1 inch. It should be indented on the right. Paragraph 4: Space BeforeThis paragraph is in a style we have called "style4". It should be have a space before it. It should be have a space before it of 2 centimeters. It should be have a space before it.Paragraph 5: Space AfterThis paragraph is in a style we have called "style5". It should be have a space after it. It should be have a space after it of 2 centimeters. It should be have a space after it.Paragraph 6: First Line IndentThis paragraph is in a style we have called "style6".It should be have an indented first line. It should be have an first line indented by 2 centimeters. It should be have an indented first line.Paragraph 7: LeadingThis paragraph is in a style we have called "style7". It should be using leading. It should have a gap of 5 points between each line. It should be using leading. It should have a gap of 5 pt between each line. It should be using leading. The gap between lines should be half of the height of a line. This paragraph should look like it has a line spacing of "1.5 lines" Paragraphs 8-12: Simple Bullet PointsParastyle name="style8" parent="style1" bulletFontName = "ZapfDingbats" bulletFontSize = "5"These paragraphs are in a style we have called "style8"These five lines should have bullet points.The bullet font is ZapfDingbats.The bullet size is 5 pointsThis is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style8". These four lines should have bullet points. The bullet font is ZapfDingbats. The bullet size is 5 pointsParagraphs 13-18: Indented Bullet PointsbulletFontName = "ZapfDingbats" bulletFontSize = "10" bulletIndent = "20"These paragraphs are in a style we have called "style9"These five lines should have indented bullet points.Bullet points should look like a pointing hand.Bullet font is still ZapfDingbats, and bullet size is 10 points.The bullet indent is 20 pointsThis is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style9". These four lines should have indented bullet points. Bullet points should look like a pointing hand. Bullet font is still ZapfDingbats, and bullet size is 10 points. The bullet indent is 20 pointsParagraph 19-24: Indented Bullet Points with a Left Indent for the TextbulletFontName = "ZapfDingbats" bulletFontSize = "10" bulletIndent = "20" leftIndent = "35"These paragraphs are in a style we have called "style10"These four lines should have indented bullet points, with the text indented as well.Bullet points should look like a pointing hand.Bullet font is still ZapfDingbats, and bullet size is 10 points.The bullet indent is 20 points, and the text indent is 35 pointsThis is a long line to see how multi-line bullets look: These paragraphs are in a style we have called "style10". These four lines should have indented bullet points, with the text indented as well. Bullet points should look like a pointing hand. Bullet font is still ZapfDingbats, and bullet size is 10 points.Paragraph 25: Left Justified ParagraphsThis paragraph is in a style we have called "style11". It should be left justified. It has an argument which states 'alignment = "left"'. It should be left justified. It should be aligned to the left. Paragraph 26: Right Justified ParagraphsThis paragraph is in a style we have called "style12". It should be right justified. It has an argument which states 'alignment = "right"'. It should be right justified. It should be aligned to the right.Paragraph 27: Centered ParagraphsThis paragraph is in a style we have called "style13".It should be center justified. It has an argument which states 'alignment = "center"'. It should be centered. It should be aligned to the center.Paragraph 28: Justified ParagraphsThis paragraph is in a style we have called "style14". It should be justified. It has an argument which states 'alignment = "justify"'. It should be justified. This paragraph doesn't contain any bold text though.Paragraph 28.1: Justified Paragraphs With Bold TextThis paragraph is in a style we have called "style14". It should be justified. It has an argument which states 'alignment = "justify"'. It should be justified. This paragraph doesn't contain any bold text though.Paragraphs 29-32: Bullets using left align, right align, centered and justify.bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" alignment = "left"This is "style15", bullets with a left alignment. (The bullets in this style are based on "style10")bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" alignment = "right"This is "style16", bullets with a right alignment.(The bullets in this style are based on "style10")bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" alignment = "center"This is "style17", bullets with a center alignment.(The bullets in this style are based on "style10")bulletFontName = "ZapfDingbats" bulletFontSize = "5" bulletIndent = "20" leftIndent = "35" alignment = "justify"This is "style18", bullets with a justified paragraph.(The bullets in this style are based on "style10")These all look wierd, but most people do not actually use these styles because they look so wrong.Paragraph 33-35: Using Colours by Colour NameThis text should be REDThis text should be GREENThis text should be BLUEParagraphs with anchored bullets: green line is the global indent, blue the bullet indent1cm 0 1cm -2.5in0.3cm 0 0.3cm -2.5in1.1bullet anchor absent1.22bullet anchor absent1.3bullet anchor absent1.1bullet anchor start1.22bullet anchor start1.3bullet anchor start1.1bullet anchor middle1.22bullet anchor middle1.3bullet anchor middle1.1bullet anchor end1.22bullet anchor end1.3bullet anchor end1.1bullet anchor numeric1.22bullet anchor numeric1.3bullet anchor numericHere is another example, demonstrating bulletAnchor, note the alignment of the text when we get to double figures:
Numbers not aligned
Numbers aligned
9.0bulletAnchor absent
9.0bulletAnchor="numeric"
10.0bulletAnchor absent
10.0bulletAnchor="numeric"
You SHOULD be able to specify colours
by all the means available to reportlab.lib.colours. Currently, you
cannot use RGB or HEX values...Last Paragraph: Para Tags and Paragraph Content
This should not have any extra spaces at the start of this
line (though there should be at the start of the heading). RML should ignore
additional whitespace, and you should be able to format the actual paragraphs
as you like. This should be underlined. There should be line break after the colon: The text in this paragraph starts on a different line to the
actual "para" tag.
Quoting and escaping
This checks for all the possible quotes: & = &,
< = <, > = >, ' = ', " = ",
£ = £.
If this is not italic, and this is not bold, even normal angle brackets are broken.
Test imageAndFlowables tag with parasWe should have an image on the right side of the paragraphs here. The imageAndFlowables
tag can take an arbitrarary number of flowables and try to flow them round an image specified by attributes
imageNameimageWidthimageHeightimageMask; other attributes allow for padding and which side the image goes eg
imageTopPaddingimageBottomPaddingimageLeftPaddingimageRightPaddingimageSide. Of course we hope that a single paragraph will flow properly round the image and that the leading should not appear to change during the process.
On our assumptions, this selectionally introduced contextual feature is
unspecified with respect to irrelevant intervening contexts in
selectional rules. To characterize a linguistic level L, a
descriptively adequate grammar appears to correlate rather closely with
a descriptive fact. A consequence of the approach just outlined is that
a case of semigrammaticalness of a different sort suffices to account
for the system of base rules exclusive of the lexicon. A majority of
informed linguistic specialists agree that the speaker-hearer's
linguistic intuition raises serious doubts about the traditional
practice of grammarians. For one thing, the descriptive power of the
base component does not readily tolerate problems of phonemic and
morphological analysis.
Test imageAndFlowables tag with parasWe should have an image on the left side of the paragraphs here.
Test imageAndFlowables tag on rightWe should have an image on the right side of the paragraphs here.
Test imageAndFlowables tag with default imageYou can supply a default image to be used if the intended one is not found.
You should still see our grey logo here despite the requested 'missing.gif' not being present.
Summarizing, then, we assume that the fundamental error of regarding
functional notions as categorial may remedy and, at the same time,
eliminate the levels of acceptability from fairly high (e.g. (99a)) to
virtual gibberish (e.g. (98d)). This suggests that the theory of
syntactic features developed earlier delimits a descriptive fact. We
have already seen that any associated supporting element is not quite
equivalent to the traditional practice of grammarians. From C1, it
follows that the theory of syntactic features developed earlier can be
defined in such a way as to impose irrelevant intervening contexts in
selectional rules. So far, a descriptively adequate grammar is rather
different from a general convention regarding the forms of the grammar.
Test imageAndFlowables tag with PDF imageThe image on the left is a PDF file, not a bitmap.
Summarizing, then, we assume that the fundamental error of regarding
functional notions as categorial may remedy and, at the same time,
eliminate the levels of acceptability from fairly high (e.g. (99a)) to
virtual gibberish (e.g. (98d)). This suggests that the theory of
syntactic features developed earlier delimits a descriptive fact.
Intra-paragraph <br/>
And now for a break...
here we should be one line two.
Summarizing, then, we assume that the fundamental error of regarding
functional notions as categorial may remedy and, at the same time,
eliminate the levels of acceptability from fairly high (e.g. (99a)) to
virtual gibberish (e.g. (98d)). Now let's fake a bullet list:
- bullet 1
- bullet 2
- bullet 3
- bullet 4
- bullet 15
Para autoLeading test 0: No autoLeadingAA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 1: autoLeading="off"AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 2: autoLeading="min"AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 3: autoLeading="max"AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 4: <para autoLeading="off">AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 5: <para autoLeading="min">AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Para autoLeading test 6: <para autoLeading="max">AA. Furthermore, a subset of English sentences interesting on quite
independent grounds is not quite equivalent Why stipulation to place
the constructions into these various categories.
AA. We will bring Ugly Things in favor of
The following thesis: most of the methodological work in Modern
linguistics can be defined in such a way as to impose problems of
phonemic and morphological analysis.
Simple style textTransform testsThis should be ORDINARY text.This should be ORDINARY text.This should be LOWER text.This should be upper text.This should be cAPITALIZED text.Complex style textTransform testsThis should be ORDINARY text.This should be ORDINARY text.This should be LOWER text.This should be upper text.This should be cAPITALIZED text.endDotsThis paragraph should end in dotsThis paragraph should end in dots. Analogously, a case of semigrammaticalness of a different sort is not
subject to an abstract underlying order. There is also a different
approach to the [unification] problem, this selectionally introduced
contextual feature delimits the levels of acceptability from fairly high
forms of the grammar. DotsThis indented paragraph should end in dotsThis indented paragraph should end in dots. Analogously, a case of semigrammaticalness of a different sort is not
subject to an abstract underlying order. There is also a different
approach to the [unification] problem, this selectionally introduced
contextual feature delimits the levels of acceptability from fairly high
forms of the grammar. DotsAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAACCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDDABCDEFGHI ABCDEFGHI placeParaThe <placePara> tag allows you to place paragraphs inside story mode. It has
x,
y,
width,
origin &
anchor
attributes.10 534 10 538 8 536 12 536154 534 154 538 152 536 156 536398 534 398 538 396 536 400 53610 462 10 466 8 464 12 464154 462 154 466 152 464 156 464398 462 398 466 396 464 400 46410 390 10 394 8 392 12 392154 390 154 394 152 392 156 392398 390 398 394 396 392 400 392This is Line 1 anchor=w this is line 3.This is Line 1 anchor=c this is line 3.This is Line 1 anchor=e this is line 3.This is Line 1 anchor=sw this is line 3.This is Line 1 anchor=s this is line 3.This is Line 1 anchor=se this is line 3.This is Line 1 anchor=nw this is line 3.This is Line 1 anchor=n this is line 3.This is Line 1 anchor=ne this is line 3.placePara in graphics mode10 534 10 538 8 536 12 536154 534 154 538 152 536 156 536398 534 398 538 396 536 400 53610 462 10 466 8 464 12 464154 462 154 466 152 464 156 464398 462 398 466 396 464 400 46410 390 10 394 8 392 12 392154 390 154 394 152 392 156 392398 390 398 394 396 392 400 392This is Line 1 anchor=w this is line 3.This is Line 1 anchor=c this is line 3.This is Line 1 anchor=e this is line 3.This is Line 1 anchor=sw this is line 3.This is Line 1 anchor=s this is line 3.This is Line 1 anchor=se this is line 3.This is Line 1 anchor=nw this is line 3.This is Line 1 anchor=n this is line 3.This is Line 1 anchor=ne this is line 3.placePara in an illustration10 534 10 538 8 536 12 536154 534 154 538 152 536 156 536398 534 398 538 396 536 400 53610 462 10 466 8 464 12 464154 462 154 466 152 464 156 464398 462 398 466 396 464 400 46410 390 10 394 8 392 12 392154 390 154 394 152 392 156 392398 390 398 394 396 392 400 392This is Line 1 anchor=w this is line 3.This is Line 1 anchor=c this is line 3.This is Line 1 anchor=e this is line 3.This is Line 1 anchor=sw this is line 3.This is Line 1 anchor=s this is line 3.This is Line 1 anchor=se this is line 3.This is Line 1 anchor=nw this is line 3.This is Line 1 anchor=n this is line 3.This is Line 1 anchor=ne this is line 3.Special JustificationJustified
Furthermore, a subset of English sentences interesting on quite independent
grounds is not quite equivalent to a stipulation to place the constructions into these
various categories. We will bring evidence in favor of The following thesis:
most of the methodological work in modern linguistics can be defined in such a way
as to impose problems of phonemic and morphological analysis.
Justified with some <br/> tags
Furthermore, a subset of English sentences interesting on quite independent
grounds is not quite equivalent to a stipulation to place the constructions into these
various categories. We will bring evidence in favor of The following thesis:
most of the methodological work in modern linguistics can be defined in such a way
as to impose problems of phonemic and morphological analysis. Justified(justifyBreaks=1) with some <br/> tags
Furthermore, a subset of English sentences interesting on quite independent
grounds is not quite equivalent to a stipulation to place the constructions into these
various categories. We will bring evidence in favor of The following thesis:
most of the methodological work in modern linguistics can be defined in such a way
as to impose problems of phonemic and morphological analysis. Justified(justifyBreaks=1 justifyLastLine=3) with some <br/> tags
Furthermore, a subset of English sentences interesting on quite independent
grounds is not quite equivalent to a stipulation to place the constructions into these
various categories. We will bring evidence in favor of The following thesis:
most of the methodological work in modern linguistics can be defined in such a way
as to impose problems of phonemic and morphological analysis. Messing with <sup> heightThis is asupThis is asuprise=5This is asuprise=6This is asuprise=7This is asuprise=8This is asuprise=9This is asuprise=5 size=6This is asuprise=6 size=6This is asuprise=7 size=6This is asuprise=8 size=6This is asuprise=9 size=6This is asuprise=90% size=70%This is asuprise=-4 size=-3Messing with splitLongWords
Important Numbers
Branch Mgr Escalation
6888
Card Activation
866-100-1234
Important Numbers
Branch Mgr Escalation
6888
Card Activation
866-100-1234
Messing with <U> & <strike>This is underlined <sup>: asupThis is underlinedThis is underlined doubleThis is strikenThis is bothThis is underlined kind="double"This is double underlined with thinner linesThis is underlined in redThis is overstruck in redThis is doubly overstruck in redThis is triply overstruck in redthis is in 12 this is in 30 and the link box2 is right (twice).para^SS^ xpre^SS^ para^SS^ |xpre^SS^ |