## User-defined Replacements

Up: Fine-Tuning Next: Examples Previous: Errors

You can provide your own definition of many TeX and LaTeX commands by including a definitions file. This file contains entries of the form

operation name optional-string
Lines may be commented out by starting them with the character #.
operation
This is one of nop (no operation and remove arguments), dimen (TeX dimension) asis (no operation but leave arguments), name (replace with a string), or raw (replace with verbatim text, such as an HTML command), and exec (insert TeX commands).

name
This is the name of the TeX or LaTeX command, without the initial backslash. That is, to redefine \samepage, use the name samepage.

optional-string
This is null (for dimen), an integer for the number of arguments (for nop or asis), or the replacement string (for name). Currently, there is no way to specify leading or trailing spaces.

For example, when tohtml starts, it reads a file that contains the definitions of some basic commands, such as

dimen topsep
asis underline 1
nop thispagestyle 1
name mu 0 u
raw seprule 0 <HR>

The first line states that \topsep is a dimension; tohtml will understand what to do when it sees this name. The second line says that \underline is a command with a single argument and that the appropriate HTML for this is to use the argument (thus, \underline{abc} will become abc in the HTML document). The third line says that \thispagestyle is a command with a single argument and can be ignored (performs no operation, or `no-op'). The fourth line tells tohtml to replace \mu with u. The last line tells tohtml to replace \seprule with the HTML command <HR>. Any number of -basedef files may be specified; they are processed in order starting from the left. The default basedef file is always read first.

Up: Fine-Tuning Next: Examples Previous: Errors