2.5.2 @setfilename: Set the Output File Name

The @setfilename line specifies the name of the output file to be generated by texi2any. This command is ignored for TeX formatting. When present, it should be the first Texinfo command (that is, after ‘\input texinfo’). Write the @setfilename command at the beginning of a line and follow it on the same line by the Info file name.

@setfilename info-file-name

The name must be different from the name of the Texinfo file. There are two conventions for choosing the name: you can either remove the extension (such as ‘.texi’) entirely from the input file name, or (recommended) replace it with the ‘.info’ extension. It is not advised to base the @setfilename name on a entirely different name than the input file name.

When a @setfilename line is present, the Texinfo processors ignore everything written before the @setfilename line. This is why the very first line of the file (the \input line) does not show up in the output.

If there is no @setfilename line, texi2any uses the input file name to determine the output name (see What a Texinfo File Must Have). The \input line is still ignored in this processing, as well as leading blank lines.

When producing another output format, texi2any will replace any final extension with the output format-specific extension (‘html’ when generating HTML, for example), or add a dot followed by the extension (‘.html’ for HTML) if the given name has no extension.

@-commands are not allowed in @setfilename, except for @@, @{, @} and associated @-commands such as @atchar{}.

@setfilename used to be required by the Texinfo processors and some other programs. This should not be the case any more; @setfilename can be omitted. If the Texinfo input is processed from standard input, without an input file name to deduce the base file name from, @setfilename could still be relevant. This is not the only way, however: --output option specifies the output file name on the texi2any command-line (see Invoking texi2any from a Shell).

Although an explicit ‘.info’ extension is preferable, some operating systems cannot handle long file names. You can run into a problem even when the file name you specify is itself short enough. This occurs because the Info formatters split a long Info file into short indirect subfiles, and name them by appending ‘-1’, ‘-2’, …, ‘-10’, ‘-11’, and so on, to the original file name. (See Tag Files and Split Files.) The subfile name texinfo.info-10, for example, is too long for old systems with a 14-character limit on filenames; so the Info file name for this document could be texinfo rather than texinfo.info on such a system. @setfilename is a way to specify an alternative name.