You can change 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
) with texinfo_register_style_command_formatting
:
$command_name is the @-command name, without the leading @.
$context is ‘normal’ or ‘preformatted’.
There is no separate math context, ‘preformatted’ should be used
for math context. See Init File Expansion Contexts: Normal, Preformatted, Code, String, Math. There is no string
context either, as in string context simple formatting without the need
for per command information should be sufficient. 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.
If $in_quotes is true, the result is enclosed in quotes associated with
customization variables OPEN_QUOTE_SYMBOL
and CLOSE_QUOTE_SYMBOL
(see Customization of HTML Code Inserted in Texinfo).
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,
with quotes in preformatted context, use:
texinfo_register_style_command_formatting('sansserif', 'code', 0, 'normal'); texinfo_register_style_command_formatting('sansserif', 'code', 1, 'preformatted');
To output the formatted argument of @t
as is:
foreach my $context ('normal', 'preformatted') { texinfo_register_style_command_formatting ('t', undef, undef, $context); }