REM2PS(1) | General Commands Manual | REM2PS(1) |
rem2ps - draw a PostScript calendar from Remind output
rem2ps [options]
Rem2ps reads the standard input, which should be the results of running Remind with the -p option. It emits PostScript code (which draws a calendar) to the standard output.
See the section "Rem2PS Input Format" for details about the -p data. This may be useful if you wish to create other Remind back-ends.
Type "rem2ps -m help" for a list of available media. Note that the media type (and all Rem2ps options) are case-sensitive. If you don't use the -m 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.
-ftshe Helvetica -fd Helvetica-BoldOblique
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.
-sthd 14 -se 8
In other words, the heading and day numbers are 14-point fonts, and the calendar entries are printed in 8-point text.
# This gives good results for putting into a binder rem2ps -ol 72 -sh 12
To use Rem2ps, you should pipe the output of Remind with the -p option to Rem2ps, and then send the result to a printer. This is most easily illustrated with examples:
remind -p12 /dev/null 1 jan 1994 | rem2ps | lpr -Plaser
That example creates a blank calendar for the entire year of 1994, and sends it the the printer named "laser."
remind -p ~/.reminders | rem2ps -l -sd 18 > cal.ps
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."
The following variables are available to PS and PSFILE-type reminders. (This material is duplicated in the Remind manual page.)
REM PS Border BoxHeight Border sub DaySize sub moveto \ /DayFont findfont DaySize scalefont setfont \ ([hebday(today())] [hebmon(today())]) show
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.
In addition, prior to drawing a calendar page, Rem2ps emits the following PostScript code:
save (mon) (yr) PreCal restore
where mon and yr are the month and year of the calendar page. The default PreCal procedure simply pops the arguments and does nothing. However, you can define a PreCal function in your prologue file to do whatever you want - it can draw a background for the entire calendar, for instance.
In the context of the PreCal procedure, the following conditions hold:
For an example, create a file called "myprolog" whose contents are:
/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
Use that file with the Rem2ps -p option to create calendars with the year and month in large grey letters in the background of the calendar.
Remind -p sends the following lines to standard output. The information is designed to be easily parsed by back-end programs:
The remaining data consists of calendar entries, in the following format:
yyyy/mm/dd special tag dur time body
Here, yyyy is the year, mm is the month (01-12) and dd is the day of the month. Note that the date components are always separated by "/" even if the date separator in Remind has been set to "-". The consistent use of "/" is designed to ease parsing.
special is a string used for "out-of-band" communication with back-ends. If the reminder is a normal reminder, special is "*". The Rem2PS back-end understands the specials PostScript and PSFile. Other back-ends may understand other specials. A back end should silently ignore a reminder with a special it doesn't understand.
tag is whatever tag the user provided with the TAG clause, or "*" if no tag was provided. If there is more than one TAG clause, the tags appear in a comma-separated list. For example, the command REM TAG foo TAG bar TAG quux would result in foo,bar,quux in the tag field.
dur is the DURATION value in minutes, or "*" if no duration was provided.
time is the time of the reminder in minutes past midnight, or "*" if the reminder was not a timed reminder.
body is the body of the reminder.
After a month's worth of reminders have been emitted, Remind emits the line:
# rem2ps end
However, back-ends should keep reading until EOF in case more data for subsequent months is forthcoming.
If you supply the -l option to remind, then reminders may be preceded by a line that looks like this:
# fileinfo lineno filename
The word fileinfo is literal; lineno and filename 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.)
Rem2PS was written by Dianne Skoll <dianne@skoll.ca>
All Rem2ps options are case-sensitive, unlike Remind. 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, Rem2ps will not complain, but the resulting PostScript output will probably not work.
You should ensure that the values you supply for margin widths are sensible. If they are too big for the media size, Rem2ps will not complain, but again, the PostScript output will probably not work.
remind
11 April 2005 | 4th Berkeley Distribution |