8 t
= c
.insert(tex
.tex())
9 t
.text(0, 0, "Hello, world!")
10 t
.text(0, -0.5, "Hello, world!", tex
.fontsize
.large
)
12 r
"\sum_{n=1}^{\infty} {1\over{n^2}} = {{\pi^2}\over 6}",
15 c
.stroke(path
.line(5, -0.5, 9, -0.5))
16 c
.stroke(path
.line(5, -1, 9, -1))
17 c
.stroke(path
.line(5, -1.5, 9, -1.5))
18 c
.stroke(path
.line(7, -1.5, 7, 0))
19 t
.text(7, -0.5, "left aligned") # default is tex.halign.left
20 t
.text(7, -1, "center aligned", tex
.halign
.center
)
21 t
.text(7, -1.5, "right aligned", tex
.halign
.right
)
23 c
.stroke(path
.line(0, -4, 2, -4))
24 c
.stroke(path
.line(0, -2.5, 0, -5.5))
25 c
.stroke(path
.line(2, -2.5, 2, -5.5))
27 "a b c d e f g h i j k l m n o p q r s t u v w x y z",
29 c
.stroke(path
.line(2.5, -4, 4.5, -4))
30 c
.stroke(path
.line(2.5, -2.5, 2.5, -5.5))
31 c
.stroke(path
.line(4.5, -2.5, 4.5, -5.5))
33 "a b c d e f g h i j k l m n o p q r s t u v w x y z",
36 c
.stroke(path
.line(5, -4, 9, -4))
37 c
.stroke(path
.line(7, -5.5, 7, -2.5))
38 t
.text(7, -4, "horizontal")
39 t
.text(7, -4, "vertical", tex
.direction
.vertical
)
40 t
.text(7, -4, "rvertical", tex
.direction
.rvertical
)
41 t
.text(7, -4, "upsidedown", tex
.direction
.upsidedown
)
42 t
.text(7.5, -3.5, "45", tex
.direction(45))
43 t
.text(6.5, -3.5, "135", tex
.direction(135))
44 t
.text(6.5, -4.5, "225", tex
.direction(225))
45 t
.text(7.5, -4.5, "315", tex
.direction(315))
47 t
.text(0, -6, "red", color
.rgb
.red
)
48 t
.text(3, -6, "green", color
.rgb
.green
)
49 t
.text(6, -6, "blue", color
.rgb
.blue
)
50 c
.writetofile("tex2.eps")