Output format is mainly controlled by the -O and -T options
described in the table below. When neither -O nor -T are
selected, and if gnu extensions are enabled, the program chooses an
output format suitable for a dumb terminal. Each keyword occurrence is
output to the center of one line, surrounded by its left and right
contexts. Each field is properly justified, so the concordance output
can be readily observed. As a special feature, if automatic
references are selected by option -A and are output before the
left context, that is, if option -R is not selected, then
a colon is added after the reference; this nicely interfaces with gnu
Emacs next-error
processing. In this default output format, each
white space character, like newline and tab, is merely changed to
exactly one space, with no special attempt to compress consecutive
spaces. This might change in the future. Except for those white space
characters, every other character of the underlying set of 256
characters is transmitted verbatim.
Output format is further controlled by the following options.
This option is automatically selected whenever gnu extensions are
disabled.
string may have more than one character, as in -F .... Also, in the particular case when string is empty (-F ""), truncation flagging is disabled, and no truncation marks are appended in this case.
As a matter of convenience to the user, many usual backslashed escape
sequences, as found in the C language, are recognized and converted to
the corresponding characters by ptx itself.
.xx "tail" "before" "keyword_and_after" "head" "ref"
so it will be possible to write a ‘.xx’ roff macro to take care of the output typesetting. This is the default output format when gnu extensions are disabled. Option -M can be used to change ‘xx’ to another macro name.
In this output format, each non-graphical character, like newline and
tab, is merely changed to exactly one space, with no special attempt to
compress consecutive spaces. Each quote character: " is doubled
so it will be correctly processed by nroff or troff.
\xx {tail}{before}{keyword}{after}{head}{ref}
so it will be possible to write a \xx
definition to take care of
the output typesetting. Note that when references are not being
produced, that is, neither option -A nor option -r is
selected, the last parameter of each \xx
call is inhibited.
Option -M can be used to change ‘xx’ to another macro
name.
In this output format, some special characters, like $, %,
&, # and _ are automatically protected with a
backslash. Curly brackets {, } are protected with a
backslash and a pair of dollar signs (to force mathematical mode). The
backslash itself produces the sequence \backslash{}
.
Circumflex and tilde diacritical marks produce the sequence ^\{ }
and
~\{ }
respectively. Other diacriticized characters of the
underlying character set produce an appropriate TeX sequence as far
as possible. The other non-graphical characters, like newline and tab,
and all other characters which are not part of ASCII, are merely
changed to exactly one space, with no special attempt to compress
consecutive spaces. Let me know how to improve this special character
processing for TeX.