File: rem2ps.1

package info (click to toggle)
remind 03.01.13-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,940 kB
  • ctags: 1,954
  • sloc: ansic: 15,035; sh: 3,264; perl: 808; lisp: 343; makefile: 177
file content (413 lines) | stat: -rw-r--r-- 13,584 bytes parent folder | download | duplicates (2)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
.TH REM2PS 1 "11 April 2005"
.UC 4
.SH NAME
rem2ps \- draw a PostScript calendar from Remind output
.SH SYNOPSIS
.B rem2ps [\fIoptions\fR]
.SH DESCRIPTION
\fBRem2ps\fR reads the standard input, which should be the results of running
\fBRemind\fR with the \fB\-p\fR option.  It emits PostScript code (which
draws a calendar) to the standard output.
.PP
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
data.  This may be useful if you wish to create other \fBRemind\fR
back-ends.

.SH OPTIONS
.TP
.B \-v
Be more verbose.  This causes \fBRem2ps\fR to print progress messages
to the standard error stream.  Normally, it is silent.
.TP
.B \-p file
Include the contents of \fIfile\fR in the PostScript prologue.  This
allows you to define procedures, variables etc. which can be used
by the \fBPS\fR and \fBPSFILE\fR reminders.  You should not
include any document structuring comments in your prologue.
.TP
.B \-l
Produce the calendar in landscape mode rather than the default
portrait mode.
.TP
\fB\-c\fR[\fIn\fR]
If \fIn\fR is omitted, disables the small calendars for next and previous
months which are normally generated.  If \fIn\fR is supplied, it can range
from 0 to 3, with the following meanings:
.RS
.TP
.B 0
Disable small calendars
.TP
.B 1
Place the small calendars at the bottom-right if there is room; otherwise,
place them at the top-left.
.TP
.B 2
Place the small calendars at the top-left if there is room; otherwise,
place them at the bottom-right.
.TP
.B 3
Place the previous month's small calendar at the top-left and the next
month's at the bottom-right if there is room; otherwise, follow \fIn\fR=1.
A moment's thought reveals that an option which splits the calendars if
there is room and otherwise follows \fIn\fR=2 yields the same results as
\fIn\fR=3.
.RE
.TP
.B \-i
Use ISO 8859-1 standard encoding for the PostScript fonts.  If you do
not use this option, the default encoding is used.
.TP
.B \-e
Make the calendar fill the entire page.  By default, the calendar is
slightly smaller than the page.  This allows days with many reminders
to "expand" as needed.  However, if you don't have days which expand,
you can use this option to make all of the boxes slightly bigger.  
One caveat: If you do use the \fB\-e\fR option and one day has many
reminders, the calendar may expand off the page, losing some information.
Experiment!
.TP
.B \-m media
Set the page size.  If you use the \-m option, you must specify the
media type, which can be one of the
following.  (Sizes are approximate.)
.RS
.TP
Letter
8.5 x 11 in.
.TP
Legal
8.5 x 14 in.
.TP
Ledger
11 x 17 in.
.TP
Statement
5.5 x 8.5 in.
.TP
Executive
7.5 x 10 in.
.TP
A3
29.7 x 42 cm.
.TP
A4
21 x 29.7 cm.
.TP
A5
14.8 x 21 cm.
.TP
B4
25.7 x 36.4 cm.
.TP
B5
18.3 x 25.7 cm.
.TP
Folio
8.5 x 13 in.
.TP
Quarto
8.5 x 10.8 in.
.TP
10x14
10 x 14 in.
.TP
\fIX\fRx\fIY\fRin
\fIX\fR by \fIY\fR inches, where \fIX\fR and \fIY\fR can be floating-point
numbers.
.TP
\fIX\fRx\fIY\fRcm
\fIX\fR by \fIY\fR centimetres, where \fIX\fR and \fIY\fR can be floating-point
numbers.

.PP
Type "rem2ps \-m help" for a list of available media.  Note that the media
type (and all \fBRem2ps\fR options) are case-sensitive.  If you don't use
the \fB\-m\fR option, the media defaults to a compiled-in default - this
is usually Letter for North America and A4 for Europe.  The "\-m help"
option will display the compiled-in default.
.RE
.TP
\fB\-f\fR[\fBtshed\fR] \fIfont\fR
Set the font for the calendar title,
the small calendars, the day-of-week headings, the calendar
entries, and the day numbers, respectively.  \fIFont\fR must be the
name of a valid PostScript font.  The default fonts are equivalent to
specifying:
.RS
.PP
.nf
	\-ftshe Helvetica \-fd Helvetica-BoldOblique
.fi
.PP
In other words, the heading, entry and small-calendar fonts are set
to Helvetica, and the font for the day numbers is set to
Helvetica-BoldOblique.
.RE
.TP
\fB\-s\fR[\fBthed\fR] \fIsize\fR
Set the size (in points) of the text for the the calendar title,
day-of-week headings, the calendar entries, and the day numbers,
respectively.  \fISize\fR must be a decimal number.  The default sizes
are equivalent to specifying:
.RS
.PP
.nf
	\-sthd 14 \-se 8
