3.2.1 Setting Main Program String Variables

To set the value of a string customization variable from an initialization file, use texinfo_set_from_init_file:

Function: texinfo_set_from_init_file ($variable_name, $variable_value)

$variable_name is a string containing the name of the variable you want to set, and $variable_value is the value to which you want to set it. $variable_value may be ‘undef’.

For example,

texinfo_set_from_init_file('documentlanguage', 'fr');

overrides the @documentlanguage from the document. It would be overridden by --document-language on the command line. Another example:

texinfo_set_from_init_file('SPLIT', 'chapter');

overrides the default splitting of the document. It would be overridden by --split on the command line.

A final example:

texinfo_set_from_init_file('NO_CSS', 1);

overrides the default value for NO_CSS. It would be overridden by --set-init-variable NO_CSS=1 on the command line.

Setting the output format cannot be done by setting the customization variable TEXINFO_OUTPUT_FORMAT. This customization variable sets the output format in the main program, but not from init files as additional code needs to be run. Instead, the texinfo_set_format_from_init_file function should be used:

Function: texinfo_set_format_from_init_file ($output_format)

$output_format is the output format; sets the output format, without overriding formats set from the command line.

Any output format can be set, but since only HTML can be customized, the main use of texinfo_set_format_from_init_file is to set the format to ‘html’, such that HTML is generated instead of Info in the default case.

For the customization variables associated with @-commands, see Customization Variables for @-Commands in Texinfo. For the customization variables associated with command line options, see Customization Variables and Options in Texinfo.