Back Table of contents Index Next   BibTool Manual
Reference Manual
Format Specification
Expanding TeX/LaTeX Macros

Expanding TeX/LaTeX Macros

When fields are formatted certain LaTeX macros may be replaced by pure text. Each macro not defined is simply ignored. Initially no LaTeX macro is defined. The resource tex.define can be used to define LaTeX macros. The syntax is very close to LaTeX. The simplest form is the following definition.

tex.define = {macro=replacement text}

This resource defines a simple macro which is replaced by the replacement text. This replacement text may in turn contain macros.

In addition to this simple macro also macros involving arguments can be defined. As in LaTeX's \newcommand the number of arguments is appended after the macro name.

tex.define = {macro[arg]=replacement text}

The number of arguments may not exceed 9. The actual parameters are addressed by writing #n, where n is the number of the argument.

For instance, this feature can be used to ignore certain arguments of macros.

Note that there should be no spaces between the macro head and the equality sign (=). Similarly any unwanted spaces after the equality sign may have strange effects.

Usually the macro name starts with a backslash (\). If the macro name starts with another character then this character is made active (cf. [Knu89]). This feature is especially useful for translating characters with an extended ASCII code ( >= 128) to the appropriate TeX macros.

For instance the following definition forces the expansion of the macro \TeX to the string TeX.

tex.define = {\TeX=TeX}

Without this definition the title The \TeX{}book would result in book. With this definition the same title results in TeXbook.

Suppose you have an input file containing 8-bit characters (e.g. ISO 8859-1 encoding). The following definition can be used to map this character into a pure ASCII string1

tex.define = {ü=ue}

Some useful definitions can be found in the libraries distributed with BibTool (see also appendix Sample Resource Files).


1 To add an e is the German convention for umlaut characters.



Back Table of contents Index Next   BibTool Manual
Reference Manual
Format Specification
Expanding TeX/LaTeX Macros
© 1999 Gerd Neugebauer