Next: , Previous: , Up: Texinfo File Header   [Contents][Index]


3.2.3 @setfilename: Set the Output File Name

The @setfilename line specifies the name of the output file to be generated. 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.

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, makeinfo uses the input file name to determine the output name: first, any of the extensions .texi, .tex, .txi or .texinfo is removed from the input file name; then, the output format specific extension is added—.html when generating HTML, .info when generating Info, etc. The \input line is still ignored in this processing, as well as leading blank lines.

When producing another output format, makeinfo 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.

@setfilename used to be required by the Texinfo processors, and some other programs may still expect it to be present; for example, Automake (see Texinfo in GNU Automake).

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 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 is texinfo rather than texinfo.info. When makeinfo is running on operating systems such as MS-DOS which impose severe limits on file names, it may remove some characters from the original file name to leave enough space for the subfile suffix, thus producing files named texin-10, gcc.i12, etc.

See also the --output option in Invoking texi2any.


Next: , Previous: , Up: Texinfo File Header   [Contents][Index]