|
"http://www.w3.org/TR/REC-html40/loose.dtd">
Style files
The base style of a LATEX document is the argument to the \documentclass command (\documentstyle in old style).
Normally, the base style of a document defines the structure and
appearance of the whole document.HEVEA really knows about two LATEX base styles, article and book. Additionally, the report base style is recognized and considered equivalent to book and the seminar base style for making slides is recognized and implemented by small additions on the article style. Base style style is implemented by an HEVEA specific style file style .hva .
More precisely, HEVEA interprets
\documentclass{ style} by attempting to load
the file style.hva (see section C.1.1.1 on where
HEVEA searches for files).
Thus, at the moment, HEVEA distribution includes the files,
article.hva, book.hva, etc.
Let us assume that mydoc.tex uses an exotic base style such as acmconf. Then, typing hevea mydoc.tex will yield an error, since
HEVEA cannot find the acmconf.hva file:
# hevea.opt mydoc.tex mydoc.tex:1: Warning: Cannot find file: acmconf.hva mydoc.tex:1: Error while reading LaTeX: No base style AdiosThis situation is avoided by invoking HEVEA with the known base style file article.hva as an extra argument: # hevea article.hva mydoc.texThe extra argument instructs HEVEA to load its article.hva style file before processing mydoc.tex. It will then ignore the document base style specified by \documentclass (or \documentstyle ).Observe that the fix above works because the acmconf and article base styles look the same to the document (i.e., they define the same macros). More generally, most base styles that are neither article nor book are in fact variations on either two of them. However, such styles usually provides extra macros. If users documents use these macros, then users should also instruct HEVEA about them (see section 4.1). Finally, it is important to notice that renaming a base style file style .cls into
style.hva will not work in general.
As a matter of fact, base style files are TeX and not LATEX source and
HEVEA will almost surely fail on TeX-ish input.
\input or \usepackage or \input .
\input{ file} by loading the file
file. (if I got it right, HEVEA even follows TeX crazy
convention on ``.tex'' extensions).As it is often the case, assume that the document mydoc.tex has a \input{mymacros.tex} instruction in its preamble, where
mymacros.tex gathers custom definitions.
Hopefully, only a few macros give rise to trouble: macros that performs fine
typesetting or TeXish macros.
Such macros need to be rewritten, using basic LATEX
constructs (section 4 gives examples of macro-rewriting).
The new definitions are best collected in a style file,
mymacros.hva for instance.
Then, mydoc.tex is to be translated by issuing the command:
# hevea mymacros.hva mydoc.texThe file mymacros.hva is processed before mydoc.tex (and thus before mymacros.tex). As a consequence of HEVEA behavior with respect to definition and redefinition (see section B.8.1), the macro definitions in mymacros.tex override the ones in mymacros.tex, provided the document original definitions are performed by \newcommand
(or \newenvironment ).Another situation is when HEVEA fails to process a whole style file. Usually, this means that HEVEA crashes on that style file. The basic idea is then to write a mymacros.hva style file that contains alternative definitions for all the commands defined in mymacros.sty. Then, HEVEA should be instructed to load mymacros.hva and not to load mymacros.tex. This is done by invoking hevea as follows: # hevea mymacros.hva -e mymacros.tex mydoc.texOf course, mymacros.hva must now contain replacements for all the useful macros of mymacro.tex.
\usepackage{ name} by loading the file
name.sty.
HEVEA reacts in a similar, but different, manner, by
loading the file name.hva.HEVEA distributions already includes quite a few ``.hva'' implementations of famous packages (see section B.17). When a given package (say zorglub) is not implemented, the situation may not be as bad as it may seem first. Hopefully, you are only using a few commands from package zorglub, and you feel confident enough to implement them yourself. Then, it suffices to put your definitions in file zorglub.hva and HEVEA will react to \usepackage{zorglub} by loading
zorglob.hva.See section B.5.2 for the full story on \usepackage . |