| 1 |
% $DocId: cweb-user.tex,v 2.10 1995/11/20 22:34:16 schrod Exp $ |
| 2 |
%------------------------------------------------------------ |
| 3 |
|
| 4 |
% |
| 5 |
% user manual/requirement definition for cweb class |
| 6 |
% |
| 7 |
% [LaTeX] |
| 8 |
% (history at end) |
| 9 |
|
| 10 |
|
| 11 |
% This file is either a subdocument of the style doc or a document on |
| 12 |
% its own. In the former case it's a chapter, in the latter it's a |
| 13 |
% ``normal'' LaTeX progltx document. |
| 14 |
% If it's a subdocument, this file will be included after |
| 15 |
% \begin{document}. We can detect this: \document redefines |
| 16 |
% \documentclass to be \@twoclasseserror. Then we also have to define |
| 17 |
% how this document is ended: Either by \endinput or by an additional |
| 18 |
% revision log. |
| 19 |
% Of course, this test works only if LaTeX 2e is used for processing. |
| 20 |
|
| 21 |
\expandafter\ifx \csname @twoclasseserror\endcsname \documentclass |
| 22 |
|
| 23 |
\let\endSubDocument=\endinput |
| 24 |
|
| 25 |
\chap What's this class for?. |
| 26 |
|
| 27 |
\else |
| 28 |
|
| 29 |
\let\endSubDocument=\relax |
| 30 |
|
| 31 |
\documentclass{progltx} |
| 32 |
|
| 33 |
\usepackage{cweb-doc} % additional document-specific markup |
| 34 |
\usepackage{a4-9} % Tschichold's A4 layout |
| 35 |
|
| 36 |
|
| 37 |
\begin{document} |
| 38 |
|
| 39 |
\title{The \texttt{cweb} Class} |
| 40 |
\author{Joachim Schrod% |
| 41 |
\thanks{Email: \texttt{[email protected]}}% |
| 42 |
} |
| 43 |
|
| 44 |
\RCS $DocDate: 1995/11/20 22:34:16 $ |
| 45 |
\date{% |
| 46 |
\RCSDocDate\\[3pt] % LaTeX Error: Paragraph terminated too early |
| 47 |
(Revision \RCSStyleRevision{} of \texttt{cweb.cls})% |
| 48 |
} |
| 49 |
|
| 50 |
\maketitle |
| 51 |
|
| 52 |
\sect |
| 53 |
|
| 54 |
\fi |
| 55 |
|
| 56 |
\cweb{} is a Literate Programming tool that enables you to combine |
| 57 |
documentation and actual C or \C++ code in one document. The \cls{cweb} |
| 58 |
class allows you to use \LaTeX{} for the documentation of your \cweb{} |
| 59 |
programs. Now a \cweb{} document is like a usual \LaTeX{} |
| 60 |
document---as you have probably written dozens before. With all the |
| 61 |
features of \LaTeX{}, and with all the quirks of \LaTeX{}. |
| 62 |
|
| 63 |
Originally, \cweb{} was only usable with Plain \TeX{}, as \cweave{} |
| 64 |
outputs \TeX{} code that looks as if it were Plain \TeX{}. Well, it |
| 65 |
isn't---it's just not the normal \LaTeX{} markup. No change in |
| 66 |
\cweave{} is necessary to use \LaTeX{}. |
| 67 |
|
| 68 |
For the sake of those \cweb{} programmers who have used the original |
| 69 |
markup interface (i.e., the Plain \TeX{} macros) before, I'll |
| 70 |
sometimes contrast the approach presented here with the original one. |
| 71 |
Then I'll call the original interface ``Plain \cweb{}''. The new |
| 72 |
interface is called ``\LaTeX{} \cweb{}''. |
| 73 |
|
| 74 |
If you never used \cweb{} before, you won't find enough information in |
| 75 |
this manual. Please read the user manual of \cweb{} first, and then |
| 76 |
come back again. I assume a working knowledge, and will only present |
| 77 |
the new stuff introduced by this class. |
| 78 |
|
| 79 |
|
| 80 |
\sect This bundle does \emph{not} support inclusion of \cweb{} code in |
| 81 |
other (general) \LaTeX{} documents. This is not the task of the |
| 82 |
\cls{cweb} class -- its task is the usage of \LaTeX{} for creation of |
| 83 |
\cweb{} documents. |
| 84 |
|
| 85 |
Note also that you will not be able to \LaTeX{} your \cweb{} documents |
| 86 |
(i.e., the program files) directly. You must still process them first |
| 87 |
by \cweave{}, then you can use \LaTeX{} to process the resulting |
| 88 |
\TeX{} file. |
| 89 |
|
| 90 |
|
| 91 |
\sect You have to use \cweb{} version~3 and you need at least \LaTeX{} |
| 92 |
version \mbox{$\langle$1994/12/01$\rangle$} (or any later one), this |
| 93 |
class does not work with older versions. |
| 94 |
|
| 95 |
|
| 96 |
\sect A \cweb{} document has two concurrent structures, a |
| 97 |
\textsl{document structure} and a \textsl{program structure}. |
| 98 |
|
| 99 |
The basic building block of the document structure, the bricks that |
| 100 |
build up our document, are called \textsl{chunks}. We use chunks to |
| 101 |
present one point of our work to our reader, the presentation has both |
| 102 |
informal (explanation) and formal parts (code). This is the essence of |
| 103 |
Literate Programming, that we tell each point twice, once on an |
| 104 |
abstract and once on a technical level. |
| 105 |
|
| 106 |
A chunk consists of three parts: (1)~the \textsl{documentation part}, |
| 107 |
(2)~the \textsl{definition part}, and (3)~the \textsl{program part}. |
| 108 |
Each of these parts can be empty. The documentation part is mostly |
| 109 |
text with \LaTeX{} tags. In this text material from \textsl{restricted |
| 110 |
program mode} can appear. The definition part consists of a series of |
| 111 |
either \textsl{macro} or \textsl{format definitions}. The program part |
| 112 |
is one piece of a refinement, identified by a name (see below). |
| 113 |
|
| 114 |
A chunk starts with `\verb*|@ |', and gets assigned a unique |
| 115 |
identification, a number; we'll use that number to refer to that |
| 116 |
chunk. In particular, the number is of interest when we want to refer |
| 117 |
to the code part of the chunk, otherwise it's often regarded as |
| 118 |
superfluous. |
| 119 |
|
| 120 |
\sect And we have higher-level structure elements as well. They combine a |
| 121 |
sequence of chunks and a sequence of structure elements on a lower |
| 122 |
level, both sequences may be empty. As usual in \LaTeX{}, we call |
| 123 |
these elements \textsl{section divisions} or short \textsl{sections}. |
| 124 |
We do not give them names |
| 125 |
like `part,' `chapter,' `subsection,' etc., to denote their level; |
| 126 |
most often we'll use level-numbers (sometimes called \textit{rank}) |
| 127 |
instead. |
| 128 |
|
| 129 |
A section division starts with `|@*|' and is followed by a character, the rank |
| 130 |
indicator. The highest rank is~`|@**|', you can think of it as an |
| 131 |
equivalence to \LaTeX{}'s |\part|. (Often we don't use that rank in |
| 132 |
smaller programs, as we don't use |\part| in smaller articles.) A |
| 133 |
section on the next rank is started with~`\verb*|@* |' (synonym to |
| 134 |
`|@*0|'), roughly equivalent to chapters. Then we'll use numbers to |
| 135 |
mark the next ranks, from |@*1| to~|@*9| (sections to |
| 136 |
sub$^{9}$sections). That's outrageous---I'll hope you'll never use |
| 137 |
11~hierarchy levels in your documents, they would be unreadable. |
| 138 |
|
| 139 |
A section has a title, that title comes after the section start tag |
| 140 |
and ends with a full stop. If you need periods in your title, enclose |
| 141 |
them in braces. (That behavior can be changed if there's enough |
| 142 |
interest. I can also make it possible to use braces to delimit the |
| 143 |
section title, as in |\section|, etc. Send mail with your opinion.) |
| 144 |
|
| 145 |
As a matter of convenience, a section implicitly starts a chunk; |
| 146 |
i.e., one does not need to use `\verb*|@ |' after the section title. |
| 147 |
Of course, it doesn't hurt to use it either. |
| 148 |
|
| 149 |
\medskip |
| 150 |
|
| 151 |
The explanation might have been a bit too abstract, so let me make one |
| 152 |
thing plain clear: You should \emph{never ever} use |\part|, |
| 153 |
|\chapter|, |\section|, or any other \LaTeX{} sectioning command in |
| 154 |
your \cweb{} documents. Use the sectioning commands of \cweb{}, i.e., |
| 155 |
`|@*|\textit{rank}'. |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
\sect The description above does not mean that the output is fixed to |
| 160 |
the style you'll know from the \cls{book} or \cls{report} document |
| 161 |
classes. Quite in contrary, the default layout is oriented along the |
| 162 |
\cls{article} class. |
| 163 |
|
| 164 |
There is a very easy possibility to change that default layout: With |
| 165 |
the option |baseclass| (see chunk~\ref{chunk:baseclass}) you can |
| 166 |
specify the document class \cls{cweb} inherits from. If that document |
| 167 |
class has chapters (like \cls{report} or \cls{book}), you'll get the |
| 168 |
layout as you're used from these classes. |
| 169 |
|
| 170 |
|
| 171 |
\sect In Plain \cweb{}, the term \textit{section} was used for |
| 172 |
`chunk.' We abstain from that usage, as sections are used in \LaTeX{} |
| 173 |
(and in almost all other documentation systems, for that matter) to |
| 174 |
designate higher-level structure elements. We prefer to follow the |
| 175 |
traditional usage of terms here, even if that means that we'll have to |
| 176 |
confront Plain \cweb{} users with a slight shift in semantics. |
| 177 |
|
| 178 |
And you'll find the term \textit{starred section} in Plain \cweb{} and |
| 179 |
might think these are our sections. Well, almost. There's a subtle, |
| 180 |
but important difference between these starred sections and our |
| 181 |
terminology: A starred section is just a chunk with a special |
| 182 |
attribute (a title). That title will appear in a table of contents, |
| 183 |
but that does not mean that the starred section is an element to |
| 184 |
denote a structural \emph{hierarchy}. |
| 185 |
|
| 186 |
You won't find a section number like `1.5.2' in Plain \cweb{}, do you? |
| 187 |
--- In \LaTeX{} \cweb{}, you've got the choice. You have the new |
| 188 |
support of the hierarchical structure, or you may stay with Plain |
| 189 |
\cweb{}'s (flat) structure. |
| 190 |
|
| 191 |
|
| 192 |
\sect We still have one open point in our explanation of the |
| 193 |
document's structure. As mentioned at the start, we've got two |
| 194 |
concurrent structures, let's have a look at the program structure |
| 195 |
finally. |
| 196 |
|
| 197 |
A \cweb{} program consists of a tree of \textsl{refinements}. A |
| 198 |
refinement is a sequence of program parts with the same name, ordered |
| 199 |
in appearance in the document. The root of the tree is the refinement |
| 200 |
with the special name~|@c|. |
| 201 |
|
| 202 |
The complete program text is defined by the depth-first traversal |
| 203 |
(DFS, i.e.\ infix-order) of the tree, the tool \ctangle{} extracts the |
| 204 |
program text from a \cweb{} document. |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
\chap Markup for your document structure. |
| 210 |
|
| 211 |
Like every \LaTeX{} document, a \cweb{} document starts with a |
| 212 |
document class specification; then comes the preamble, terminated by |
| 213 |
the document start. This way we brought some structure in the \cweb{} |
| 214 |
limbo, but this shouldn't be a problem for you. You must tag the end |
| 215 |
of the document, as you do in other \LaTeX{} files. But here you must |
| 216 |
take a bit more care: |
| 217 |
% |
| 218 |
\begin{quote} |
| 219 |
\itshape |
| 220 |
|
| 221 |
Assert that the\/ |\end{document}| is in the documentation part of |
| 222 |
a\/ chunk, neither in the definition nor in the program part. |
| 223 |
|
| 224 |
\end{quote} |
| 225 |
% |
| 226 |
If it would be in the program part, \cweave{} would readily process it |
| 227 |
and \LaTeX{} would never see this tag. Nevertheless, if you make this |
| 228 |
mistake, you will detect it early: \ctangle{} will copy this tag to |
| 229 |
the C file as well, and your program will be erroneous\,\dots |
| 230 |
|
| 231 |
And there's another difference you'll have to take care of: Usually |
| 232 |
you can put arbitrary text after the end of your document, \LaTeX{} |
| 233 |
will not see it. Please note that both \ctangle{} and \cweave{} will |
| 234 |
still see it---don't put a program part or even complete chunks there. |
| 235 |
For technical reasons, there must not be any |\fi| token after the |
| 236 |
document end, too. |
| 237 |
|
| 238 |
|
| 239 |
\sect The resulting structure of your \cweb{} document is exemplified |
| 240 |
in figure~\ref{fig:structure}. Note that |\end{document}| is placed |
| 241 |
in a new, empty, chunk. This isn't necessary, you could write more |
| 242 |
documentation there---but it's considered good style to use a sole |
| 243 |
chunk for document finish. |
| 244 |
|
| 245 |
%% my little joke |
| 246 |
\begin{figure} |
| 247 |
|
| 248 |
\setbox0=\vbox{\parindent=0pt \hsize=.85\textwidth |
| 249 |
\begin{minipage}{\hsize} |
| 250 |
\begin{verbatim} |
| 251 |
\documentclass{cweb} |
| 252 |
|
| 253 |
\begin{document} |
| 254 |
|
| 255 |
\title{My Program, Doomed for the ACM Software Systems Award} |
| 256 |
\author{Joe L. User} |
| 257 |
|
| 258 |
\maketitle |
| 259 |
|
| 260 |
\tableofcontents % if you want |
| 261 |
|
| 262 |
|
| 263 |
@* A PSPACE solution for the Traveling Salesman. |
| 264 |
|
| 265 |
< insert your program here > |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
@ |
| 270 |
\end{document} |
| 271 |
\end{verbatim} |
| 272 |
\end{minipage} |
| 273 |
} |
| 274 |
|
| 275 |
\begin{center} |
| 276 |
\fboxsep=1em |
| 277 |
\fbox{\box0} |
| 278 |
\end{center} |
| 279 |
|
| 280 |
\caption{Exemplified \cweb{} document structure} |
| 281 |
\label{fig:structure} |
| 282 |
\end{figure} |
| 283 |
|
| 284 |
|
| 285 |
\sect If you don't call \cweave{} with the |-x| option, an identifier |
| 286 |
index and a list of all refinements is created at the end of the |
| 287 |
document. You can specify an introductionary text for the index with |
| 288 |
the tag |\cwebIndexIntro|, the introduction is the argument of this |
| 289 |
tag. |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
\chap Configuration. |
| 295 |
|
| 296 |
You may configure the \cls{cweb} class in several ways, with class |
| 297 |
options, redefinitions in the preamble, supplying additional |
| 298 |
packages, and by subclassing it. |
| 299 |
|
| 300 |
At start of the processing, the file |cweb.cfg| is read if it exists. |
| 301 |
That file may contain configuration code that shall apply to all your |
| 302 |
\cweb{} documents. You can set the paper size there, etc. Please don't |
| 303 |
set the default structure there (see |
| 304 |
chunk~\ref{chunk:structure-option}), others would get different results |
| 305 |
when they process your document. |
| 306 |
|
| 307 |
|
| 308 |
\sect Options are specified with the new ``keyword$=$value''-scheme, |
| 309 |
first introduced with the \pkg{graphicx} package. I.e., the options have a |
| 310 |
set of possible values, you may choose one. For instance, the option |
| 311 |
|structure| has the possible values |flat| and |hierarchic|. You tell |
| 312 |
that you want a flat document structure by |
| 313 |
% |
| 314 |
\begin{quote} |
| 315 |
|\documentclass[structure=flat]{cweb}| |
| 316 |
\end{quote} |
| 317 |
% |
| 318 |
As usual, options are separated by commas. From the set of possible |
| 319 |
option values, two ones are special: The \textsl{predefined value} and |
| 320 |
the \textsl{default value}. The predefined value is the one that's |
| 321 |
used when you don't specify the option at all. The default value is |
| 322 |
used of you don't specify the value in the option; e.g., |
| 323 |
% |
| 324 |
\begin{quote} |
| 325 |
|\documentclass[suppress]{cweb}| |
| 326 |
\end{quote} |
| 327 |
% |
| 328 |
selects the default value of the option |suppress|. (Not that there is |
| 329 |
one currently. :--) |
| 330 |
|
| 331 |
There is always a predefined value, a default value may not be there. |
| 332 |
If a default value exists, it is always different from the predefined |
| 333 |
one. The default value gives you an easy specification of an option |
| 334 |
value that is expected to be common. If that value would be the |
| 335 |
predefined one, you won't need to specify the option in the first |
| 336 |
hand. |
| 337 |
|
| 338 |
The following options are available and explained below: |
| 339 |
% |
| 340 |
\begin{options} |
| 341 |
\item[structure] Select the structure model used by the \cls{cweb} |
| 342 |
class. |
| 343 |
\item[suppress] Suppress output of different document parts. |
| 344 |
\item[baseclass] Select the base document class. |
| 345 |
\item[language] Select a language for inserted texts. |
| 346 |
\end{options} |
| 347 |
|
| 348 |
|
| 349 |
\sect \label{chunk:structure-option} |
| 350 |
|
| 351 |
We have two possibilities to output chunks and sections, either |
| 352 |
as a flat or as a hierarchic structure. This configuration is selected |
| 353 |
by the option |structure|, either through the value |flat| or |
| 354 |
|hierarchic|. |
| 355 |
% |
| 356 |
\begin{options} |
| 357 |
|
| 358 |
\item[flat] The flat structure is the ``classic'' approach, |
| 359 |
the way Plain \cweb{} renders its chunks. Then each chunk starts |
| 360 |
with its number. The chunk numbers are output in boldface, followed |
| 361 |
by a dot and a quad. |
| 362 |
|
| 363 |
Sections show chunk numbers as well (remember, they implicitly |
| 364 |
start a chunk). ``Important'' sections are added to the table of |
| 365 |
contents. |
| 366 |
|
| 367 |
\item[hierarchic] The hierarchic structure is the |
| 368 |
``modernistic'' (aka \LaTeX{}) approach, then we mark the start of a |
| 369 |
chunk by a start sign. (By default, that's a paragraph sign, `\P'). |
| 370 |
Chunk numbers are rendered in the margin of the program part. If |
| 371 |
there's no program part, no chunk number will be rendered---after |
| 372 |
all, they are only used for identification of program parts. |
| 373 |
|
| 374 |
Section numbers are hierarchic, like in other \LaTeX{} document |
| 375 |
classes. |
| 376 |
|
| 377 |
\end{options} |
| 378 |
% |
| 379 |
The predefined value of |structure| is |hierarchic|. There doesn't |
| 380 |
exist a default value. |
| 381 |
|
| 382 |
|
| 383 |
\sect The option |suppress| allows to select suppression of different |
| 384 |
document parts. You have different parts you can suppress. The value |
| 385 |
of the |suppress| option is a comma-separated list of identifiers, |
| 386 |
enclosed in braces. If you have only one thing you want to suppress, |
| 387 |
you don't need to surround that identifier by braces. Possible |
| 388 |
identifiers are: |
| 389 |
|
| 390 |
\begin{options} |
| 391 |
|
| 392 |
\item[changehints] suppress output of hints that a changefile was |
| 393 |
used: The change flag (by default a star at the start of a chunk) |
| 394 |
and the list of changed chunks at the end of the document. |
| 395 |
|
| 396 |
\item[unchanged] suppress output of chunks that are not changed by |
| 397 |
a changefile. This value implies |changehints|---by definition all |
| 398 |
printed chunks are changed, it doesn't make any sense to hint to |
| 399 |
that fact in addition. |
| 400 |
|
| 401 |
\item[index] suppress the identifier index. |
| 402 |
|
| 403 |
\item[reflist] suppress the refinement list. |
| 404 |
|
| 405 |
\item[format] suppress output of `|@f|' directives. |
| 406 |
|
| 407 |
\end{options} |
| 408 |
|
| 409 |
The predefined value is the empty list, i.e., nothing is suppressed. |
| 410 |
There is no default value since I don't know which parts are |
| 411 |
suppressed most often. Send email with your demands, I'll add a |
| 412 |
default if I see that there is one major application of this option. |
| 413 |
|
| 414 |
|
| 415 |
\sect \label{chunk:baseclass} The option |baseclass| allows to select |
| 416 |
the base document class used by the \cls{cweb} class. In particular, |
| 417 |
if the base class has |\chapter| defined the layout of major section |
| 418 |
divisions (`|@**|' and `\verb*|@* |') will be changed to be in a |
| 419 |
chapter layout. |
| 420 |
|
| 421 |
The predefined value is |article|, the default value is |report|. |
| 422 |
|
| 423 |
|
| 424 |
\sect The option |language| allows to adapt inserted texts to |
| 425 |
different languages. E.g., with the option `|language=german|' German |
| 426 |
texts are inserted for cross references, headings, etc. That option |
| 427 |
will neither switch on language-specific hyphenation, nor will it |
| 428 |
trigger any other processing -- that's the task of Babel or any other |
| 429 |
\LaTeX{} language style. |
| 430 |
|
| 431 |
There is neither a predefined nor a default value. (Without the |
| 432 |
|language| option, inserted texts are in English.) |
| 433 |
|
| 434 |
That option actually triggers the usage of a package |
| 435 |
\pkg{cwbl-\textit{language}}. To see if a language is supported, you |
| 436 |
have to look for respective files in the \LaTeX{} \cweb{} macro |
| 437 |
directory.% |
| 438 |
\footnote{That's |texmf/tex/latex/cweb|, on a TDS compliant |
| 439 |
installation. Please beware that pseudo operating systems like DOS |
| 440 |
cripple file names and shorten them to eight characters; if you |
| 441 |
see a file |cwbl-ger.sty| you'll know that the option value |
| 442 |
|german| is supported.} |
| 443 |
Of course, the easiest way to check the availability is to try it |
| 444 |
out -- you'll get a comprehensible error message if there is no |
| 445 |
respective \cweb{} language package. In November 1995, |german|, |
| 446 |
|french|, and |italian| were supported, more might have been added |
| 447 |
later. |
| 448 |
|
| 449 |
\smallskip |
| 450 |
|
| 451 |
For compatibility with Babel, some other options (e.g., |german| or |
| 452 |
|french|) are also supported as nicknames for |
| 453 |
|language=|\textit{option}. If you use packages that make also use of |
| 454 |
these options (e.g., \pkg{babel} or \pkg{varioref}), you'll probably |
| 455 |
prefer them over |language| since they are picked up by those packages |
| 456 |
as well. |
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
\chap Restrictions. |
| 463 |
|
| 464 |
The following restrictions will not be withdrawn as far as I can |
| 465 |
see---except if somebody will send me a patch with changes. I tried to |
| 466 |
sort the restrictions in order of severity. |
| 467 |
|
| 468 |
|
| 469 |
\sect \emph{(Restrictions due to the design of \cweave{}.)} |
| 470 |
|
| 471 |
Please be aware that the vertical bar (`\verb"|"') is used by \cweb{} |
| 472 |
to delimit small C code pieces in the documentation parts, and is |
| 473 |
therefore processed (and mangled) by \cweave{}. \emph{You cannot use |
| 474 |
it for \TeX{} any more.} |
| 475 |
|
| 476 |
In particular, you cannot specify rules for the |tabular| or the |
| 477 |
|array| environment. Since you most certainly want to do so: You have |
| 478 |
two choices left: |
| 479 |
% |
| 480 |
\begin{enumerate} |
| 481 |
|
| 482 |
\item Make sure you have the \pkg{array} package (by Frank Mittelbach and |
| 483 |
David Carlisle, from the Tools bundle) installed. Then you may use |
| 484 |
the package \pkg{cwebarray}, it defines `|I|' (that's an uppercase~`i') |
| 485 |
as a specifier for rules. I.e., instead of |
| 486 |
\verb"\begin{tabular}{l|l}" you have to write |
| 487 |
|\begin{tabular}{lIl}|. Not the most elegant solution, but it |
| 488 |
works\,\dots |
| 489 |
|
| 490 |
\item |
| 491 |
Use `|^^7c|' instead of `\verb"|"'. I.e., instead of |
| 492 |
\verb"\begin{tabular}{l|l}" you may write |\begin{tabular}{l^^7cl}|. |
| 493 |
|
| 494 |
\end{enumerate} |
| 495 |
% |
| 496 |
These two choices are compatible, you may use both in one document. |
| 497 |
Needless to say, I consider the first alternative the better one. |
| 498 |
|
| 499 |
|
| 500 |
\sect Neither a refinement name nor an index entry made by~|@^| may |
| 501 |
consist of a \emph{single} dot-accented term. I.e., you must not |
| 502 |
write `|@<\.O@>|', `|@^\.o@>|', or even `|@^\.{foolish}@>|'. Of |
| 503 |
course you may write `|@^\.o, accent@>|' or `|@< Handle accent \.o @>|'. |
| 504 |
|
| 505 |
|
| 506 |
\sect \emph{(Restriction due to the implementation of \LaTeX{}.)} |
| 507 |
|
| 508 |
One cannot use restricted C mode in moving arguments. Most notably, |
| 509 |
this is disturbing in the section titles and in |\caption| |
| 510 |
tags. Sorry, folks. |
| 511 |
|
| 512 |
(Basically, that's because the definition of |\addcontentsline|, etc., |
| 513 |
in the \LaTeX{} kernel is brain damaged; it wants to expand its |
| 514 |
argument. And I don't want to maintain redefinitions of such basic |
| 515 |
macros.) |
| 516 |
|
| 517 |
|
| 518 |
\sect \emph{(Restrictions due to \TeX{}.)} |
| 519 |
|
| 520 |
\C++ comments (i.e., from |//| to the end of the line) are typeset as C |
| 521 |
comments. This is especially bad if they are used for a whole block of |
| 522 |
comment lines, as it is quite common. Please put such comment blocks |
| 523 |
in the documentation part. (An |\everyline| implementation would be |
| 524 |
needed to lift that restriction, and that's impossible in general.) |
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
\chap Details. |
| 530 |
|
| 531 |
The following tags are reserved and must neither be used nor redefined: |
| 532 |
|\ATL|, |
| 533 |
|\B|, |
| 534 |
|\M|, |
| 535 |
|\N|, |
| 536 |
|\PB|, |
| 537 |
and~|\Y|. |
| 538 |
|
| 539 |
|\9| is already explained in the \cweb{} user manual: It's a special |
| 540 |
control sequence used for the index entries tagged with~`|@:|'. Its |
| 541 |
default definition is setup in such a way that you can cheat |
| 542 |
\cweave{} concerning the sort order of this entry: If you enter |
| 543 |
`|@:sort}{print@>|' you will get an index entry ``print'' next to the |
| 544 |
place where the index entry ``sort'' would be. But you're allowed to |
| 545 |
change this default definition.% |
| 546 |
\footnote{Remember: A package is a very good place to place such |
| 547 |
redefinitions; your document should be concerned with contents, not |
| 548 |
with appearance.} |
| 549 |
|
| 550 |
The names of all other control sequences defined by this |
| 551 |
class---besides the common \LaTeX{} control sequences---start with |
| 552 |
|cweb|, |Cweb|, or |cwbb|. Please don't define new control sequences starting |
| 553 |
with this prefix. (The control sequences starting with |Cweb| may be |
| 554 |
redefined in a package to change the appearance of the \cweb{} |
| 555 |
document or the behavior in a controlled manner, check the |
| 556 |
description of the internal interface for this possibility.) |
| 557 |
|
| 558 |
|
| 559 |
\sect Plain \cweb{} users |
| 560 |
should note that the macros from |cwebmac.tex| are not available any |
| 561 |
more. E.g., you cannot use |\.| to typeset typewriter material; use |
| 562 |
either |\texttt| or~|\verb|, as it fits the situation. On the other hand, |
| 563 |
now you're able to use |\.| for the dot accent, you can define |\3| |
| 564 |
for the `sharp~s', |\C++| for the \C++ logo,% |
| 565 |
\footnote{I will not define any such logos in this class. A |
| 566 |
package like \pkg{logos} with lots of name definitions is the |
| 567 |
appropriate place for this.} |
| 568 |
etc. |
| 569 |
|
| 570 |
Another detail for ex-plainies: The table of contents is produced by |
| 571 |
the |\tableofcontents| tag (during the second \LaTeX{} run), not |
| 572 |
automatically. But this is the standard \LaTeX{} behavior. |
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
\chap Known Problems. |
| 578 |
\label{sec:problems} |
| 579 |
|
| 580 |
There is a bunch of known bugs, problems, and ommisions. |
| 581 |
|
| 582 |
\bigbreak |
| 583 |
|
| 584 |
\noindent \textit{Bugs:} |
| 585 |
% |
| 586 |
\begin{itemize} |
| 587 |
|
| 588 |
\item The presentation of |@l| redefinitions is not proper. But it |
| 589 |
wasn't in Plain \cweb{}, either. |
| 590 |
|
| 591 |
\end{itemize} |
| 592 |
|
| 593 |
\noindent \textit{Problems:} |
| 594 |
% |
| 595 |
\begin{itemize} |
| 596 |
|
| 597 |
\item You can't use |\index| and |\makeindex| as-is to create an |
| 598 |
index. Add your entries instead to \cweave{}'s index using `|@^|', |
| 599 |
`|@.|', or `|@:|'. That problem is caused by a clash in the usage of |
| 600 |
the filename extension |idx| by \cweave{} and \LaTeX{}. The |
| 601 |
\pkg{index} package by \textsc{David Jones} will help you to define |
| 602 |
additional index categories (that use an other extension) if you |
| 603 |
don't want to mix identifiers and your other index entries. |
| 604 |
|
| 605 |
\end{itemize} |
| 606 |
|
| 607 |
\noindent \textit{Ommisions} (``wouldn't it be nice, if''s): |
| 608 |
% |
| 609 |
\begin{itemize} |
| 610 |
|
| 611 |
\item The current chunk number and most section titles (below rank 1 |
| 612 |
or~2, depending on the base class) are not available as a mark for |
| 613 |
inclusion in a running head. |
| 614 |
|
| 615 |
\item Better integration of \pkg{rcs} package. That package is used to |
| 616 |
support including information from the revision management system |
| 617 |
RCS into the document. E.g., the revision log at the end of that |
| 618 |
document was produced by that package. |
| 619 |
|
| 620 |
\end{itemize} |
| 621 |
|
| 622 |
|
| 623 |
\sect I would like to thank those who helped me to improve this bundle. |
| 624 |
% In particular, XXX provided XXXsubstantial parts of the code. |
| 625 |
|
| 626 |
\textsc{Michael M\"uller} and \textsc{Zden\v{e}k Wagner} did thorough |
| 627 |
checks that helped me to improve the alpha test version. |
| 628 |
|
| 629 |
\textsc{Christian Kumpf} triggered the addition of language support |
| 630 |
and pointed out where configuration could be made easier by supplying |
| 631 |
more macros in the protected interface. \textsc{Andreas Scherer} |
| 632 |
provided packages for French and Italian \cweb{} documents. |
| 633 |
|
| 634 |
\textsc{Laurent Desnogues}, |
| 635 |
\textsc{Felix G\"artner}, |
| 636 |
and |
| 637 |
\textsc{John S. Robinson} |
| 638 |
provided error and problem reports. |
| 639 |
\textsc{Bronne Louis} pointed out the embarrassing error that section |
| 640 |
numbers were not reset when a higher-level section began. |
| 641 |
|
| 642 |
|
| 643 |
|
| 644 |
\endSubDocument |
| 645 |
|
| 646 |
|
| 647 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 648 |
|
| 649 |
\newpage |
| 650 |
|
| 651 |
\begin{rcslog} |
| 652 |
$DocLog: cweb-user.tex,v $ |
| 653 |
\Revision 2.10 1995/11/20 22:34:16 schrod |
| 654 |
Add language support.\\ |
| 655 |
Triggered by Christian Kumpf \path|<[email protected]>| and Andreas |
| 656 |
Scherer \path|<[email protected]>|. |
| 657 |
|
| 658 |
Use my `official' (ACM) email address. |
| 659 |
|
| 660 |
\Revision 2.9 1995/11/20 10:39:34 schrod |
| 661 |
Explicate that one must not use |\section| etc., that one cannot |
| 662 |
\LaTeX{} the \cweb{} program directly but must run \cweave{} first, |
| 663 |
and that the \cls{cweb} class does not provide inclusion of \cweb{} |
| 664 |
programs in other \LaTeX{} documents.\\ |
| 665 |
Clarification triggered by Laurent Desnogues |
| 666 |
\path|<[email protected]>|. |
| 667 |
|
| 668 |
\Revision 2.8 1995/09/15 10:22:58 schrod |
| 669 |
The \cls{cweb} class needs at least \LaTeX{} version |
| 670 |
\mbox{$\langle$1994/12/01$\rangle$}.\\ |
| 671 |
Problem reported by John S. Robinson \path|[email protected]|. |
| 672 |
|
| 673 |
\Revision 2.7 1995/09/12 22:58:38 schrod |
| 674 |
|cwbb| is also a reserved namespace. |
| 675 |
|
| 676 |
Added acknowledgements. |
| 677 |
|
| 678 |
\Revision 2.6 1995/08/29 17:34:14 schrod |
| 679 |
\LaTeX{} \cweb{}, version 1.0. |
| 680 |
|
| 681 |
\Revision 2.5 1995/08/29 02:07:28 schrod |
| 682 |
Discard dependencies on 10\,pt fonts. |
| 683 |
|
| 684 |
Support suppression of format directives. |
| 685 |
|
| 686 |
\Revision 2.4 1995/08/27 19:31:11 schrod |
| 687 |
Suppression of index and reference list is supported. |
| 688 |
|
| 689 |
Discard documentation on |\cwebSecNoEject|, that's part of the |
| 690 |
protected interface. |
| 691 |
|
| 692 |
\Revision 2.3 1995/08/27 17:24:45 schrod |
| 693 |
Make usage of baseclass with chapters work. |
| 694 |
|
| 695 |
\Revision 2.2 1995/08/27 13:25:59 schrod |
| 696 |
Add possibility to suppress change hints. Suppression of unchanged |
| 697 |
chunks suppress change hints as well, they are meaningless as all |
| 698 |
printed chunks are changed by definition. |
| 699 |
|
| 700 |
Update problems section, they were partly resolved by the current |
| 701 |
changes. Added hint to \pkg{index} package that resolves the problem |
| 702 |
of extensions clashes with \MakeIndex{}. |
| 703 |
|
| 704 |
\Revision 2.1 1995/08/25 19:11:17 schrod |
| 705 |
Add keyword-value option style, with new \pkg{keyvald} package. |
| 706 |
|
| 707 |
Hierarchic strucutures are supported now, in addition to the flat |
| 708 |
structure of the beta-test version. One can choose with an option. For |
| 709 |
that step, the terminology was cleaned up, too: Chunks are not named |
| 710 |
sections any more. (That change involved reimplementation of almost |
| 711 |
all the structure and toc stuff.) |
| 712 |
|
| 713 |
The chunk number supplied by \cweave{} is used now, not some computed |
| 714 |
number. Change flags are printed, too. |
| 715 |
|
| 716 |
One can suppress output of unchanged sections. |
| 717 |
|
| 718 |
One can select the baseclass with an option. That may be used to use |
| 719 |
\cls{report} or \cls{book} to get chapter-style layout. Of course, |
| 720 |
using an arbitrary baseclass is dangerous, it must conform to the |
| 721 |
conventions of \LaTeX{} standard classes. |
| 722 |
|
| 723 |
\Revision 1.10 1995/08/08 00:14:28 schrod |
| 724 |
Updated to \LaTeXe{}, the |cweb| style is now a document class. Used |
| 725 |
my standard templates for that, no changes in functionality. |
| 726 |
|
| 727 |
\Revision 1.9 1993/08/10 14:15:40 schrod |
| 728 |
New page on main section only if group level $<$ |\cwebSecNoEject|. |
| 729 |
Default for the latter is 3. |
| 730 |
|
| 731 |
Document that logos will not be defined in this style file. |
| 732 |
|
| 733 |
Copy of plain macros for |\CwebNumber| does not work. Repaired the |
| 734 |
most important one (subscript must be accessed via |\sb|). |
| 735 |
Incompatibility to NFSS will be addressed later.\\ |
| 736 |
(Problems reported by Zden\v{e}k Wagner \path|<[email protected]>|.) |
| 737 |
|
| 738 |
\Revision 1.8 1993/08/10 11:21:03 schrod |
| 739 |
Reference to section number does not render a period after the |
| 740 |
number any more. |
| 741 |
|
| 742 |
\Revision 1.7 1993/08/09 18:05:54 schrod |
| 743 |
Mentioned that `\verb"|"' cannot be used for LaTeX purposes, in |
| 744 |
particular, not for ruled tables. Described workarounds, one of them |
| 745 |
is the new style option |cwebarray|.\\ |
| 746 |
(Problem reported by Felix G\"artner |
| 747 |
\path|<[email protected]>|.) |
| 748 |
|
| 749 |
\Revision 1.6 1993/06/17 16:10:06 schrod |
| 750 |
`|cweb|' was still an option in the example. |
| 751 |
|
| 752 |
\Revision 1.5 1993/06/17 15:09:30 schrod |
| 753 |
\cweb{} 3.0 was released officially on June 16, 1993. Mentioned in |
| 754 |
the documentation that this version is needed for the |cweb| style. |
| 755 |
|
| 756 |
\Revision 1.4 1993/06/15 15:19:11 schrod |
| 757 |
It's a style now, was an option formerly. |
| 758 |
|
| 759 |
\Revision 1.3 1993/06/14 15:40:42 schrod |
| 760 |
Added section about restrictions (no restricted C mode material |
| 761 |
in moving arguments, no single dot-accented term in an index entry). |
| 762 |
|
| 763 |
\Revision 1.2 1993/05/12 20:23:32 schrod |
| 764 |
Adapted to recent changes of \cweave{} (of April 93): Main sections |
| 765 |
have a group level, represented in the table of contents. |
| 766 |
|
| 767 |
Boxed the example, it was not legible formerly. |
| 768 |
|
| 769 |
\Revision 1.1 1993/04/09 15:00:37 schrod |
| 770 |
Initial revision |
| 771 |
|
| 772 |
\end{rcslog} |
| 773 |
|
| 774 |
|
| 775 |
|
| 776 |
\end{document} |
| 777 |
|
| 778 |
% LocalWords: baseclass DFS PSPACE graphicx changehints changefile reflist idx |
| 779 |
% LocalWords: cwebarray cwebmac plainies ommisions if''s rcs cwbb uller Zden |