|
"http://www.w3.org/TR/REC-html40/loose.dtd">
Cutting your document into pieces with HACHA
# hevea mydoc.tex
Then cut mydoc.html into pieces by the command:
# hacha mydoc.html
This will generate a simple root file
index.html.
This root file holds document title, abstract and a simple table of
contents.
Every item in the table of contents contains a link to or into a file
that holds a ``cutting'' sectional unit.
By default, the cutting sectional unit is section in the
article style and chapter in the book
style.Additionally, one level of sectioning below the cutting unit (i.e., subsections in the article style and sections in the book style) is shown as an entry in the table of contents. Sectional units above the cutting section (i.e., parts in both article and book styles) close the current table of contents and open a new one. Cross-references are properly handled, that is, the local links generated by HEVEA are changed into remote links. The name of the root file can be changed using the -o option:
# hacha -o root.html mydoc.html
Some of HEVEA output get replicated in all the files generated by HACHA. Users can supply a header and a footer, which will appear at the begining and end of every page generated by HACHA. It suffices to include the following commands in the document preamble: \htmlhead{ header} \htmlfoot{ footer}
<BODY ...> opening tag and
meta-information from the <HEAD> ... <\HEAD>
block. See section B.2 for examples of this replication
feature.
HACHA behavior can be altered from the document source, by using a counter and a few macros. A document that explicitly includes cutting macros still can be typeset by LATEX, provided it loads the hevea.sty style file from the HEVEA distribution. (See section 5 for details on this style file). An alternative to loading the hevea package is to put all cutting instructions in comments starting with %HEVEA .
At any point between \begin{document} and
\end{document} ,
there exist a current cutting sectional unit (cutting unit for short),
a current cutting depth, a root file and an output file.
Table of contents output goes to the root file, normal output goes to
the output file.
Cutting units start a new output file, whereas units comprised between the
cutting unit and the cutting units plus the cutting depth add new
entries in the table of contents.At document start, the root file and the output file are HACHA output file (i.e., index.html). The cutting unit and the cutting depth are set to default values that depend on the document style.
\begin{document} . They all generate HTML comments in HEVEA
output.
These comments then act as instructions to HACHA.
\begin{document} performs
\cutdef[\value{cuttingdepth}]{\cuttingunit}and \end{document}
performs \cutend .
All sectioning commands perform \cuthere ,
with the sectional unit name as first argument and the (optional, if
present) sectioning
command argument (i.e., the section title) as second argument.
Note that started versions of the sectioning commands also perform
cutting instructions.
Consider, for instance, a book document with a long chapter that you want to cut at the section level, showing subsections: \chapter{A long chapter} ..... \chapter{The next chapter}Then, you should insert a \cutdef at chapter start and a
\cutend at chapter end:
\chapter{A long chapter} %HEVEA\cutdef[1]{section} ..... %HEVEA\cutend \chapter{The next chapter}Then, the file that would otherwise contain the long chapter now contains the chapter title and a table of sections. No other change is needed, since the macro section already
performs the appropriate \cuthere{section}{...} commands,
which were ignored by default.
(Also note that cutting macros are placed inside %HEVEA comments,
for LATEX not to be disturbed).The \cuthere macro can be used to put some document parts into
their own file.
This may prove appropriate for long cover pages or abstracts that would
otherwise go into the root file.
Consider the following document:
\documentclass{article} \begin{document} \begin{abstract} A big abstract \end{abstract} ...Then, you make the abstract go to its own file as it was a cutting unit by typing: \documentclass{article} \usepackage{hevea} \begin{document} \cuthere{\cuttingunit}{Abstract} \begin{abstract} A big abstract \end{abstract} ...(Note that, this time, cutting macros appear unprotected in the source. However, LATEX still can process the document, since the hevea package is loaded).
\cutname{ name} command
sets the name of the current output file name as name.Consider a document cut at the section level, which contains the following important section : \section{Important section}\label{important} ...To make the important section goes into file important.html, one writes : \section{Important section}\label{important}\cutname{important.html} ...Then, section ``Important section'' can be referenced from an HEVEA unaware HTML page by : In this document, there is a very <A HREF="important#important.html">important section</A>.If you are reading the HTML version of this manual, you may check that wou are now reading file ``cutname.html''. This particular file name has been specified from the source using \cutname{cutname.html} .
\htmlprefix command.
Hence, by writing
\htmlprefix{\hevea{} Manual: } in the document,
the title of this page would become :
``HEVEA Manual: Cutting your document into pieces with HACHA''
and the title of all other pages would show the same prefix.
\toplinks{ prev}{ up}{ next} instructs HACHA to put links to a
``previous'', ``up'' and ``next'' page in the root file.
The following points are worth noticing:
cutflow environment :
\begin{cutflow}{ title} ...\end{cutflow}
The content ``...'' will go into a file of its own, while the argument title is used as the title of the introduced HTML page. The HTML page introduced here does not belong to the normal flow of text. Consequently, one needs an explicit reference from the normal flow of text into the content of the cutflow environment.
This will occur naturally when the content of the cutflow environment.
contains a \label construct.
This look natural in the following quiz example:
\paragraph{A small quiz} \begin{enumerate} \item What is black? \item What is white? \item What is Dylan? \end{enumerate} Answers in section~\ref{answers}. \begin{cutflow}{Answers} \paragraph{Quiz answers}\label{answers} \begin{enumerate} \item Black is black. \item White is white. \item Dylan is Dylan. \end{enumerate} \end{cutflow}The example yields: A small quiz
However,introducing HTML hyperlink targets and references with the \aname and \ahrefloc commands
(see section 8.1.1)
will be more practical most of the time. |