Next: , Previous: , Up: LaTeX   [Contents][Index]


10.1.3.1 LaTeX’s document class

An FWEB/LaTeX document is set up with the ‘\Wbegin’ command, issued automatically by FWEAVE. See the summary at the end of this section for the essence of what the ‘\Wbegin’ command accomplishes.

FWEAVE uses \documentclass{article} by default. In principle, the document class can be changed by the FWEB style-file option ‘LaTeX.class’; see Fwebmac params. However, FWEAVE has not been tested with most other document classes. It will probably not work with most document classes that redefine the sectioning commands from those of \documentclass{article}. However, it may work with the revtex scientific macro package. See REVTeX.

To incorporate class options—i.e., to obtain the effect of ‘\documentclass[myoptions]{article}’—use the style-file parameter LaTeX.class.options, as in

LaTeX.class.options "myoptions"

To get two-sided printing, for example, one would say

LaTeX.class.options "twoside"

To specify user packages—i.e., to obtain the effect of ‘\usepackage[pkgoptions]{pkgname}’—use the style-file parameters LaTeX.package and LaTeX.package.options, as in

LaTeX.package "pkgname"
LaTeX.package.options "pkgoptions"

For example, to indent the first line of every section and to permit the use of the multicol package (the latter is a useful way of substantially cutting down on white space), say

LaTeX.package "indentfirst,multicol"

Note that specifying LaTeX.package and LaTeX.package.options results in the execution (by the \Wbegin macro) of precisely one line of the form

\usepackage[myoptions]{mypackages}

Sometimes one instead needs to have multiple \usepackage lines, such as

\usepackage[option1]{package1}
\usepackage[option2]{package2}

To get this effect, one can put these commands explicitly into the style-file parameter doc.preamble (see discussion two paragraphs below), as in

doc.preamble = "\\usepackage[option1]{package1}\
                \\usepackage[option2]{package2}"

TeX commands in the user’s limbo section of the web source file will be processed after the \begin{document} command. Limbo commands from the style file can be inserted before and/or after those in the limbo section with the aid of the style-file parameters ‘limbo.begin’ and ‘limbo.end’; see S_limbo.

If there is a compelling reason to insert one’s own LaTeX commands between the ‘\usepackage’ and ‘\begin{document}’ commands, one may use the style-file parameter ‘doc.preamble’, whose value is a string consisting of LaTeX commands (empty by default). Those commands are processed immediately before ‘\begin{document}’. One use of ‘doc.preamble’ is to inhibit FWEB’s tendency to keep a section together on one page. To make it break more readily in the middle of sections (particularly useful for multicolumn output), say

doc.preamble "\\secpenalty=0"

In summary, the beginning of the file output by FWEAVE looks like the following, where ‘<parameter>’ means the contents of the style-file string called ‘parameter’:

\input fwebmac.sty
\Wbegin{many obscure arguments}
<limbo.begin>
Optional TeX commands copied from user's limbo section
<limbo.end>

The ‘\Wbegin’ command essentially does the following:

\documentclass[<LaTeX.class.options>]{<LaTeX.class>}
\usepackage[<LaTeX.package.options>]{<LaTeX.package>}
<doc.preamble>
\begin{document}

For precise information about how ‘\Wbegin’ works, see fwebmac.web. If you feel that macro absolutely needs to be changed, please inform the developer (see Support).


Next: , Previous: , Up: LaTeX   [Contents][Index]