4.3 Simple Customization for Simple Commands with Braces

The formatting of the output produced by “indicator” and font commands (e.g., @code, @t), and other simple commands with arguments (e.g., @asis, @clicksequence, @sup, @verb) can be changed with texinfo_register_style_command_formatting:

Function: texinfo_register_style_command_formatting ($command_name, $html_element, $in_quotes, $context)

$command_name is the @-command name, without the leading @. $context is ‘normal’, ‘preformatted’ or ‘string’. There is no separate math context, ‘preformatted’ should be used for math context. See Init File Expansion Contexts: Normal, Preformatted, Code, String, Math. If $context is undef, the ‘normal’ context is assumed.

If $html_element is set, the argument is enclosed between the $html_element element opening and the element closing. $html_element is always ignored in ‘string’ context. If $in_quotes is true, the result is enclosed in quotes associated with customization variables OPEN_QUOTE_SYMBOL and CLOSE_QUOTE_SYMBOL.

If $html_element is undefined and $in_quotes is not set, the formatted argument is output as is.

For example, to set @sansserif{argument} to be formatted as <code>argument</code> in normal and preformatted context, and as a quoted string in string context, use:

texinfo_register_style_command_formatting('sansserif', 'code', 0,
                                          'normal');
texinfo_register_style_command_formatting('sansserif', 'code', 0,
                                          'preformatted');
texinfo_register_style_command_formatting('sansserif', undef, 1,
                                          'string');

To output the formatted argument of @t as is:

foreach my $context ('normal', 'example', string') {
  texinfo_register_style_command_formatting ('t', undef,
                                             undef, $context);
}