1REM2PS(1) General Commands Manual REM2PS(1)
2
3
4
6 rem2ps - draw a PostScript calendar from Remind output
7
9 rem2ps [options]
10
12 Rem2ps reads the standard input, which should be the results of running
13 Remind with the -p option. It emits PostScript code (which draws a
14 calendar) to the standard output.
15
16 See the section "Rem2PS Input Format" for details about the -p data.
17 This may be useful if you wish to create other Remind back-ends.
18
19
21 -v Be more verbose. This causes Rem2ps to print progress messages
22 to the standard error stream. Normally, it is silent.
23
24 -p file
25 Include the contents of file in the PostScript prologue. This
26 allows you to define procedures, variables etc. which can be
27 used by the PS and PSFILE reminders. You should not include any
28 document structuring comments in your prologue.
29
30 -l Produce the calendar in landscape mode rather than the default
31 portrait mode.
32
33 -c[n] If n is omitted, disables the small calendars for next and pre‐
34 vious months which are normally generated. If n is supplied, it
35 can range from 0 to 3, with the following meanings:
36
37 0 Disable small calendars
38
39 1 Place the small calendars at the bottom-right if there is
40 room; otherwise, place them at the top-left.
41
42 2 Place the small calendars at the top-left if there is
43 room; otherwise, place them at the bottom-right.
44
45 3 Place the previous month's small calendar at the top-left
46 and the next month's at the bottom-right if there is
47 room; otherwise, follow n=1. A moment's thought reveals
48 that an option which splits the calendars if there is
49 room and otherwise follows n=2 yields the same results as
50 n=3.
51
52 -i Use ISO 8859-1 standard encoding for the PostScript fonts. If
53 you do not use this option, the default encoding is used.
54
55 -e Make the calendar fill the entire page. By default, the calen‐
56 dar is slightly smaller than the page. This allows days with
57 many reminders to "expand" as needed. However, if you don't
58 have days which expand, you can use this option to make all of
59 the boxes slightly bigger. One caveat: If you do use the -e
60 option and one day has many reminders, the calendar may expand
61 off the page, losing some information. Experiment!
62
63 -m media
64 Set the page size. If you use the -m option, you must specify
65 the media type, which can be one of the following. (Sizes are
66 approximate.)
67
68 Letter 8.5 x 11 in.
69
70 Legal 8.5 x 14 in.
71
72 Ledger 11 x 17 in.
73
74 Statement
75 5.5 x 8.5 in.
76
77 Executive
78 7.5 x 10 in.
79
80 A3 29.7 x 42 cm.
81
82 A4 21 x 29.7 cm.
83
84 A5 14.8 x 21 cm.
85
86 B4 25.7 x 36.4 cm.
87
88 B5 18.3 x 25.7 cm.
89
90 Folio 8.5 x 13 in.
91
92 Quarto 8.5 x 10.8 in.
93
94 10x14 10 x 14 in.
95
96 XxYin X by Y inches, where X and Y can be floating-point num‐
97 bers.
98
99 XxYcm X by Y centimetres, where X and Y can be floating-point
100 numbers.
101
102
103 Type "rem2ps -m help" for a list of available media. Note that
104 the media type (and all Rem2ps options) are case-sensitive. If
105 you don't use the -m option, the media defaults to a compiled-in
106 default - this is usually Letter for North America and A4 for
107 Europe. The "-m help" option will display the compiled-in
108 default.
109
110 -f[tshed] font
111 Set the font for the calendar title, the small calendars, the
112 day-of-week headings, the calendar entries, and the day numbers,
113 respectively. Font must be the name of a valid PostScript font.
114 The default fonts are equivalent to specifying:
115
116 -ftshe Helvetica -fd Helvetica-BoldOblique
117
118 In other words, the heading, entry and small-calendar fonts are
119 set to Helvetica, and the font for the day numbers is set to
120 Helvetica-BoldOblique.
121
122 -s[thed] size
123 Set the size (in points) of the text for the the calendar title,
124 day-of-week headings, the calendar entries, and the day numbers,
125 respectively. Size must be a decimal number. The default sizes
126 are equivalent to specifying:
127
128 -sthd 14 -se 8
129
130 In other words, the heading and day numbers are 14-point fonts,
131 and the calendar entries are printed in 8-point text.
132
133 -b size
134 Set the size of the blank white border in each calendar box to
135 size points. The default border size is 6 points, or 1/12 in.
136
137 -t size
138 Set the thickness of the black calendar grid lines. The default
139 is 1, for a line thickness of one point (1/72 in.)
140
141 -o[lrtb] size
142 Set the left, right, top, and/or bottom margins to size points.
143 For this option only, size must be an integer. It represents
144 the margin size in units of 1/72 in. The default margin sizes
145 are 36, for half-inch margins. If you wish to punch holes in
146 the calendar page to insert it into a binder, you may wish to
147 increase the left margin to one inch. In that case, you should
148 also decrease the heading font size to 12 points for good out‐
149 put:
150
151 # This gives good results for putting into a binder
152 rem2ps -ol 72 -sh 12
153
155 To use Rem2ps, you should pipe the output of Remind with the -p option
156 to Rem2ps, and then send the result to a printer. This is most easily
157 illustrated with examples:
158
159 remind -p12 /dev/null 1 jan 1994 | rem2ps | lpr -Plaser
160
161 That example creates a blank calendar for the entire year of 1994, and
162 sends it the the printer named "laser."
163
164 remind -p ~/.reminders | rem2ps -l -sd 18 > cal.ps
165
166 This reminder creates a calendar for the current month, filling in
167 entries from the reminder file "~/.reminders." The calendar is pro‐
168 duced in landscape mode, with a font size of 18 for the day numbers.
169 The result is put in the PostScript file "cal.ps."
170
172 The following variables are available to PS and PSFILE-type reminders.
173 (This material is duplicated in the Remind manual page.)
174
175 LineWidth
176 The width of the black grid lines making up the calendar.
177
178 Border The border between the center of the grid lines and the space
179 used to print calendar entries. This border is normally blank
180 space.
181
182 BoxWidth and BoxHeight
183 The width and height of the calendar box, from center-to-center
184 of the black gridlines.
185
186 InBoxHeight
187 The height from the center of the bottom black gridline to the
188 top of the regular calendar entry area. The space from here to
189 the top of the box is used only to draw the day number.
190
191 /DayFont, /TitleFont, /EntryFont, /SmallFont and /HeadFont
192 The fonts used to draw the day numbers, the month and year
193 title, the calendar entries, the small calendars, and the day-
194 of-week headings, respectively.
195
196 DaySize, TitleSize, EntrySize and HeadSize
197 The sizes of the above fonts. (The size of the small calendar
198 font is not defined here.) For example, if you wanted to print
199 the Hebrew date next to the regular day number in the calendar,
200 use:
201
202 REM PS Border BoxHeight Border sub DaySize sub moveto \
203 /DayFont findfont DaySize scalefont setfont \
204 ([hebday(today())] [hebmon(today())]) show
205
206 Note how /DayFont and DaySize are used.
207
208 Note that if you supply PostScript code, it is possible to produce
209 invalid PostScript files. Always test your PostScript thoroughly with
210 a PostScript viewer before sending it to the printer. You should not
211 use any document structuring comments in your PostScript code.
212
213 In addition, prior to drawing a calendar page, Rem2ps emits the follow‐
214 ing PostScript code:
215
216 save (mon) (yr) PreCal restore
217
218 where mon and yr are the month and year of the calendar page. The
219 default PreCal procedure simply pops the arguments and does nothing.
220 However, you can define a PreCal function in your prologue file to do
221 whatever you want - it can draw a background for the entire calendar,
222 for instance.
223
224 In the context of the PreCal procedure, the following conditions hold:
225
226 o The PostScript origin is at the bottom left-hand corner of the
227 page, and PostScript units of 1/72" are in effect.
228
229 o The variables MinX, MinY, MaxX and MaxY define the bounding box
230 within which the calendar will be drawn.
231
232 o The font and font-size variables, as well as Border and
233 LineWidth described previously, are valid.
234
235 For an example, create a file called "myprolog" whose contents are:
236
237 /PreCal {
238 /yr exch def
239 /mon exch def
240 /xsiz1 MaxX MinX sub def
241 /ysiz1 MaxY MinY sub def
242 /xsiz xsiz1 MinX sub MinX sub def
243 /ysiz ysiz1 MinY sub MinY sub def
244 xsiz
245 ysiz
246 lt
247 {/len xsiz 1.41 mul def
248 MinX MinX add ysiz1 xsiz1 sub 2 div MinY add MinY add moveto}
249 {/len ysiz 1.41 mul def
250 xsiz1 ysiz1 sub 2 div MinX add MinX add MinY MinY add moveto}
251 ifelse
252 /Helvetica-Bold findfont 1 scalefont setfont
253 mon stringwidth pop
254 ( ) stringwidth pop add
255 yr stringwidth pop add
256 len exch div /len exch def
257 /Helvetica-Bold findfont len scalefont setfont
258 0.95 setgray
259 45 rotate
260 mon show
261 ( ) show
262 yr show
263 } bind def
264
265 Use that file with the Rem2ps -p option to create calendars with the
266 year and month in large grey letters in the background of the calendar.
267
269 Remind -p sends the following lines to standard output. The informa‐
270 tion is designed to be easily parsed by back-end programs:
271
272 # rem2ps begin
273 This line signifies the start of calendar data. Back-ends can
274 search for it to verify they are being fed correct information.
275
276 month_name year num_days first_day monday_first
277 On this line, month_name is the name of the month whose calendar
278 information is about to follow. num_days is the number of days
279 in this month. first_day is the weekday of the first day of the
280 month (0 = Sunday, 1 = Monday, 6 = Saturday.) And monday_first
281 is 1 if the -m flag was supplied to Remind, or 0 if it was not.
282 All this information is supplied so back-ends don't need any
283 date calculation facilities.
284
285 sun mon tue wed thu fri sat
286 This line consists of space-separated names of days in whatever
287 language Remind was compiled for. This information can be used
288 by back-ends to annotate calendars, and means they don't have to
289 be created for a specific language.
290
291 next_mon next_days
292 The name of the next month and the number of days in it.
293
294 prev_mon prev_days
295 The name of the previous month and the number of days in it.
296 The next_mon and prev_mon lines could be used to generate small
297 inset calendars for the next and previous months.
298
299 The remaining data consists of calendar entries, in the following for‐
300 mat:
301
302 yyyy/mm/dd special tag dur time body
303
304 Here, yyyy is the year, mm is the month (01-12) and dd is the day of
305 the month. Note that the date components are always separated by "/"
306 even if the date separator in Remind has been set to "-". The consis‐
307 tent use of "/" is designed to ease parsing.
308
309 special is a string used for "out-of-band" communication with back-
310 ends. If the reminder is a normal reminder, special is "*". The
311 Rem2PS back-end understands the specials PostScript and PSFile. Other
312 back-ends may understand other specials. A back end should silently
313 ignore a reminder with a special it doesn't understand.
314
315 tag is whatever tag the user provided with the TAG clause, or "*" if no
316 tag was provided.
317
318 dur is the DURATION value in minutes, or "*" if no duration was pro‐
319 vided.
320
321 time is the time of the reminder in minutes past midnight, or "*" if
322 the reminder was not a timed reminder.
323
324 body is the body of the reminder.
325
326 After a month's worth of reminders have been emitted, Remind emits the
327 line:
328
329 # rem2ps end
330
331 However, back-ends should keep reading until EOF in case more data for
332 subsequent months is forthcoming.
333
334 If you supply the -l option to remind, then reminders may be preceded
335 by a line that looks like this:
336
337 # fileinfo lineno filename
338
339 The word fileinfo is literal; lineno and filename specify the line num‐
340 ber and file name of the file containing the reminder. Back-ends that
341 don't care about this information should ignore lines starting with "#"
342 (except, of course, for the # rem2ps lines.)
343
345 Rem2PS is now supported by Roaring Penguin Software Inc.
346 (http://www.roaringpenguin.com)
347
348 Rem2PS was written by David F. Skoll <dfs@roaringpenguin.com>.
349
351 All Rem2ps options are case-sensitive, unlike Remind. Any time you
352 supply a font name or size, line thickness, or border width, it is
353 treated as a string and sent straight to the PostScript interpreter.
354 Thus, if you supply invalid fonts or sizes, Rem2ps will not complain,
355 but the resulting PostScript output will probably not work.
356
357 You should ensure that the values you supply for margin widths are sen‐
358 sible. If they are too big for the media size, Rem2ps will not com‐
359 plain, but again, the PostScript output will probably not work.
360
362 remind
363
364
365
366 11 April 2005 REM2PS(1)