Next: External Macro Processors, Previous: @alias, Up: Defining New Texinfo Commands   [Contents][Index]
@definfoenclose: Customized HighlightingAn @definfoenclose command may be used to define a
highlighting command for all the non-TeX output formats.  A command
defined using @definfoenclose marks text by enclosing it in
strings that precede and follow the text.  You can use this to get
closer control of your output.
Presumably, if you define a command with @definfoenclose, you
will create a corresponding command for TeX, either in
texinfo.tex, texinfo.cnf, or within an ‘@iftex’ or
‘@tex’ in your document.
Write a @definfoenclose command at the beginning of a line
followed by three comma-separated arguments.  The first argument to
@definfoenclose is the @-command name (without the
@); the second argument is the start delimiter string; and the
third argument is the end delimiter string.  The latter two arguments
enclose the highlighted text in the output.
A delimiter string may contain spaces. Neither the start nor end delimiter is required. If you do not want a start delimiter but do want an end delimiter, you must follow the command name with two commas in a row; otherwise, the end delimiter string you intended will naturally be (mis)interpreted as the start delimiter string.
If you do a @definfoenclose on the name of a predefined
command (such as @emph, @strong, @t, or
@i), the enclosure definition will override the built-in
definition.  We don’t recommend this.
An enclosure command defined this way takes one argument in braces, since it is intended for new markup commands (see Marking Text).
For example, you can write:
@definfoenclose phoo,//,\\
near the beginning of a Texinfo file to define @phoo as an Info
formatting command that inserts ‘//’ before and ‘\\’ after the argument
to @phoo.  You can then write @phoo{bar} wherever you
want ‘//bar\\’ highlighted in Info.
For TeX formatting, you could write
@iftex @global@let@phoo=@i @end iftex
to define @phoo as a command that causes TeX to typeset the
argument to @phoo in italics.
Each definition applies to its own formatter: one for TeX, the
other for everything else.  The raw TeX commands need to be in
‘@iftex’.  @definfoenclose command need not be within
‘@ifinfo’, unless you want to use different definitions for
different output formats.
Here is another example: write
@definfoenclose headword, , :
near the beginning of the file, to define @headword as an Info
formatting command that inserts nothing before and a colon after the
argument to @headword.
‘@definfoenclose’ definitions must not be recursive, directly or indirectly.
Next: External Macro Processors, Previous: @alias, Up: Defining New Texinfo Commands   [Contents][Index]