Search:

Summary | Source files | Compilation | Precompiled | References

DvLabel

The DvLabel computer program generates TeX source code for typesetting of labels for digital video tapes (DV format, typically used for hand-held video camera recorders). The program is primarily designed to run in interactive mode, but via command-line parameters it also supports batch-mode operation. For an extensive description of the algorithms used in the program, supported command-line options and syntax, as well as the full documentation of the source, see dvlabel.pdf. [196 kB, 34 pages].

Summary of the program

The DvLabel computer program generates TeX [3] source code for typesetting of labels for digital video tapes (DV format, typically used for hand-held video camera recorders). The program is primarily designed to run in interactive mode, but via command-line parameters it also supports batch-mode operation. A feature of the program is also that it is able to compile the generated TeX source code into PostScript, using the DVIPS [5] program.

example

Figure 1. Sample label generated by the DvLabel program. Typically, these labels are generated in batches of 4 labels per page, with proper crop marks and everything. See the documentation dvlabel.pdf for further examples of usage.

Most people have not heard of the TeX system for typesetting mathematical text, and if they have, they will most probably not use the system for creating things like labels for video tapes. However, the output generated by TeX is in many cases absolutely superior in balance and visual clarity, and in order to benefit from the compactness and beauty of text processed by TeX even for such basic things as labels for video tapes, this program generates the necessary TeX code and even compiles it into printable PostScript.

I got the idea of creating this program from the audio-tape.ps PostScript code by Jamie Zawinski. The audio-tape.ps code is a splendid example of how one can write a simple PostScript program with the help of a regular ASCII editor, and by sending the PostScript program to the printer one gets a neat printout to be used for tape cassette labels, DAT, or video tapes. However, whenever one has a new cassette to be labeled, one has to edit the PostScript source, and for a rookie on PostScript programming this task is for sure somewhat inconvenient. (Believe me.) Therefore, I decided to create something similar, but instead as a standalone program that could be operated either in interactive mode, with the program asking for the specific information to be entered in the label, or in batch mode in which the data instead could be read from a file. However, instead of directly generating PostScript, I decided to go for a language that I know somewhat more in detail, namely plain TeX [3], which also has the benefit of being a language which the author, Donald E. Knuth, has decided to keep fixed in order to ensure future compatibility.

Note added 15 July 2006: Just the other day, I happened to stumble over a web interface to the audio-tape.ps jewel-case labeller, at http://www.aquezada.com/staff/julian/play/audio-tape/. Obviously someone else also got hooked on the idea of not having to edit PostScript code!

The DvLabel program is written in CWEB [1], generating ANSI-C (ISO 9899/C90) conforming source code and documentation as plain TeX [3], source, and is to be compiled using the sequences as outlined in the enclosed Makefile. The Makefile essentially executes two major calls. First, the CTANGLE program parses the CWEB source document 'dvlabel.w' to extract a ANSI-C source file 'dvlabel.c', which may be compiled in the usual way using any ANSI-C conformant compiler. The output source file includes #line specifications so that any debugging can be done conveniently in terms of the original CWEB source file. Second, the CWEAVE program parses the same CWEB source file to extract a plain TeX source file 'dvlabel.tex' which may be compiled in the usual way. It takes appropriate care of typographic details like page layout and the use of indentation, italics, boldface, and so on, and it supplies extensive automatically gathered cross-index information.

After having executed make in the same catalogue where the files dvlabel.w and Makefile are located, one is left with an executable file dvlabel, being the ready-to-use compiled program, and a PostScript file dvlabel.ps which contains the full documentation of the program. Notice that on platforms running Windows NT, Windows 2000, Windows ME, or any other operating system by Microsoft, the executable file will instead automatically be called dvlabel.exe. This convention also applies to programs compiled under the UNIX-like environment CYGWIN.

Current revision

Revision 1.6, as of 10/08/2005. Copyright © Fredrik Jonsson 2003-2006, under GPL

Source files

dvlabel.pdf [196 kB] Documentation of the DvLabel program in Portable Document Format (PDF) [2], generated from the PostScript [4] documentation.

dvlabel.w [54 kB] The CWEB [1] master source code for the DvLabel program. From this master, the ANSI-C (ISO C90) source code for the program and TeX code for the documentation is extracted using the CTANGLE and CWEAVE compilers, respectively.
[ download | view source ]

dvlabel.tar.gz [17 kB] Gzip:ed tape archive of the entire DvLabel program directory, including the CWEB [1] master source code source, Makefile:s and all examples needed to rebuild the program and documentation from scratch. Requires CTANGLE and CWEAVE.
[ download ]

Makefile [106 bytes] The Makefile for compilation of the executable file, as well as generation of the documentation of the program. Extracts the C and TeX code from the CWEB source, and compiles the C and TeX code into binary executable and PostScript, respectively. To compile the executable and documentation, simply run 'make' in the directory containing the source files and this Makefile.
[ download | view source ]

dvlabel.c [25 kB] ANSI-C (ISO C90) conforming source code, extracted from the CWEB master source code using the CTANGLE program by Donald E. Knuth.
[ download | view source ]

dvlabel.tex [71 kB] Plain TeX [3] source code, extracted from the CWEB master source code using the CWEAVE program by Donald E. Knuth.
[ download | view source ]

dvlabel.ps [670 kB] PostScript [4] documentation of the DvLabel program, generated from the TeX-code, which in turn is generated from the CWEB master source code.

Compilation

Compile the CWEB [1] code 'dvlabel.w' using the enclosed Makefile, or use the blocks of the Makefile as listed in section 3 of the documentation.

Precompiled executables

dvlabel [38 kB] Executable program compiled for Mac OS X 10.7 (Lion) using the GNU C Compiler (GCC). [Compiled Saturday 24 Dec, 2011]

References

[1] For information on the CWEB programming language as written by Donald E. Knuth, as well as samples of CWEB programs, see Knuth's homepage at http://www-cs-faculty.stanford.edu/~knuth/cweb.html For information on literate programming, as well as additional CWEB examples, see http://www.literateprogramming.com

[2] For information on the Portable Document Format (PDF) of Adobe, see for example the homepage of Adobe Systems Inc., at http://www.adobe.com/products/acrobat/

[3] For information on the TeX typesetting system, as well as on the dvips program, see for example the website of the TeX Users Group, at http://www.tug.org

[4] For information on the PostScript programming language, see for example the PostScript area on the website of Adobe Systems Inc., at http://www.adobe.com/products/postscript/ or the reference book "PostScript Language - Tutorial and Cookbook" (Adison-Wesley, Reading, Massachusetts, 1985), ISBN 0-201-10179-3.

[5] The DVIPS program, which converts device-independent (DVI) output files into PostScript (PS), is copyrighted by Radical Eye Software, but is typically included in most TeX distributions under UNIX/Linux (teTeX on tug.org), Mac OS X (teTeX on sourceforge.net) and Microsoft Windows (MikTeX on miktex.org); see http://www.radicaleye.com for further information.

Return to previous page

Leave a message

Your name:

Your email: (required)

Message:

Generated by ::emailform::

Last modified Thursday 22 Dec 2011
QR code for string http://jonsson.eu/programs/cweb/dvlabel/