/
poems.tex
129 lines (97 loc) · 2.82 KB
/
poems.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
\usemodule[abr-03]
\usemodule[tugboat]
% I prefer emphasized text to be italic rather than slanted
\setupbodyfontenvironment[default][em=italic]
% ConTeXt uses some weird rules for breaking urls. A small attempt to sanitize
% that
\sethyphenatedurlafter /
\sethyphenatedurlafter .
\setvariables
[tugboat]
[type=article,
columns=yes,
grid=no]
%\setvariables
% [tugboat]
% [year=\tubyear,
% volume=\tubvol,
% number=\tubnum,
% page=\tubpage]
\setvariables
[tugboat]
[ title={\CONTEXT\ basics for users: Typesetting poems},
author={Aditya Mahajan},
address={},
email={adityam (at) ieee (dot) org},
]
\starttext
\StartArticle
\subject{Basic setup}
\CONTEXT{} does not have a dedicated environment for typesetting
poems. But, it is easy to piggyback on the \type{lines} environment
to typeset poems. I'll use the first four stanzas from Inferno,
which is the first part Dante's poem Divine Comedy.
\startbuffer[inferno]
Midway upon the journey of our life
I found myself within a forest dark,
For the straightforward pathway had been lost.
Ah me! how hard a thing it is to say
What was this forest savage, rough, and stern,
Which in the very thought renews the fear.
So bitter is it, death is little more;
But of the good to treat, which there I found,
Speak will I of the other things I saw there.
I cannot well repeat how there I entered,
So full was I of slumber at the moment
In which I had abandoned the true way.
\stopbuffer
The simplest way to typeset a poem is using the \type{lines}
environment.
\starttyping
\startlines
....
\stoplines
\stoptyping
\noindentation which gives
\startlines
Midway upon the journey of our life
I found myself within a forest dark,
For the straightforward pathway had been lost.
Ah me! how hard a thing it is to say
What was this forest savage, rough, and stern,
Which in the very thought renews the fear.
\stoplines
\subsubject{Indenting lines}
\setuplines[indenting=even]
\startlines
All that is gold does not glitter,
Not all those who wander are lost;
The old that is strong does not wither,
Deep roots are not reached by the ]frost.
From the ashes a fire shall be woken,
A light from the shadows shall spring;
Renewed shall be blade that was broken,
The crownless again shall be king.
\stoplines
\subsubject{Indenting stanzas}
\setuplines
[option=packed,
inbetween={\blank[preference,line]\setupindenting[toggle]},
indenting=no]
\startlines
\getbuffer[inferno]
\stoplines
\section{Indenting all but the first line}
% \setuplines
% [option=packed,
% inbetween={\blank[preference,line]\setupindenting[next]},
% indenting=next]
\subsubject{Keeping Stanzas together}
\setuplines[option=packed]
\subsubject{Centering poems}
\setuplines[align=middle, inbetween=\blank, indenting=no]
\startlines
\getbuffer[inferno]
\stoplines
\StopArticle
\stoptext