(Man Kam Kwong,kwong@mcs.anl.gov)

For a brief overview See hhelp.

Contents

  1. What is "htxp"? How does it work? Do I want to go on?
    Installation Disclaimers
  2. Abbreviations In-doc abbreviations
    Abbreviation suppression
  3. Built-in Dot commands Dot commands grouped by categories User commands Examples of User Commands
  4. Goals and what-nexts

1.1 What is "htxp"?

It is a preprocessor that provides time-saving features for writing HTML files: by allowing the use of user-specified abbreviations, and built-in and user-definable macros.

We assume that you are already familiar with HTML commands. If not, some good places to start are

1.2 How does "htxp" work?

You write a raw or source file (say, its name is "file") that is essentially an ordinary HTML file with (optional) abbreviations and macros replacing long strings and commands, (you can also modify an existing regular HTML file) and then use "htxp" to expand it.

There are three types of shorthand.

  1. Abbreviations. Words, phrases, and long strings of ascii (such as file names, directory names, or parts of them) that occur more than a couple of times in one or more documents can be given abbreivated codes. For example, it is much faster to type ";ab" than "abbreviation", ";fe" than "for example", or "$h" than "//www.mcs.anl.gov/home/kwong". These abbreviations are defined, in specified files, by the user.
  2. Common HTML commands have shorter built-in "htxp" equivalents, such as instead of and instead of
  3. User Macros. They work very much like the built-in commands above, but they are defined by the user. With ingenuity, one can construct some rather complicated and useful macros. For example, the "Tips" environment used below and the "Example" environment used in Section 3.4 are generated by the pairs of macros "]tp", "]Tp", and "]xp", "]Xp", respectively, without having to explicitly enter the link for the the color bullets and the header texts every time.

As an example, the raw file for some version of part of this subsection is shown below.

The command

will expand "file" into a regular HTML file "file.html".
TIP:If you use "vi", make an alias "vhtxp" Then "vhtxp file" lets you edit "file". Once you finish editing, "file.html" will be automatically generated.
An additional argument "-" after the file name expands only the abbreviations, not the macro commands.

To use the help utility, issue the command

1.4 Do I want to go on?

Does that Mean I Have to Learn More Commands?

Won't Too Many Macros Make the Document Cryptic?

What if a Command Does Not Work As Claimed?

I Didn't Use Any htxp Commands, But Funny Things Still Happen!


Benefits


1.4 Installation

If you work at MCS, Argonne, the commands "magicxp" and "hhelp" are already available in /usr/local/bin.

If not, obtain the C source files magicxp.c, hhelp.c, html.hlp, and magicxp.h and compile them with "cc magicxp.c -o magicxp" and "cc hhelp.c -o hhelp" (in a UNIX environment, or with "gcc").

The code may be modified from time to time for improvement or for bug removal. You should update your copy of the code accordingly -- check the date of last revision in the code.

Pick a directory where you will place your user-specified files ("html.rc" or "html.ab1", "html.ab2", and "html.ucm") and the help file "html.hlp" (if you have not obtained this file yet, get it by clicking the name that appears at the beginning of the section), and create the aliases (if you use a shell similar to "csh") [ create batch files "htxp.bat" and "hthlp.bat" in DOS ]

The parent command "magicxp" (of "htxp") is a general-purpose macro tool. Preprocessors for writing other moderately complex document formats can be easily created by modifying the underlying "built-in command macro database" that appears in the second half of "magicxp.h".

1.5 Disclaimers

Use the program at your own risk.


Mathematics and Computer Science Division
Argonne National Laboratory
9700 S Cass Ave
Argonne, IL 60439


Go on to Section 2