(This is the result of running 'labelnation --help') LabelNation, version 1.231 LabelNation is a program for making labels: address labels, business cards, or anything else involving regularly-arranged rectangles on a printer-ready sheet. Here's the basic concept: you tell LabelNation what text you want on each label (i.e., each rectangle). You can specify plain lines of text, or even arbitrary PostScript code. You also tell it what kind (i.e., brand) of labels it should print for. LabelNation takes all this information and produces a PostScript file, which you then send to your printer. Of course, you'll need a PostScript printer (or a PostScript filter, such as GNU GhostScript), and a sheet of special peel-off label paper in the tray. Such paper is widely available at office supply stores. Two companies that offer it are Avery Dennison (www.averydennison.com) and Maco (www.maco.com). This is not a recommendation or an endorsement -- Avery and Maco are simply the ones I've used. PostScript viewing software such as Ghostview also helps, so you can see what your labels look like before you print. How To Use It: ============== Let's start with return address labels. If you wanted to print a sheet of them using the Avery 5167 standard (80 small labels per page), you might invoke LabelNation like this: prompt$ labelnation -t avery5167 -i myaddress.txt -l -o myaddress.ps The "-t" stands for "type", followed by one of the standard predefined label types. The "-i" means "input file", that is, where to take the label data from. The "-l" stands for "lines input", meaning that the format of the incoming data is lines of text (as opposed to PostScript code). The "-o" specifies the output file, which you'll print to get the labels. Here is a sample label lines file: J. Random User 1423 W. Rootbeer Ave Chicago, IL 60622 USA Note that the indentation is significant -- the farther you indent a line, the more whitespace will be between it and the left edge of the label. Three spaces is a typical indentation. Also note that blank lines are significant -- they are printed like any other text. You can have as many lines as you want on a label; fonts will be automatically scaled down if there are too many lines to fit using the default font size. How To Print A Variety Of Addresses: ==================================== An input file can also define many different labels (this is useful if you're running a mailing list, for example). In that case, instead of iterating one label over an entire sheet, LabelNation will print each label once, using as many sheets as necessary and leaving the unused remainder blank. To print many labels at once, you need to communicate all the different label texts to LabelNation. There are two ways to do this: 1) Passing custom-delimited text, using "-d" to specify the delimiter. 2) Passing comma-separated value (CSV) text, using the "--csv" option. We'll cover each way below: 1) Passing custom-delimited text, using "-d" to specify the delimiter. The delimiter is a special string (sequence of characters), on a line by itself, that separates each label from the next. For example, if you use a delimiter of "XXXXX", then you might invoke LabelNation like so prompt$ labelnation -d "XXXXX" -t avery5167 -l -i addrs.txt -o addrs.ps where the file addrs.txt contains this: J. Random User 1423 W. Rootbeer Ave Chicago, IL 60622 USA XXXXX William Lyon Phelps III 27 Rue d'Agonie Paris, France XXXXX Remember that all the examples are indented three spaces in this help message, so the address lines above are actually indented only five spaces in the file, while the XXXXX delimiters are not indented at all. 2) Passing comma-separated value (CSV) text, using the "--csv" option. Use a command like this: prompt$ labelnation --leading-spaces 3 --csv -t avery5167 -i addrs.csv -o addrs.ps where the file addrs.csv contains this: "J. Random User","1423 W. Rootbeer Ave","Chicago, IL 60622","USA" "William Lyon Phelps III","27 Rue d'Agonie","Paris, France" ...etc, etc. The "--leading-spaces 3" part of the command is optional. It's just a way to left-pad the labels with some blank space, to better center the text on each label. You can adjust the number as needed, or leave off the option entirely if your labels look fine without extra padding. See http://en.wikipedia.org/wiki/Comma-separated_values for more about CSV. CSV is a fairly common text format, and most spreadsheets and databases can easily export their data to it. The flavor of CSV that LabelNation expects is fairly standard: * There is one record per line; each record is a sequence of fields. * Each field is enclosed is a pair of double-quote marks ("'s). Within the double-quotes marks, a comma is just a comma, and two consecutive double-quotes marks escapes to a single quotation mark (see the example below). * Each field is separated from the next field by a single comma (no whitespace between the comma and the next quotation mark). * There is no trailing comma at the end of the line. For example: "Ernest and Bertrand Muppet","123 Sesame Street","New York, NY 11123" "Elvis ""The King"" Presley","222 N. Danny Thomas Boulevard","Memphis, TN 37522" "Georgia O'Keefe","The Art Institute of Chicago","111 South Michigan Avenue","Chicago, IL 60603-6404" How To Discover The Predefined Label Types: =========================================== To see a list of all known label types, run prompt$ labelnation --list-types Predefined label types: Avery-5160 / Avery-6245 / Maco-LL5805 (30 labels per page) Avery-5167 / Maco-LL8100 (80 labels per page) [etc...] Note that when you're specifying a label type, you can omit the capitalization and the hyphen (or you can leave them on -- LabelNation will recognize the type either way). A bit farther on, you'll learn how to define your own label types, in case none of the built-in ones are suitable. What To Do If The Text Is A Little Bit Off From The Labels: =========================================================== Printers vary -- the label parameters that work for me might not be quite right for your hardware. Correcting the problem may merely be a matter of adjusting the bottom and/or left margin (that is, the distance from the bottom or left edge of the page to the first row or column, respectively). The two options to do this are prompt$ labelnation --bottom-margin N --left-margin N ... where N is a number of PostScript points, each being 1/72 of an inch. (Of course, you don't have to use the two options together, that's just how it is in this example.) The N you specify does not add to the predefined quantity, but rather replaces it. In order to know where you're starting from, you can ask LabelNation to show you the parameters for a given label type: prompt$ labelnation -t avery5167 --show-parameters LeftMargin 14 BottomMargin 17 LabelWidth 126 LabelHeight 36 HorizSpace 22.5 VertSpace 0 HorizNumLabels 4 VertNumLabels 20 FontName Times-Roman FontSize 7 The first two parameters are usually the only ones you need to look at, although the others may come in handy when you're defining your own parameter files. Which brings me to the next subject... How To Print Labels That Aren't One Of The Predefined Standards: ================================================================ Use the -p option to tell LabelNation to use a parameter file. A parameter file consists of lines of the form PARAMETER VALUE PARAMETER VALUE PARAMETER VALUE ... You can see valid parameter names by running prompt$ labelnation -t avery5167 --show-parameters as mentioned earlier (it doesn't have to be avery5167, it can be any built-in type). Keep in mind that a "parameter file" is for specifying the dimensions and arrangement of the labels on the sheet, *not* for specifying the content you want printed on those labels. You can use "#" as a comment character in parameter files. If that character is the first non-blank character on a line, the. rest of the line will be ignored. The output from the '--show-parameters' option is suitable as input for a parameter file, so if you're writing a parameter file for the first time, that's a good place to start. For example: $ labelnation -t avery5167 --show-parameters How To Use Arbitrary Postscript Code To Draw Labels: ==================================================== If your input file contains PostScript code to draw the label(s), instead of lines of label text, then pass the "-c" (code) option instead of "-l". The PostScript code will be run in a translated coordinate space, so 0,0 is at the bottom left corner of each label in turn. Also, clipping will be in effect, so you can't draw past the edges of a label. Normally, you will have to experiment a lot to get things just right. You can still print multiple, different labels at once -- delimiters work just as well in code files as in linetext files. One user reported that he had to do some trickery to get encapsulated PostScript to work right: From: Simon Wood Subject: RE: Graphical Labels with labelnation. To: "'kfogel {_AT_} red-bean.com'" Date: Mon, 20 May 2002 08:54:57 +0100 I managed to get some really simple graphics in last year (for a crop of plum chutney). I'll send you the files from home. The image was created in Dia and then exported to '.eps'. The trick was to remove the header from the '.ps', run labelnation to size and position the images and then manually re-insert the header into the start of 'labelnation.ps'. How To Report A Bug: ==================== Check http://www.red-bean.com/labelnation/ to make sure you have the latest version (perhaps your bug has been fixed). Else, see the instructions there for reporting bugs. Copyright: ========== LabelNation: command-line label printing Copyright (C) 2000 Karl Fogel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Predefined label types: 2 labels per page: Avery-5444 4 labels per page: Avery-5168 6 labels per page: Avery-5264 10 labels per page: Avery-5263, 5663, 5963, 8163 20 labels per page: Avery-5161, 5261, 5661, 5961 14 labels per page: Avery-5162, 5262, 5662, 5962, 8162, 8252, 8462, 15162, 18162, 18662 30 labels per page: Avery-5160, 5260, 5660, 5960, 5970, 5971, 5972 5979, 5980, 6241, 6460, 6245, 8660 Brady-Lasertab-53-361 Maco-LL5805 80 labels per page: Avery-5167, 5267, 5667, 6467, 8167 Maco-LL8100 10 business cards per page: Avery-5371, Maco-LL8550 45 labels per page: Brady-Lasertab-52-361 49 labels per page: Cable-Labels-LSL-77 (or "-LS10-77S") 84 35mm slides per page: SlidePro, SlideScribe 16 labels per page: Avery-7162 14 labels per page: Avery-7163 32 labels per page: Avery-6571 21 labels per A4 page: Avery-7160 24 labels per A4 page: Avery-7159 65 labels per A4 page: Avery-2651, 7651 8 labels per 10" page: Avery-2160, Maverick-ST340817 Remember to include the brand when specifying a label type; for example, say "avery-5979" not "5979". Options: -h, --help, --usage, -? Show this usage --version Show version number --explain Show instructions (lots of output!) --list-types Show all predefined label types -t, --type TYPE Generate labels of type TYPE -p, --parameter-file FILE Read label parameters from FILE -i, --infile Take input from FILE ("-" means stdin) -l, --line-input Input contains label text lines (default) -c, --code-input Input contains PostScript code --csv, --csv-input Input is Comma-Separated Value (CSV) format --leading-spaces N Left-pad label text by N spaces (CSV & line only) -d, --delimiter DELIM Labels separated by DELIM lines --min-label-lines N Pad each label to N lines using blanks if needed --show-bounding-box Print rectangle around each label (recommended for testing only) --first-label N Start printing at label number N (bottom left is 1, count up each column in turn, top right is last) --font-name NAME Use PostScript font FONT --font-size SIZE Scale font to SIZE --show-parameters Show a type's parameters (use with -t TYPE) -o, --outfile FILE Output to FILE ("-" means stdout)