You give them the starting date, the time and mileage points you'll hit each day, and each food/lodging expense you plan. (You also need to store the cost of travelling --- usually fuel economy, with other fixed traveling expenses optional). They'll output an itinerary that lists each timepoint and expense, as well as daily and running totals of cost and distance.
. . . . 6 PM Camp near Dustbowl, NM LODGING: Camping fee $8. TODAY: 415 mi. in 9 hours for $18; other costs $8; total $26 TO DATE: 1690 miles, $77
DAY #7 OF TRIP: Friday, 6/21 4 PM Arrive at Fred Smith's home TODAY: 404 mi. in 8 hours for $17; other costs $6; total $23 TO DATE: 2094 miles, $100
DAY #8 OF TRIP: Saturday, 6/22 . .
The source (unformatted) itinerary commands are flexible enough that it's easy to rearrange your itinerary, try alternate routes, etc... after you've set up an itinerary, the macros will calculate the total trip length and expenses.
For example, here are the lines that produced the itinerary above. Start each day with .SD, use .EN for each entry, and use .ED at the end of each day. Lodging expenses are marked with .LO, and .FO is for food:
.EN 6 PM "Camp near Dustbowl, NM" .LO "Camping fee" 8 .ED 9 .SD .EN 7 AM "NM-18, US-87 to Dalhart, TX" 129 .EN 9 AM "Time-zone change from MDT to CDT" 0 .EN 10 AM "TX-297, TX-281, US-22, US-83 to Canadian, TX" 135 .FO "Lunch in Canadian?" 6 .EN 1 PM "US-83, OK-54, I-40 to Oklahoma City" 140 .EN 4 PM "Arrive at Fred Smith's home" 0 .ED 8 .SD
The argument to ED is the number of hours spent traveling that day. The last argument to EN is the number of miles driven since the previous timepoint.
All the -mti macros are defined below. It's okay to use most nroff and troff requests with this package. However, watch out for fill- and non-fill modes, because the macros switch back and forth between the two modes. See the individual macro descriptions below. Also, be careful about setting number and string registers: the macros use a few of them (see the list below).
Font and point size changes with \f and \s are also allowed; for example, ``\fIword\fR'' will italicize word.
Regist. Initial String/ Explanation Name Value Number _CS $ str currency-unit symbol _DT - num numerical date of trip start _DU - num distance per currency unit _DY - str name of day when trip starts _FD - num number days in February _MN _ num numerical month of trip start _TI _ str title for top corner each page _UL miles str distance unit name, long _US mi str distance unit name, short Macro Number Req'd/ Explanation Name Args. Opt'nl _ED 1 reqd end of day _EN 4 reqd timepoint entry _ET 0 reqd end of title page _FO 2 optl food expense _LO 2 optl lodging expense _OE 2 optl other expenses _SD 0 reqd start of daily entry _ST 2 reqd start of title block
The FIRST SECTION of each file stores numbers and strings (words) that set the initial conditions (starting date, fuel economy, etc.). You can put these first few lines in any order, as long as they're all at the top of the file. Individual descriptions:
On your trip across the U.S., you guess that you'll get 30 miles/gallon, and that gas will cost $1.25 per gallon. So, the miles per dollar are:
30 miles/gallon ----------------------- = 24 miles/dollar 1.25 dollars/gallon
...which means that you'd put this line in your source file:
.nr DU 24
Or, if you were driving across Europe, getting 17 kilometres/litre and
spending DKK 6- per litre, the setting of DU should be 17 divided by 6,
or about 3 kilometres per DKK.
So, you'd put this line in your itinerary:
.nr DU 3
If your trip crosses two years but only one February, set FD for the number of days in the February when you'll be traveling.
This is used in the TODAY: and TO DATE: lines printed at the end of each day.
Normally, the currency symbol and the cost are printed touching each other,
like $123 or hfl162 (Dutch Guilder).
If you want space after the currency symbol (like hfl 162),
use a backslash and a trailing blank when you define the currency symbol.
For example,
.ds CR hfl\
Just be sure to put the blank after the backslash!
The TITLE SECTION is usually short. It starts with the .ST macro, and ends with .ET. If you want other text on the title page, you can put it between the macro calls.
Quote each line of the title, and put the text on the same line as
the .ST call.
If you don't want one or both lines, just leave them out.
Example:
.sT "Our trip" "to Lower Slobovia"
After the .ST, you can put text for the title page. You'll usually want to skip down a few lines (say, .sp 5) before starting the text. The title page is made in no-fill mode, so what you type in will be exactly what appears on the title page. You can start fill mode (.fi and maybe .ad), but BE SURE to go back to non-fill mode (.nf) before you use the .ET macro!
The last part of the file are the DAILY ENTRIES, which are enclosed with .SD and .ED macro calls. Here are the details:
If you use a 12-hour clock, the second argument should be AM, PM, NOON, or something like that. On a 24-hour clock, use your imagination.
You should put quotes around the third argument, which is usually the description of a route you're taking since the last timepoint. It can also hold the name of a destination.
The fourth argument must be a number --- the distance travelled during this entry. (Or, in other words, the distance travelled since the previous entry.)
Here's an example.
It's 10 AM and you're about to leave Auckland, New Zealand for a trip to
Rotorua.
The trip is via highways 3 and 12 and is 200 kilometres long (I'm making this
up!).
You'd write this .EN macro:
.EN 10 AM "Hwys. 3, 12 to Rotorua" 200
Example: in the middle of the day, you plan to spend $55 for lunch for your tour
group.
You might use this entry:
.FO "lunch at El Greaso, Dallas" 55
Example: You'll be staying at the Waldorf-Astoria tonight, spending $1000.
You might use this entry, including the phone number for convenience:
.LO "Waldorf-Astoria, 212/345-2999" 1000
Example: You expect a transmission overhaul in Nairobi:
.OE "Rebuild transmission" 550
Example: If you started traveling at 9 AM and finished at 5 PM, that's 8
hours of traveling:
.ED 8
I'm not an expert at formatter macros, so use these at your own risk. I'll take no responsibility for their accuracy or suitability for any purpose.
Bugs and rewrites to jerryp%tektools@tektronix.csnet or {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tektools!jerryp. Flames will probably be ".ig"'ed.