.fi
.PP
In other words, the heading and day numbers are 14-point fonts, and the
calendar entries are printed in 8-point text.
.RE
.TP
\fB\-b\fR \fIsize\fR
Set the size of the blank white border in each calendar box to \fIsize\fR
points.  The default border size is 6 points, or 1/12 in.
.TP
\fB\-t\fR \fIsize\fR
Set the thickness of the black calendar grid lines.  The default is 1,
for a line thickness of one point (1/72 in.)
.TP
\fB\-o\fR[\fBlrtb\fR] \fIsize\fR
Set the left, right, top, and/or bottom margins to \fIsize\fR points.
For this option only, \fIsize\fR must be an integer.  It represents the
margin size in units of 1/72 in.  The default margin sizes are 36, for
half-inch margins.  If you wish to punch holes in the calendar page to insert
it into a binder, you may wish to increase the left margin to one inch.
In that case, you should also decrease the heading font size to 12 points
for good output:
.PP
.nf
	# This gives good results for putting into a binder
	rem2ps \-ol 72 \-sh 12
.fi
.SH USAGE
To use \fBRem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
option to \fBRem2ps\fR, and then send the result to a printer.  This is most easily
illustrated with examples:
.PP
.nf
	remind \-p12 /dev/null 1 jan 1994 | rem2ps | lpr \-Plaser
.fi
.PP
That example creates a blank calendar for the entire year of 1994, and
sends it the the printer named "laser."
.PP
.nf
	remind \-p ~/.reminders | rem2ps \-l \-sd 18 > cal.ps
.fi
.PP
This reminder creates a calendar for the current month, filling in
entries from the reminder file "~/.reminders."  The calendar is produced
in landscape mode, with a font size of 18 for the day numbers.  The result
is put in the PostScript file "cal.ps."
.PP
.SH VARIABLES AVAILABLE TO USER-SUPPLIED POSTSCRIPT CODE
.PP
The following variables are available to \fBPS\fR and 
\fBPSFILE\fR-type reminders.  (This material is duplicated
in the \fBRemind\fR manual page.)
.TP
LineWidth
The width of the black grid lines making up the calendar.
.TP
Border
The border between the center of the grid lines and the space used to print
calendar entries.  This border is normally blank space.
.TP
BoxWidth and BoxHeight
The width and height of the calendar box, from center-to-center of the
black gridlines.
.TP
InBoxHeight
The height from the center of the bottom black gridline to the top
of the regular calendar entry area.  The space from here to the top
of the box is used only to draw the day number.
.TP
/DayFont, /TitleFont, /EntryFont, /SmallFont and /HeadFont
The fonts used to draw the day numbers, the month and year title,
the calendar entries, the small
calendars, and the day-of-week headings, respectively.
.TP
DaySize, TitleSize, EntrySize and HeadSize
The sizes of the above fonts.  (The size of the small calendar font
is \fInot\fR defined here.)  For example, if you wanted to print
the Hebrew date next to the regular day number in the calendar, use:
.PP
.nf
	REM PS Border BoxHeight Border sub DaySize sub moveto \\
	   /DayFont findfont DaySize scalefont setfont \\
	   ([hebday(today())] [hebmon(today())]) show
.fi
.PP
.RS
Note how /DayFont and DaySize are used.
.RE
.PP
Note that if you supply PostScript code, it is possible to produce invalid
PostScript files.  Always test your PostScript thoroughly with a PostScript
viewer before sending it to the printer.  You should not use any document
structuring comments in your PostScript code.
.PP
In addition, prior to drawing a calendar page, \fBRem2ps\fR emits
the following PostScript code:
.PP
.nf
	save (mon) (yr) PreCal restore
.fi
.PP
where \fImon\fR and \fIyr\fR are the month and year of the calendar
page.  The default \fBPreCal\fR procedure simply pops
the arguments and does nothing.  However, you can define a \fBPreCal\fR
function in your prologue file to do whatever you want - it can draw a
background for the entire calendar, for instance.
.PP
In the context of the \fBPreCal\fR procedure, the following conditions
hold:
.TP
o
The PostScript origin is at the bottom left-hand corner of the page, and
PostScript units of 1/72" are in effect.
.TP
o
The variables MinX, MinY, MaxX and MaxY define the bounding box within
which the calendar will be drawn.
.TP
o
The font and font-size variables, as well as Border and LineWidth described
previously, are valid.
.PP
For an example, create a file called "myprolog" whose contents are:
.PP
.nf
		/PreCal {
		 /yr exch def
		 /mon exch def
		 /xsiz1 MaxX MinX sub def
		 /ysiz1 MaxY MinY sub def
		 /xsiz xsiz1 MinX sub MinX sub def
		 /ysiz ysiz1 MinY sub MinY sub def
		 xsiz
		 ysiz
		 lt
		 {/len xsiz 1.41 mul def
		  MinX MinX add ysiz1 xsiz1 sub 2 div MinY add MinY add moveto}
		 {/len ysiz 1.41 mul def
		  xsiz1 ysiz1 sub 2 div MinX add MinX add MinY MinY add moveto}
		 ifelse
		 /Helvetica-Bold findfont 1 scalefont setfont
		 mon stringwidth pop
		 ( ) stringwidth pop add
		 yr stringwidth pop add
		 len exch div /len exch def
		 /Helvetica-Bold findfont len scalefont setfont
		 0.95 setgray
		 45 rotate
		 mon show
		 ( ) show
		 yr show
		} bind def
.fi
.PP
Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
with the year and month in large grey letters in the background of the
calendar.
.PP
.SH REM2PS INPUT FORMAT
\fBRemind \-p\fR sends the following lines to standard output.
The information is designed to be easily parsed by back-end programs:
.TP
.B # rem2ps begin
This line signifies the start of calendar data.  Back-ends can search
for it to verify they are being fed correct information.
.TP
\fImonth_name year num_days first_day monday_first\fR
On this line, \fImonth_name\fR is the name of the month whose calendar
information is about to follow.  \fInum_days\fR is the number of days
in this month.  \fIfirst_day\fR is the weekday of the first day of the
month (0 = Sunday, 1 = Monday, 6 = Saturday.)  And \fImonday_first\fR is
1 if the \fB\-m\fR flag was supplied to \fBRemind\fR, or 0 if it was not.
All this information is supplied so back-ends don't need any date calculation
facilities.
.TP
\fIsun mon tue wed thu fri sat\fR
This line consists of
space-separated names of days in whatever language \fBRemind\fR was
compiled for.  This information can be used by back-ends to annotate
calendars, and means they don't have to be created for a specific
language.
.TP
\fInext_mon next_days\fR
The name of the next month and the number of days in it.
.TP
\fIprev_mon prev_days\fR
The name of the previous month and the number of days in it.  The
\fInext_mon\fR and \fIprev_mon\fR lines could be used to generate small
inset calendars for the next and previous months.
.PP
The remaining data consists of calendar entries, in the following format:
.PP
\fIyyyy/mm/dd special tag dur time body\fR
.PP
Here, \fIyyyy\fR is the year, \fImm\fR is the month (01-12) and
\fIdd\fR is the day of the month.  Note that the date components are
always separated by "/" even if the date separator in \fBRemind\fR has
been set to "-".  The consistent use of "/" is designed to ease parsing.
.PP
\fIspecial\fR is a string used
for "out-of-band" communication with back-ends.  If the reminder
is a normal reminder, \fIspecial\fR is "*".  The \fBRem2PS\fR
back-end understands the specials \fBPostScript\fR and \fBPSFile\fR.
Other back-ends may understand other specials.  A back end should
\fIsilently ignore\fR a reminder with a special it doesn't understand.
.PP
\fItag\fR is whatever tag the user provided with the \fBTAG\fR clause,
or "*" if no tag was provided.  If there is more than one \fBTAG\fR clause,
the tags appear in a comma-separated list.  For example, the command
\fBREM TAG foo TAG bar TAG quux\fR would result in \fBfoo,bar,quux\fR
in the \fItag\fR field.
.PP
\fIdur\fR is the \fBDURATION\fR value in minutes, or "*" if no duration
was provided.
.PP
\fItime\fR is the time of the reminder in minutes past midnight, or
"*" if the reminder was not a timed reminder.
.PP
\fIbody\fR is the body of the reminder.
.PP
After a month's worth of reminders have been emitted, \fBRemind\fR
emits the line:
.PP
\fB# rem2ps end
.PP
However, back-ends should keep reading until EOF in case more data for
subsequent months is forthcoming.
.PP
If you supply the \fB\-l\fR option to \fBremind\fR, then reminders
may be preceded by a line that looks like this:
.PP
\fB# fileinfo \fIlineno filename\fR
.PP
The word \fBfileinfo\fR is literal; \fIlineno\fR and \fIfilename\fR specify
the line number and file name of the file containing the reminder.  Back-ends
that don't care about this information should ignore lines starting with
"#" (except, of course, for the # rem2ps lines.)
.PP
.SH AUTHOR
Rem2PS is now supported by Roaring Penguin Software
Inc. (http://www.roaringpenguin.com)
.PP
Rem2PS was written by David F. Skoll <dfs@roaringpenguin.com>.
.SH BUGS
All \fBRem2ps\fR options are case-sensitive, unlike \fBRemind\fR.
Any time you supply
a font name or size, line thickness, or border width, it is treated as a
string and sent straight to the PostScript interpreter.  Thus, if you
supply invalid fonts or sizes, \fBRem2ps\fR will not complain, but the
resulting PostScript output will probably not work.
.PP
You should ensure that the values you supply for margin widths are sensible.
If they are too big for the media size, \fBRem2ps\fR will not complain,
but again, the PostScript output will probably not work.
.SH SEE ALSO
\fBremind\fR