From c5199a08bb8edc16006e6a5fc72cc704d7eae776 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Oct 2007 23:29:14 +0000 Subject: new (to TL) cweb-latex package (4feb07) git-svn-id: svn://tug.org/texlive/trunk@5271 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/cweb-latex/src/Imakefile | 106 + Master/texmf-dist/doc/latex/cweb-latex/src/README | 31 + Master/texmf-dist/doc/latex/cweb-latex/src/TODO | 168 ++ .../doc/latex/cweb-latex/src/cwbl-german.sty | 109 ++ .../doc/latex/cweb-latex/src/cweave-spec.tex | 403 ++++ .../doc/latex/cweb-latex/src/cweb-conf.tex | 103 + .../doc/latex/cweb-latex/src/cweb-doc.sty | 133 ++ .../doc/latex/cweb-latex/src/cweb-fsa.fig | 78 + .../doc/latex/cweb-latex/src/cweb-fsa.latex | 62 + .../doc/latex/cweb-latex/src/cweb-fsa.ltx | 29 + .../doc/latex/cweb-latex/src/cweb-user.tex | 779 ++++++++ .../texmf-dist/doc/latex/cweb-latex/src/cweb.doc | 1396 +++++++++++++ .../doc/latex/cweb-latex/src/cwebarray.sty | 50 + .../doc/latex/cweb-latex/src/cwebbase.doc | 2059 ++++++++++++++++++++ .../doc/latex/cweb-latex/src/cwebparts.doc | 452 +++++ .../texmf-dist/doc/latex/cweb-latex/src/cwebx.sty | 406 ++++ .../doc/latex/cweb-latex/src/keyvald.dtx | 347 ++++ .../doc/latex/cweb-latex/src/keyvald.ins | 6 + .../doc/latex/cweb-latex/src/style/cweb-doc.el | 22 + .../doc/latex/cweb-latex/src/test/Imakefile | 142 ++ .../doc/latex/cweb-latex/src/test/badend.w | 21 + .../doc/latex/cweb-latex/src/test/badopts.w | 13 + .../doc/latex/cweb-latex/src/test/change.ch | 5 + .../doc/latex/cweb-latex/src/test/change.w | 20 + .../doc/latex/cweb-latex/src/test/enddocbegin.w | 16 + .../doc/latex/cweb-latex/src/test/flat.w | 47 + .../doc/latex/cweb-latex/src/test/german.w | 33 + .../latex/cweb-latex/src/test/language-german.ch | 5 + .../latex/cweb-latex/src/test/language-german.w | 31 + .../doc/latex/cweb-latex/src/test/minimal.w | 12 + .../doc/latex/cweb-latex/src/test/modes.w | 16 + .../doc/latex/cweb-latex/src/test/newif.w | 39 + .../doc/latex/cweb-latex/src/test/nolists.w | 16 + .../doc/latex/cweb-latex/src/test/parts-code.w | 32 + .../doc/latex/cweb-latex/src/test/parts.tex | 47 + .../doc/latex/cweb-latex/src/test/refname.w | 21 + .../doc/latex/cweb-latex/src/test/report.w | 48 + .../doc/latex/cweb-latex/src/test/section.w | 55 + .../doc/latex/cweb-latex/src/test/sup-changes.w | 20 + .../doc/latex/cweb-latex/src/test/sup-format.w | 17 + .../doc/latex/cweb-latex/src/test/sup-lists.w | 16 + .../doc/latex/cweb-latex/src/test/titlepage.w | 19 + .../doc/latex/cweb-latex/src/test/token.w | 29 + .../doc/latex/cweb-latex/src/test/vbar.w | 30 + 44 files changed, 7489 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/Imakefile create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/README create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/TODO create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cwbl-german.sty create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweave-spec.tex create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-conf.tex create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-doc.sty create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.fig create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.latex create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.ltx create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb-user.tex create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cweb.doc create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cwebarray.sty create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cwebbase.doc create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cwebparts.doc create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/cwebx.sty create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/keyvald.dtx create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/keyvald.ins create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/style/cweb-doc.el create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/Imakefile create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/badend.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/badopts.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/change.ch create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/change.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/enddocbegin.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/flat.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/german.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/language-german.ch create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/language-german.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/minimal.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/modes.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/newif.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/nolists.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/parts-code.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/parts.tex create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/refname.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/report.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/section.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/sup-changes.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/sup-format.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/sup-lists.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/titlepage.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/token.w create mode 100644 Master/texmf-dist/doc/latex/cweb-latex/src/test/vbar.w (limited to 'Master/texmf-dist/doc/latex/cweb-latex/src') diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/Imakefile b/Master/texmf-dist/doc/latex/cweb-latex/src/Imakefile new file mode 100644 index 00000000000..64bd313b8f5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/Imakefile @@ -0,0 +1,106 @@ +XCOMM $Id: Imakefile,v 1.7 1995/11/21 00:41:31 schrod Exp $ +/* ---------------------------------------------------------------------- */ + +/* + * Imakefile for cweb bundle + * + * (history at end) + */ + + +/* needed modules */ +#include +#include + +#include + +XCOMM ------------------------------------------------------------ +XCOMM continue in Imakefile + + +/* exported files */ + +MpDoc2TeXTarget(cwebbase,tex) +MpDoc2TeXTarget(cweb,cls) +MpDoc2TeXTarget(cwebparts,sty) + +TeXTarget(latex,cweb-user) +TeXTarget(latex,cweb-conf) + + +/* for some time, until it's moved to an own bundle */ + +AllTarget(keyvald.sty) + +keyvald.sty: keyvald.dtx + latex keyvald.ins + +clean:: + $(RM) keyvald.sty + + +/* installation */ + +#ifdef ITI_Site + DESTDIR = /archives/tex/Install +#endif + +InstallTeXLaTeX(cweb,cweb.cls cwebbase.tex cwebarray.sty keyvald.sty \ + cwebparts.sty cwbl-german.sty) +InstallTeXDoc(latex/styles/cweb,cweb-user.dvi) +InstallTeXDoc(latex/styles/cweb,cweb-conf.dvi) + + +/* internal documentation */ + +TeXFileTarget(latex,cweb,doc) +TeXFileTarget(latex,cwebbase,doc) +TeXFileTarget(latex,cwebparts,doc) +TeXTarget(latex,cweave-spec) + + +/* distribution */ + +distrib:: all cweb.dvi cwebbase.dvi cwebparts.dvi + mv cweb-*.dvi *.cls cwebbase.tex keyvald.sty .. + cp cwebarray.sty cwbl-german.sty .. + cp $(HOME)/Notes/README.latex.doc-src README + $(MAKE) realclean + +realclean:: clean + $(RM) Makefile + + + +/* ============================================================ + * + * $Log: Imakefile,v $ + * Revision 1.7 1995/11/21 00:41:31 schrod + * German language package. + * + * Revision 1.6 1995/09/17 14:21:25 schrod + * Add support for German CWEB documents. + * + * Revision 1.5 1995/09/16 17:00:18 schrod + * Extract cwebbase.tex from cweb.cls, add cwebparts.sty. + * + * Revision 1.4 1995/08/29 17:34:39 schrod + * LaTeX CWEB, version 1.0. + * + * Revision 1.3 1995/08/29 15:19:47 schrod + * Added (hint to non-existence of) description of the internal interface. + * + * Revision 1.2 1995/08/25 19:00:32 schrod + * Add enhanced version of keyval package, with ability to specify + * default action for unknown keyword options. + * + * Revision 1.1 1995/08/08 00:14:24 schrod + * Updated to \LaTeXe{}, the |cweb| style is now a document class. Used + * my standard templates for that, no changes in functionality. + * + + * ------------------------------------------------------------ + * Local Variables: + * mode: Indented-Text + * End: + */ diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/README b/Master/texmf-dist/doc/latex/cweb-latex/src/README new file mode 100644 index 00000000000..0e7a4836715 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/README @@ -0,0 +1,31 @@ +latex-style:src/README 29 Aug 95 +---------------------------------------------------------------------- + +Please note: This directory is part of the distribution primarily for your +information. It's not prepared to be usable by you, sorry. + +In particular, probably you won't have tools and style files I take +for granted during development. Please don't complain, either use the +supplied installable files (as listed in ../MANIFEST) or search & get +the missing files. I will neither stop adding this directory to the +distribution, nor will I add all missing files. + +On the one hand I won't restrict my own development environment by not +using available tools, on the other hand I'll want to make my source +available for those who have a similar environment to mine. + + +For your orientation: + + *.doc -- master file for TeX macro files + *.dvi -- typeset version of *.doc + *-user.tex -- user manual + *-conf.tex -- (optional) internal interface description + *.tex -- (optional) other documentation parts + *.{fig,latex} -- (optional) figures prepared with xfig + *.sty -- needed to process the above documents + + TODO -- (optional) personal notes for future revisions + Imakefile -- does not use MIT's Imake templates + style/ -- (optional) files for AUC-TeX + test/ -- test cases diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/TODO b/Master/texmf-dist/doc/latex/cweb-latex/src/TODO new file mode 100644 index 00000000000..82fddd2ee5c --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/TODO @@ -0,0 +1,168 @@ +% $Id: TODO,v 1.10 1995/11/30 15:44:51 schrod Exp $ +%---------------------------------------------------------------------- + + +---------------------------------------------------------------------- + +functionality [problem] + +In plain CWEB chunks are not split over pages, LaTeX CWEB does so. Add +an option that re-establishs the behaviour of plain CWEB. + +Problem reported by Denis B. R\"ogel + +---------------------------------------------------------------------- + +functionality [problem] + +User index would use with standard LaTeX markup (\index) would use +*.idx as raw index file. This file is used by CWEAVE as tagged index +file. + +Shall I redefine \makeindex? + +---------------------------------------------------------------------- + +functionality [proposal] + +Add support to create the illusion of more than one refinement in a +chunk. + +\cwebNoChunkIntro; see cwebx.sty. +Proposed by Christopher Higgins . +Ack him for that. + +---------------------------------------------------------------------- + +functionality [proposal] + +Add support for CWEB code examples. + +For that code from cwebparts.doc must be moved to cwebbase.doc; see +cwebx.sty. That code has also several improvements over cwebparts.doc! +cwebparts.doc is needed later for typesetting sections, etc. Well, if +that can really be realized in a document/project independent way. +Don't know if I really need it. (Except as a user front end. But I +can also use cwebbase for that.) + +---------------------------------------------------------------------- + +functionality [proposal] + +Add support for HyperTeX. + +Proposed by Christopher Higgins . + +---------------------------------------------------------------------- + +list headers [error] + +Use \chaptermark & \sectionmark, in \CwebListSection. + +Maybe discard \@mkboth from \CwebIdIndex, \CwebRefList, etc. It's +supposed to be changed by a pagestyle, but this doesn't happen with +fancyheadings anyhow -- and face it, fancyheadings is the method of +choice for head-/footline creation. + +The actual code was caused by stupid copying from LaTeX standard +classes; with the change it's possible to have other list heading +layout (add to toc, other marks, etc.) + +But check if I can use that in \CwebIdIndex: There \CwebListSection is +used in an \twocolumn optional arg, that will eventually trigger the +output routine and will be set as a float. Does marks correctly +migrate out of floats? + +---------------------------------------------------------------------- + +layout [error] + +In chunks without documentation, a refinement is too near to the chunk +marker. In addition, the distance is not independent of +\CwebIndentUnit, making it impossible to change the latter. + +NOTE: Might be a problem of \cwebNoChunk that should start a +paragraph. *When* will CWEAVE add `\4' after `\B'? Have to make tests +for that. How can I detect an empty documentation section? + +\B kind of repaired in cwebx.sty. + +---------------------------------------------------------------------- + +layout [error] + +Chunk numbers are not exactly aligned in all circumstances, see fixme +remark in cwebbase.doc. + +---------------------------------------------------------------------- + +interface [idea] + +Name all \cwbb@... macros used in other modules \Cwbb... (or even +\cwbb...). + +---------------------------------------------------------------------- + +markup [proposal] + +Support delimiting section titles by braces. + +Maybe one needs an option to turn that on. + +Supported by Peter Wainwright . + +---------------------------------------------------------------------- + +documentation [ack] + +Who sent the mail concerning \hb@xt@? Add to acks. Change log message +for it, too (cweb.doc: 3.4; cwebbase.doc: 1.4). + +---------------------------------------------------------------------- + +documentation [problem] + +cweb-conf.tex: + +Cseq name of chunk marker (paragraph symbol). +Ack Christopher Higgins \path||. + +\CwebRankNoEject. (Implies explication of rank numbers. Should be +explicated in cwebbase.doc as well, btw.) +Ack Nicholas Urbanik \path|| + +Support for another language must be stored in cwbl-*.sty. Check +cwbl-german.sty for the cseqs that must be redefined, list their +original English text for clarification. + +---------------------------------------------------------------------- + +distribution [problem] + +cweb.cls & cwebbase.tex is > 100KB now. Export it in uncommented form. + +---------------------------------------------------------------------- + +distribution [problem] + +It's better to collect stuff from contrib, and have each file that +shall be installed in top dir. + +This means a Makefile in contrib/; and changes in README, INSTALL, and +maybe even MANIFEST. + +---------------------------------------------------------------------- + +distribution [proposal] + +Add hint to TODO in README. Maybe point out that src/ sometimes holds +prereleases of future styles. + +---------------------------------------------------------------------- + +distribution [proposal] + +Install TODO in doc dir. The end user should see open problems and +plans, too. + +---------------------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cwbl-german.sty b/Master/texmf-dist/doc/latex/cweb-latex/src/cwbl-german.sty new file mode 100644 index 00000000000..68a7ce6c054 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cwbl-german.sty @@ -0,0 +1,109 @@ +% $Id: cwbl-german.sty,v 1.1 1995/09/17 14:21:25 schrod Exp $ +%---------------------------------------------------------------------- + +% +% LaTeX2e package cwbl-german +% adapt CWEB documents to language `german' +% +% [LaTeX2e] +% (history at end) + + +% Identification. The code below is explained in the implementation +% documentation of the rcs package. + +\begingroup + \def\RCSPackage#1#2 $#3: #4 #5\endRCS $#6: #7 #8\endRCS{% + \def\date{#4}\def\id{v#7}% + \ProvidesPackage{#1}[\date\space\id\space #2]% + } + + \RCSPackage{cwbl-german}{German CWEB documents} + $Date: 1995/09/17 14:21:25 $: 9999/00/00 \endRCS + $Revision: 1.1 $: 0.0 \endRCS +\endgroup + + +% +% What's this package for? +% +% XXX +% + + +% This class is supported. Send bug reports, comments and repairs. +% +% The reference version may be retrieved via anonymous ftp from +% |ftp.th-darmstadt.de| [130.83.47.112], directory |pub/tex/latex|. It's +% placed there as a gzipped tar file. (The information on the +% IP~number is dated 17 Sep 95. It might have changed, also +% this is very unlikely. Use your friendly nameserver.) + + +%%% ------------------------------------------------------------ + + +% at the end of chunks + +\def\CwebCRAlso{\CwebCrossRef{Siehe auch Baustein}} +\def\CwebCRsAlso{\CwebCrossRef{Siehe auch Bausteine}} + +\def\CwebCRCite{\CwebCrossRef{Dies wird zitiert im Baustein}} +\def\CwebCRsCite{\CwebCrossRef{Dies wird zitiert in den Bausteinen}} + +\def\CwebCRUse{\CwebCrossRef{Dies wird benutzt im Baustein}} +\def\CwebCRsUse{\CwebCrossRef{Dies wird benutzt in den Bausteinen}} + +\def\CwebCREt{ und~} +\def\CwebCRsEt{ und~} + + +% back matter + +\def\CwebCRChanged{% + \CwebCrossRef{% + Die folgenden Bausteine wurden durch ein Changefile ge\"andert:% + }% + } +\def\CwebChangedListName{Ge\"anderte Bausteine} + + +\def\CwebRefListName{Verzeichnis der Verfeinerungen} + +\def\CwebXRCite{\CwebCrossRef{Zitiert im Baustein}} +\def\CwebXRCites{\CwebCrossRef{Zitiert in den Bausteinen}} +\def\CwebXRUse{\CwebCrossRef{Benutzt im Baustein}} +\def\CwebXRUses{\CwebCrossRef{Benutzt in den Bausteinen}} + + +\def\CwebMacrosHere{% + \begingroup + \def\CwebRefNumber##1{}% + \CwebRefName :Pr\"aprozessor Definitionen\X + \endgroup + } + + + +\endinput + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% $Log: cwbl-german.sty,v $ +% Revision 1.1 1995/09/17 14:21:25 schrod +% Add support for German CWEB documents. +% + + + +%%%------------------------------------------------------------ + +% Local Variables: +% mode: LaTeX +% TeX-brace-indent-level: 4 +% TeX-parse-self: nil +% TeX-auto-save: nil +% TeX-master: t +% page-delimiter: "^%%%" +% End: diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweave-spec.tex b/Master/texmf-dist/doc/latex/cweb-latex/src/cweave-spec.tex new file mode 100644 index 00000000000..c1f5b4f07ff --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweave-spec.tex @@ -0,0 +1,403 @@ +% $DocId: cweave-spec.tex,v 1.8 1995/09/12 22:56:02 schrod Exp $ +%------------------------------------------------------------ + +% +% specification of CWEAVE/TeX interface +% +% [LaTeX] +% (history at end) + + +% This file is either a subdocument of the style doc or a document on +% its own. In the former case it's a chapter, in the latter it's a +% ``normal'' LaTeX progltx document. +% If it's a subdocument, this file will be included after +% \begin{document}. We can detect this: \document redefines +% \documentclass to be \@twoclasseserror. Then we also have to define +% how this document is ended: Either by \endinput or by an additional +% revision log. +% Of course, this test works only if LaTeX 2e is used for processing. + +\expandafter\ifx \csname @twoclasseserror\endcsname \documentclass + + \let\endSubDocument=\endinput + + \chap The interface between \cweave{} and \TeX{}. + \label{sec:cweave-spec} + +\else + + \let\endSubDocument=\relax + + \documentclass{progltx} + + \usepackage{cweb-doc} % additional document-specific markup + \usepackage{a4-9} % Tschichold's A4 layout + + + \begin{document} + + \title{The Interface between \cweave{} and \TeX{}} + \author{Joachim Schrod% + \thanks{Email: \texttt{schrod@iti.informatik.th-darmstadt.de}}% + } + \RCSdate $DocDate: 1995/09/12 22:56:02 $ + + \maketitle + + \sect + +\fi + + + + +Here we present all tags output by \cweave{}% + \footnote{This information refers to \cweb{}~3.4. Differences to + other 3.x versions of \cweave{} are minor and can be ignored in + our context. See the revision log of the complete interface specs + document for more information.} +in an ordered fashion. First we look at those +tags which are part of the `protected interface,' i.e., they are +visible to a \cweb{} user, but he must not use them. Then we consider +the private tags, some are used in the documentation part, others +are needed to typeset program code, and there are a few tags for +typesetting special characters in strings. + + +\sect Some tags output by \cweave{} are part of the protected +interface even though they are not prefixed by |cweb|. We'll present +them in the order they'll arrive in the document instance. + +The following table specifies in the second column if this tag takes +arguments. If the entry is non-empty, it's either a number listing +just how many arguments are expected; then usual argument passing is +used. Or it displays the context required. + % +\begin{cseqtab} +|\ATL| & \verb*|#1 #2 | & \cweb{} operator: |@l| + && (how to output non-ASCII chars in \ctangle{}) + && \arg1 hex code of mapped character + && \arg2 string output by \ctangle{} +|\M| & 1 & \cweb{} structure tag: start of a chunk + && \arg1 chunk number +|\N| & |#1#2#3.| & \cweb{} structure tag: start of a section + && \arg1 section rank, $0 \le |#1| \le 10$ + && \arg2 chunk number + && \arg3 section title +|\PB| & 1 & restricted program mode material + && \arg1 program code +|\Y| & & between major pieces of a program part +|\B| & & start program material +|\fi| & & \cweb{} structure tag: end of a chunk +|\9| & 1 & index entry, user defined layout + && \arg1 text of index entry +\end{cseqtab} + +|\ATL| does only appear in front of the very first chunk. The +chunk number is an explicit \TeX{} number which might be followed +by a `changed flag' (see chunk~\ref{sec:text-tag.priv}). Note the +usage of |\fi|, ie, each chunk must open an according |\if|. |\PB| +might appear within its own argument (created by restricted program +mode material in a refinement name within restricted program mode). + +|\9| deserves a further explanation: It is expected, though not +defined, that it expands to an empty token list. The parameter will +be a sort key, actually; the real key to be typeset will appear +afterwards. So a \cweb{} user might index \TeX{} as +`|@:TeX}{\TeX@>|', the index will feature it in the ``T''~chunk, +not in the ``|\|''~chunk. + +With the exception of |\PB| the tags above will not appear in math mode. + + +\sect The following tags might appear to be public ones, but they +are, in fact, never used. That's because they will be placed after +the |\fi| which terminates the last chunk. Our problem is that we +have to produce the information which were produced by these tags in +the Plain macros. Namely the optional lists poses us the problems. We +must read behind the document end to gather the information which +lists to produce. + +%% This label is used in cweb.doc +\label{spec:sec:docend} + +We can depend on the following rules. + % +\begin{enumerate} + +\item If |\end| is found, there will be no other of these tags. + +\item |\ch| comes first, but is optional. + +\item |\inx\fin| come next, they are mandatory. + +\item |\con| is optional again; if it is found it's the very last +token to look at in this document. + +\end{enumerate} + % +\begin{fixme} + +Perhaps |\inx| should be defined as |\end{document}|, and both |\ch| +and |\inx| should be added to the protected interface. Then the user +may simply omit |\end{document}|. But we should take care of a +possible occurence anyhow. + +\end{fixme} + +Here are the tags mentioned in this chunk, and their respective +meaning in the Plain version: + % +\begin{cseqtab} +|\ch| & |#1.| & Note which chunks are changed + && \arg1 list of chunk numbers, like in |\U| and such. +|\inx| & & Create index +|\fin| & & Create the table of refinement names +|\con| & & Create the table of contents +|\end| & & output if index and all lists were suppressed +\end{cseqtab} + + + +\sect \label{sec:text-tag.priv} + Some tags appear only in special circumstances and may therefore be +considered as private tags. The largest part of them concern the tagging of +program code, we'll have a look at them later. First we present the +tags used in other areas. + +Lists of chunk numbers occurs on several places: At the chunk +start (where the list has actually only one element), within +refinement names, in the identifier index, and for cross reference +purposes. Cross references can be made at the end of a chunk, and +in the refinement name list at the very end. Everywhere where a +chunk number can occur it can be followed by a tag which shows that +this chunk was changed by the changefile. + % +\begin{cseqtab} +|\*| & & tag after chunk number: this chunk is changed. +\end{cseqtab} + +Within the identifier index we have also special tags. The identifiers +are tagged like in the program mode, ie, with |\\| and |\&|. Remember +that |\9|, listed above, appears also in the index. + % +\begin{cseqtab} +|\I| & \verb*|#1, | & start of an index entry + && \arg1 index entry +|\[| & |#1]| & underlined chunk number in index + && \arg1 chunk number +|\.| & 1 & |@.| index entry + && \arg1 index entry +\end{cseqtab} + +In the list of refinement names the entries are marked similar to +the index entries. But note that |\I| has no arg here. + % +\begin{cseqtab} +|\I| & & start of a new refinement name +\end{cseqtab} + + +\sect \label{sec:prog-tag} + OK, now we can have a look at the large amount of tags used +for tagging program code. First, we have those which represent +directly C or \C++ tokens. + % +\begin{cseqtab} +|\?| & & C operator: conditional expression +|\AND| & & C operator: logical and +|\CM| & & C operator: binary complement +|\DC| & & \C++ operator: scope resolution +|\E| & & C operator: equivalence + && and equivalence sign after refinement name on it's definition +|\G| & & C operator: greater or equal +|\GG| & & C operator: shift right +|\I| & & C operator: not equal +|\K| & & C operator: assignment +|\LL| & & C operator: shift left +|\MG| & & C operator: pointer to struct component +|\MGA| & & \C++ operator: pointer to pointer to member +|\MM| & & C operator: decrement +|\MOD| & & C operator: modulo (actually, remainder) +|\NULL| & & `quoted' identifier +|\OR| & & C operator: binary or +|\PA| & & \C++ operator: pointer to member +|\PP| & & C operator: increment +|\R| & & C operator: logical negation +|\this| & & `quoted' identifier +|\TeX| & & `customized' identifier +|\V| & & C operator: logical or +|\W| & & C operator: logical and +|\XOR| & & C operator: binary exclusive or +|\Z| & & C operator: less or equal +\end{cseqtab} + +Other tokens have variable parts, passed as arguments. + % +\begin{cseqtab} +|\.| & 1 & C string + && \arg1 string +|\)| & & discretionary break between string parts +|\&| & 1 & reserved identifier + && \arg1 identifier +|\\| & 1 & ``normal'' identifier with more than one chars + && \arg1 identifier +\verb"\|" & 1 & ``normal'' identifier with one char + && \arg1 character +|\C| & 1 & C comment + && \arg1 comment text +|\MRL| & 1 & C operator: combined binary operators + && \arg1 operators, |\K| must print as `$=$' +|\SHC| & 1 & \C++ comment + && \arg1 comment text +|\T| & 1 & numeric constants + && \arg1 constant +|\X| & |#1: #2\X| & refinement name + && \arg1 chunk number + && \arg2 refinement name +\end{cseqtab} + % +The refinement name (second argument of |\X|) may be a file name +tagged by `|\.|'. Then the name must be set like a C~string. + +\cweb{} itself introduces its own operators: + % +\begin{cseqtab} +|\ATH| & & |@h| (place the preprocessor definitions here) +|\D| & & |@d| (define macro) +|\F| & & |@f| (format identifier like another one) +|\J| & & |@&| (join) +|\vb| & 1 & |@=| (pass arg verbatim by \ctangle{}) + && \arg1 string +\end{cseqtab} + +And we have some tags used for cross referencing. Chunk +cross-referencing (actually, for program parts) is started with some +tag, then follows a list of chunk numbers. + % +\begingroup + \hfuzz=22pt % 21.76602pt too wide (with a4-9.sty) +\begin{cseqtab} +|\A| & & one add-on definition (``See also chunk'') +|\As| & & more than one add-on definition (``See also chunks'') +|\ET| & & separator between the last two numbers if there are only two +|\ETs| & & separator between the last two numbers if there are more than two +|\Q| & & the chunk where it is cited (``This code is cited in chunk'') +|\Qs| & & more than one chunk where it is cited (``This code is cited in chunk'') +|\U| & & used in one chunk (``This code is used in chunk'') +|\Us| & & used in more than one chunk (``This code is used in chunks'') +\end{cseqtab} +\endgroup + +Program code must be indented according to its structure. Each +``larger'' statement is typeset as one paragraph, usually only one +line long. The basic indentation of the next statement may be +incremented and decremented in given units. If a statement has to be +broken in more than one line nevertheless, a hanging indentation is +added to the basic indentation for the subsequent lines. One can mark +an `optional' statement start, ie, some kind of optional paragraph +start. If a line break must be inserted it should be inserted here and +no hanging indentation should be added to the basic indentation. + % +\begin{cseqtab} +|\1| & & future stmts indented one more unit +|\2| & & future stmts indented one less unit +|\3| & 1 & optional line break within a statement + && \arg1 digit, penalty for line break +|\4| & & backspace one indentation unit +|\5| & & optional line break or small space (between run-in statements) +|\6| & & line break +|\7| & & line break and additional vertical space +|\8| & & line is a preprocessor directive (must be issued at start of line) +\end{cseqtab} + + +\sect Some args are designated as strings above. Within these args the +following tags are used to represent special characters: + % +\begin{cseqtab} +\verb*|\ | & & space +|\&| & & ampersand +|\\| & & backslash +|\^| & & hat +|\_| & & underscore +|\{| & & left brace +|\}| & & right brace +|\~| & & tilde +\end{cseqtab} + + +\sect Last, we have tags which are used in their ``standard'' +\LaTeX{} meaning. We don't have much work with them: + % +\begin{cseqtab} +|\#| & & hash mark in program or in string +|\$| & & dollar +|\%| & & percent +|\{| & & block start (is set in math mode) +|\}| & & block end (is set in math mode) +|\,| & & thin space (like the \LaTeX{} default) +|\langle| & & left delimiter in include directives, or in templates +|\le| & & C operator: less or equal +|\ldots| & & Function protoypes: Variable number of arguments +|\rangle| & & right delimiter in include directives, or in templates +\end{cseqtab} + + + + +\endSubDocument + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\vskip \PltxPreSectSkip + +\begin{rcslog} +$DocLog: cweave-spec.tex,v $ +\Revision 1.8 1995/09/12 22:56:02 schrod +|cweave -x| doesn't output |\vfill| in front of |\end| any more. +Change noticed in \cweb{} 3.4. + +\Revision 1.7 1995/08/29 01:40:24 schrod +Checked the interface description for \cweb{}~3.4. + +\Revision 1.6 1995/08/25 19:09:57 schrod +Cleaned up terminology: Chunks are not named sections any more. +Explicate possible range of section ranks. + +\Revision 1.5 1995/08/08 00:14:26 schrod +Updated to \LaTeXe{}, the |cweb| style is now a document class. Used +my standard templates for that, no changes in functionality. + +\Revision 1.4 1993/06/17 15:09:28 schrod +\cweb{} 3.0 was released officially on June 16, 1993. Mentioned in +the documentation that this version is needed for the |cweb| style. + +\Revision 1.3 1993/06/14 17:50:14 schrod +Clarify the occurence pattern of the lists after the last section: +which are optional, the expected order, etc. + +Changed `cseq' to `tag'. On this level of abstraction (that's the +specification!), we're still not considering \TeX{}nical details. + +\Revision 1.2 1993/06/14 15:40:02 schrod +Adapted to April 93 changes to \cweave{}: |\N| has three parameters +(added group level), |\M| param is no data-tag any more, |\Z| and +|\MRL| are new. + +Added further explanation of |\9| and |\X|. + +Replaced `program part name' by `refinement name'. + +\Revision 1.1 1993/04/09 15:00:37 schrod +Initial revision + +\end{rcslog} + + + +\end{document} + +% LocalWords: diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-conf.tex b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-conf.tex new file mode 100644 index 00000000000..86dd2ae04e4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-conf.tex @@ -0,0 +1,103 @@ +% $DocId: cweb-conf.tex,v 2.1 1995/08/29 15:19:45 schrod Exp $ +%------------------------------------------------------------ + +% +% internal interface of cweb class +% +% [LaTeX] +% (history at end) + + +% This file is either a subdocument of the style doc or a document on +% its own. In the former case it's a chapter, in the latter it's a +% ``normal'' LaTeX progltx document. +% If it's a subdocument, this file will be included after +% \begin{document}. We can detect this: \document redefines +% \documentclass to be \@twoclasseserror. Then we also have to define +% how this document is ended: Either by \endinput or by an additional +% revision log. +% Of course, this test works only if LaTeX 2e is used for processing. + +\expandafter\ifx \csname @twoclasseserror\endcsname \documentclass + + \let\endSubDocument=\endinput + + \chap The internal interface. + +\else + + \let\endSubDocument=\relax + + \documentclass{progltx} + + \usepackage{cweb-doc} % additional document-specific markup + \usepackage{a4-9} % Tschichold's A4 layout + + \nofiles % no crossreferences used + + \begin{document} + + \title{The \texttt{cweb} Class\\ + {\large (Internal Interface)}% + } + \author{Joachim Schrod% + \thanks{Email: \texttt{schrod@iti.informatik.th-darmstadt.de}}% + } + + \RCS $DocDate: 1995/08/29 15:19:45 $ + \date{% + \RCSDocDate\\[3pt] % LaTeX Error: Paragraph terminated too early + (Revision \RCSStyleRevision{} of \texttt{cweb.cls})% + } + + \maketitle + + \sect + +\fi + + + + +This +% +\ifx \endSubDocument\relax + document +\else + section +\fi +% +shall describe the internal interface for \TeX{} programmers who want +to write packages or subclasses to enhance the \cls{cweb} class. In +particular, it shall describe all control sequences a programmer may +redefine to adapt this class to special needs. (There are an awful lot +of them, all cseqs that start with `|Cweb|'.) + +Due to time constraints this description has not been written yet. It +depends on the demand when it will be written. I.e., if \emph{you} are +a package/class writer and if you want to enhance the \cls{cweb} +class, send me email. Please mention the kind of enhancement you want +to do. I will then add information to this description as needed. + + + + +\endSubDocument + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\vskip \PltxPreSectSkip + +\begin{rcslog} +$DocLog: cweb-conf.tex,v $ +\Revision 2.1 1995/08/29 15:19:45 schrod +Added (hint to non-existence of) description of the internal interface. + +\end{rcslog} + + + +\end{document} + +% LocalWords: diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-doc.sty b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-doc.sty new file mode 100644 index 00000000000..2859584f6cb --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-doc.sty @@ -0,0 +1,133 @@ +% $Id: cweb-doc.sty,v 1.3 1995/08/25 19:07:54 schrod Exp $ +%---------------------------------------------------------------------- + +% +% tags for the documentation of cweb class +% + + +\ProvidesPackage{cweb-doc} + + +% +% Used packages +% + +\begingroup + \let\begingroup=\endinput + \input{cweb.cls} % get style revision + \global\let\cweb@loaded=\cweb@loaded +\endgroup +\providecommand*\cweb@loaded{$StyleRevision$} % bootstrap + + + +% +% Configuration of RCS fields +% + +% keywords in style are prefixed by `Style', in documentation by `Doc'. +\let\RcsHandleStyleDate=\RcsHandleDate % transform StyleDate value +\let\RcsHandleDocDate=\RcsHandleDate % transform DocDate field + +% the revision of cweb.cls is needed by the documentation +\def\RcsEmptyValue{$\langle$unknown$\rangle$} +\expandafter\RCS \cweb@loaded % creates \RCSStyleRevision +\def\RcsEmptyValue{} + +% author name +\rcsAuthor{schrod}{Joachim Schrod} + + + +% +% new environments +% + +\font\manfnt=manfnt % with the dangerous bend sign +\chardef\bend="7F % I like the non-S curve ;-) +\newenvironment{fixme}{% + \trivlist + \hangindent 2em + \hangafter -2 + \item[\hbox to 0pt{\hss \manfnt \bend}]% + \ignorespaces + }{% + \endtrivlist + } + + +\newenvironment{cseqtab}{% + \quote + \obeycr + \tabular{lrl}% + \@gobblecr % eat following newline + }{% + \endtabular + \endquote + } + + +\newenvironment{options}{% + \list{}{% + \labelwidth\z@ + \itemindent -.5\leftmargin + \labelsep 1em + \def\makelabel##1{% + \hspace\labelsep + \normalfont\ttfamily ##1% + }% + }% + }{% + \endlist + } + + + +% +% new tags +% + +% logos +\def\cweb{\texttt{CWEB}} +\def\ctangle{\texttt{CTANGLE}} +\def\cweave{\texttt{CWEAVE}} + +% other +\renewcommand*\arg[1]{\textsl{Arg.~#1}:} % I don't use the arg operator + +\def\<#1>{\textit{#1}} % syntactic category + +\newcommand\cls[1]{\textsf{#1}} % LaTeX classes +\newcommand\pkg[1]{\textsf{#1}} % LaTeX packages + + +% +% change of LaTeX parameters, for layout etc. +% + +% underfull hboxes are not such a problem in program documentation + +\hbadness=4000 + + +% figure + +\def\textfraction{0.1} % must be at least 10% text on page +\def\topfraction{0.9} % rest may be top insertion +\def\floatpagefraction{0.8} % float pages only if the float is larger than 80% + + + + +\endinput + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Local Variables: +mode: LaTeX +TeX-brace-indent-level: 4 +indent-tabs-mode: t +TeX-auto-untabify: nil +End: diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.fig b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.fig new file mode 100644 index 00000000000..729c992d272 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.fig @@ -0,0 +1,78 @@ +#FIG 2.1 +80 2 +6 35 82 134 122 +1 1 0 1 -1 0 0 0 0.00000 1 0.000 83 100 47 18 83 100 130 119 +4 1 0 10 0 -1 0 0.00000 0 7 63 83 104 Documentation +-6 +6 35 152 134 192 +6 62 158 107 180 +4 1 0 10 0 -1 0 0.00000 0 7 43 83 167 Restricted +4 1 0 10 0 -1 0 0.00000 0 9 36 83 180 Program +-6 +1 1 0 1 -1 0 0 0 0.00000 1 0.000 83 170 47 18 83 170 130 189 +-6 +6 116 17 215 57 +6 140 23 188 48 +4 1 0 10 0 -1 0 0.00000 0 9 48 164 32 (CR) Cross +4 1 0 10 0 -1 0 0.00000 0 7 40 164 48 Reference +-6 +1 1 0 1 -1 0 0 0 0.00000 1 0.000 164 35 47 18 164 35 211 54 +-6 +6 203 152 302 192 +1 1 0 1 -1 0 0 0 0.00000 1 0.000 251 170 47 18 251 170 298 189 +4 1 0 10 0 -1 0 0.00000 2 7 21 251 174 \TeX +-6 +6 203 82 302 122 +1 1 0 1 -1 0 0 0 0.00000 1 0.000 251 100 47 18 251 100 298 119 +4 1 0 10 0 -1 0 0.00000 0 9 36 251 104 Program +-6 +6 257 122 299 143 +6 257 131 287 143 +4 0 5 10 0 -1 0 0.00000 2 10 30 257 143 \\SHC +-6 +4 0 5 10 0 -1 0 0.00000 2 10 42 257 132 \\C \\X +-6 +6 221 47 266 71 +4 0 5 10 0 -1 0 0.00000 2 10 42 223 57 \\A \\Q +4 0 5 10 0 -1 0 0.00000 2 8 18 235 69 \\U +-6 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 254 119 254 152 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 245 83 208 46 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 119 41 89 81 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 101 83 125 51 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 131 174 203 174 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 0 1 + 0 0 1.000 4.000 8.000 + 131 164 203 164 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 0 1 + 0 0 1.000 4.000 8.000 + 89 119 89 152 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 131 95 203 95 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 0 1 + 0 0 1.000 4.000 8.000 + 131 105 203 105 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 74 119 74 152 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 0 1 + 0 0 1.000 4.000 8.000 + 239 119 239 152 9999 9999 +4 2 5 10 0 -1 0 0.00000 2 10 24 72 136 \\PB +4 1 5 10 0 -1 0 0.00000 2 8 24 167 160 \\PB +4 1 5 10 0 -1 0 0.00000 2 8 18 166 92 \\B +4 1 5 10 0 -1 0 0.00000 2 8 42 166 117 \\M \\N +4 2 5 10 0 -1 0 0.00000 2 8 42 101 60 \\M \\N +4 0 5 10 0 -1 0 0.00000 2 8 24 113 76 \\ch +4 1 5 10 0 -1 0 0.00000 2 8 18 167 188 \\X diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.latex b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.latex new file mode 100644 index 00000000000..8f624ed30af --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.latex @@ -0,0 +1,62 @@ +\setlength{\unitlength}{0.012500in}% +% +\ifx \SetFigFont\undefined + \begingroup\makeatletter + % extract first six characters in \fmtname + \def\x#1#2#3#4#5#6#7\relax{\def\x{#1#2#3#4#5#6}}% + \expandafter\x\fmtname xxxxxx\relax \def\y{splain}% + \ifx\x\y % LaTeX or SliTeX? + \gdef\SetFigFont#1#2#3{% + \ifnum #1<17\tiny\else \ifnum #1<20\small\else + \ifnum #1<24\normalsize\else \ifnum #1<29\large\else + \ifnum #1<34\Large\else \ifnum #1<41\LARGE\else + \huge\fi\fi\fi\fi\fi\fi + \csname #3\endcsname}% + \else + \gdef\SetFigFont#1#2#3{\begingroup + \count@#1\relax \ifnum 25<\count@\count@25\fi + \def\x{\endgroup\@setsize\SetFigFont{#2pt}}% + \expandafter\x + \csname \romannumeral\the\count@ pt\expandafter\endcsname + \csname @\romannumeral\the\count@ pt\endcsname + \csname #3\endcsname}% + \fi + \endgroup +\fi +\begin{picture}(262,171)(37,651) +\put( 84,735){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}Documentation}}} +\put( 84,672){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}Restricted}}} +\put( 84,659){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}Program}}} +\thinlines +\put( 84,669){\oval(94,36)} +\put(165,807){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}(CR) Cross}}} +\put(165,791){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}Reference}}} +\put(165,804){\oval(94,36)} +\put(252,669){\oval(94,36)} +\put(252,665){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}\TeX}}} +\put(252,739){\oval(94,36)} +\put(252,735){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{}Program}}} +\put(258,696){\makebox(0,0)[lb]{\smash{\SetFigFont{10}{12.0}{tt}\\SHC}}} +\put(258,707){\makebox(0,0)[lb]{\smash{\SetFigFont{10}{12.0}{tt}\\C \\X}}} +\put(224,782){\makebox(0,0)[lb]{\smash{\SetFigFont{10}{12.0}{tt}\\A \\Q}}} +\put(236,770){\makebox(0,0)[lb]{\smash{\SetFigFont{10}{12.0}{tt}\\U}}} +\put(255,720){\vector( 0,-1){ 33}} +\put( 84,739){\oval(94,36)} +\put(246,756){\vector(-1, 1){ 37}} +\put(168,651){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{tt}\\X}}} +\put(120,798){\vector(-3,-4){ 30}} +\put(102,756){\vector( 3, 4){ 24}} +\put(132,665){\vector( 1, 0){ 72}} +\put(204,675){\vector(-1, 0){ 72}} +\put( 90,687){\vector( 0, 1){ 33}} +\put(132,744){\vector( 1, 0){ 72}} +\put(204,734){\vector(-1, 0){ 72}} +\put( 75,720){\vector( 0,-1){ 33}} +\put(240,687){\vector( 0, 1){ 33}} +\put( 73,703){\makebox(0,0)[rb]{\smash{\SetFigFont{10}{12.0}{tt}\\PB}}} +\put(168,679){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{tt}\\PB}}} +\put(167,747){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{tt}\\B}}} +\put(167,722){\makebox(0,0)[b]{\smash{\SetFigFont{10}{12.0}{tt}\\M \\N}}} +\put(102,779){\makebox(0,0)[rb]{\smash{\SetFigFont{10}{12.0}{tt}\\M \\N}}} +\put(114,763){\makebox(0,0)[lb]{\smash{\SetFigFont{10}{12.0}{tt}\\ch}}} +\end{picture} diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.ltx b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.ltx new file mode 100644 index 00000000000..aa5cdce2f26 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-fsa.ltx @@ -0,0 +1,29 @@ +% $Id: cweb-fsa.ltx,v 1.2 1995/08/08 00:14:27 schrod Exp $ +%------------------------------------------------------------ + +% +% test of xfig created pictures +% +% [LaTeX] + + + + +\documentstyle{article} + + +\begin{document} + +\noindent Test of figure \texttt{cweb-fsa.latex}: Finite State +Automaton for different CWEB modi. + +\bigskip + +\begin{center} + \chardef\\=`\\ + \input{cweb-fsa.latex} +\end{center} + + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-user.tex b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-user.tex new file mode 100644 index 00000000000..2f21f53150c --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb-user.tex @@ -0,0 +1,779 @@ +% $DocId: cweb-user.tex,v 2.10 1995/11/20 22:34:16 schrod Exp $ +%------------------------------------------------------------ + +% +% user manual/requirement definition for cweb class +% +% [LaTeX] +% (history at end) + + +% This file is either a subdocument of the style doc or a document on +% its own. In the former case it's a chapter, in the latter it's a +% ``normal'' LaTeX progltx document. +% If it's a subdocument, this file will be included after +% \begin{document}. We can detect this: \document redefines +% \documentclass to be \@twoclasseserror. Then we also have to define +% how this document is ended: Either by \endinput or by an additional +% revision log. +% Of course, this test works only if LaTeX 2e is used for processing. + +\expandafter\ifx \csname @twoclasseserror\endcsname \documentclass + + \let\endSubDocument=\endinput + + \chap What's this class for?. + +\else + + \let\endSubDocument=\relax + + \documentclass{progltx} + + \usepackage{cweb-doc} % additional document-specific markup + \usepackage{a4-9} % Tschichold's A4 layout + + + \begin{document} + + \title{The \texttt{cweb} Class} + \author{Joachim Schrod% + \thanks{Email: \texttt{jschrod@acm.org}}% + } + + \RCS $DocDate: 1995/11/20 22:34:16 $ + \date{% + \RCSDocDate\\[3pt] % LaTeX Error: Paragraph terminated too early + (Revision \RCSStyleRevision{} of \texttt{cweb.cls})% + } + + \maketitle + + \sect + +\fi + +\cweb{} is a Literate Programming tool that enables you to combine +documentation and actual C or \C++ code in one document. The \cls{cweb} +class allows you to use \LaTeX{} for the documentation of your \cweb{} +programs. Now a \cweb{} document is like a usual \LaTeX{} +document---as you have probably written dozens before. With all the +features of \LaTeX{}, and with all the quirks of \LaTeX{}. + +Originally, \cweb{} was only usable with Plain \TeX{}, as \cweave{} +outputs \TeX{} code that looks as if it were Plain \TeX{}. Well, it +isn't---it's just not the normal \LaTeX{} markup. No change in +\cweave{} is necessary to use \LaTeX{}. + +For the sake of those \cweb{} programmers who have used the original +markup interface (i.e., the Plain \TeX{} macros) before, I'll +sometimes contrast the approach presented here with the original one. +Then I'll call the original interface ``Plain \cweb{}''. The new +interface is called ``\LaTeX{} \cweb{}''. + +If you never used \cweb{} before, you won't find enough information in +this manual. Please read the user manual of \cweb{} first, and then +come back again. I assume a working knowledge, and will only present +the new stuff introduced by this class. + + +\sect This bundle does \emph{not} support inclusion of \cweb{} code in +other (general) \LaTeX{} documents. This is not the task of the +\cls{cweb} class -- its task is the usage of \LaTeX{} for creation of +\cweb{} documents. + +Note also that you will not be able to \LaTeX{} your \cweb{} documents +(i.e., the program files) directly. You must still process them first +by \cweave{}, then you can use \LaTeX{} to process the resulting +\TeX{} file. + + +\sect You have to use \cweb{} version~3 and you need at least \LaTeX{} +version \mbox{$\langle$1994/12/01$\rangle$} (or any later one), this +class does not work with older versions. + + +\sect A \cweb{} document has two concurrent structures, a +\textsl{document structure} and a \textsl{program structure}. + +The basic building block of the document structure, the bricks that +build up our document, are called \textsl{chunks}. We use chunks to +present one point of our work to our reader, the presentation has both +informal (explanation) and formal parts (code). This is the essence of +Literate Programming, that we tell each point twice, once on an +abstract and once on a technical level. + +A chunk consists of three parts: (1)~the \textsl{documentation part}, +(2)~the \textsl{definition part}, and (3)~the \textsl{program part}. +Each of these parts can be empty. The documentation part is mostly +text with \LaTeX{} tags. In this text material from \textsl{restricted +program mode} can appear. The definition part consists of a series of +either \textsl{macro} or \textsl{format definitions}. The program part +is one piece of a refinement, identified by a name (see below). + +A chunk starts with `\verb*|@ |', and gets assigned a unique +identification, a number; we'll use that number to refer to that +chunk. In particular, the number is of interest when we want to refer +to the code part of the chunk, otherwise it's often regarded as +superfluous. + +\sect And we have higher-level structure elements as well. They combine a +sequence of chunks and a sequence of structure elements on a lower +level, both sequences may be empty. As usual in \LaTeX{}, we call +these elements \textsl{section divisions} or short \textsl{sections}. +We do not give them names +like `part,' `chapter,' `subsection,' etc., to denote their level; +most often we'll use level-numbers (sometimes called \textit{rank}) +instead. + +A section division starts with `|@*|' and is followed by a character, the rank +indicator. The highest rank is~`|@**|', you can think of it as an +equivalence to \LaTeX{}'s |\part|. (Often we don't use that rank in +smaller programs, as we don't use |\part| in smaller articles.) A +section on the next rank is started with~`\verb*|@* |' (synonym to +`|@*0|'), roughly equivalent to chapters. Then we'll use numbers to +mark the next ranks, from |@*1| to~|@*9| (sections to +sub$^{9}$sections). That's outrageous---I'll hope you'll never use +11~hierarchy levels in your documents, they would be unreadable. + +A section has a title, that title comes after the section start tag +and ends with a full stop. If you need periods in your title, enclose +them in braces. (That behavior can be changed if there's enough +interest. I can also make it possible to use braces to delimit the +section title, as in |\section|, etc. Send mail with your opinion.) + +As a matter of convenience, a section implicitly starts a chunk; +i.e., one does not need to use `\verb*|@ |' after the section title. +Of course, it doesn't hurt to use it either. + +\medskip + +The explanation might have been a bit too abstract, so let me make one +thing plain clear: You should \emph{never ever} use |\part|, +|\chapter|, |\section|, or any other \LaTeX{} sectioning command in +your \cweb{} documents. Use the sectioning commands of \cweb{}, i.e., +`|@*|\textit{rank}'. + + + +\sect The description above does not mean that the output is fixed to +the style you'll know from the \cls{book} or \cls{report} document +classes. Quite in contrary, the default layout is oriented along the +\cls{article} class. + +There is a very easy possibility to change that default layout: With +the option |baseclass| (see chunk~\ref{chunk:baseclass}) you can +specify the document class \cls{cweb} inherits from. If that document +class has chapters (like \cls{report} or \cls{book}), you'll get the +layout as you're used from these classes. + + +\sect In Plain \cweb{}, the term \textit{section} was used for +`chunk.' We abstain from that usage, as sections are used in \LaTeX{} +(and in almost all other documentation systems, for that matter) to +designate higher-level structure elements. We prefer to follow the +traditional usage of terms here, even if that means that we'll have to +confront Plain \cweb{} users with a slight shift in semantics. + +And you'll find the term \textit{starred section} in Plain \cweb{} and +might think these are our sections. Well, almost. There's a subtle, +but important difference between these starred sections and our +terminology: A starred section is just a chunk with a special +attribute (a title). That title will appear in a table of contents, +but that does not mean that the starred section is an element to +denote a structural \emph{hierarchy}. + +You won't find a section number like `1.5.2' in Plain \cweb{}, do you? +--- In \LaTeX{} \cweb{}, you've got the choice. You have the new +support of the hierarchical structure, or you may stay with Plain +\cweb{}'s (flat) structure. + + +\sect We still have one open point in our explanation of the +document's structure. As mentioned at the start, we've got two +concurrent structures, let's have a look at the program structure +finally. + +A \cweb{} program consists of a tree of \textsl{refinements}. A +refinement is a sequence of program parts with the same name, ordered +in appearance in the document. The root of the tree is the refinement +with the special name~|@c|. + +The complete program text is defined by the depth-first traversal +(DFS, i.e.\ infix-order) of the tree, the tool \ctangle{} extracts the +program text from a \cweb{} document. + + + + +\chap Markup for your document structure. + +Like every \LaTeX{} document, a \cweb{} document starts with a +document class specification; then comes the preamble, terminated by +the document start. This way we brought some structure in the \cweb{} +limbo, but this shouldn't be a problem for you. You must tag the end +of the document, as you do in other \LaTeX{} files. But here you must +take a bit more care: +% +\begin{quote} + \itshape + + Assert that the\/ |\end{document}| is in the documentation part of + a\/ chunk, neither in the definition nor in the program part. + +\end{quote} +% +If it would be in the program part, \cweave{} would readily process it +and \LaTeX{} would never see this tag. Nevertheless, if you make this +mistake, you will detect it early: \ctangle{} will copy this tag to +the C file as well, and your program will be erroneous\,\dots + +And there's another difference you'll have to take care of: Usually +you can put arbitrary text after the end of your document, \LaTeX{} +will not see it. Please note that both \ctangle{} and \cweave{} will +still see it---don't put a program part or even complete chunks there. +For technical reasons, there must not be any |\fi| token after the +document end, too. + + +\sect The resulting structure of your \cweb{} document is exemplified +in figure~\ref{fig:structure}. Note that |\end{document}| is placed +in a new, empty, chunk. This isn't necessary, you could write more +documentation there---but it's considered good style to use a sole +chunk for document finish. + +%% my little joke +\begin{figure} + +\setbox0=\vbox{\parindent=0pt \hsize=.85\textwidth +\begin{minipage}{\hsize} +\begin{verbatim} +\documentclass{cweb} + +\begin{document} + +\title{My Program, Doomed for the ACM Software Systems Award} +\author{Joe L. User} + +\maketitle + +\tableofcontents % if you want + + +@* A PSPACE solution for the Traveling Salesman. + +< insert your program here > + + + +@ +\end{document} +\end{verbatim} +\end{minipage} +} + +\begin{center} +\fboxsep=1em +\fbox{\box0} +\end{center} + +\caption{Exemplified \cweb{} document structure} +\label{fig:structure} +\end{figure} + + +\sect If you don't call \cweave{} with the |-x| option, an identifier +index and a list of all refinements is created at the end of the +document. You can specify an introductionary text for the index with +the tag |\cwebIndexIntro|, the introduction is the argument of this +tag. + + + + +\chap Configuration. + +You may configure the \cls{cweb} class in several ways, with class +options, redefinitions in the preamble, supplying additional +packages, and by subclassing it. + +At start of the processing, the file |cweb.cfg| is read if it exists. +That file may contain configuration code that shall apply to all your +\cweb{} documents. You can set the paper size there, etc. Please don't +set the default structure there (see +chunk~\ref{chunk:structure-option}), others would get different results +when they process your document. + + +\sect Options are specified with the new ``keyword$=$value''-scheme, +first introduced with the \pkg{graphicx} package. I.e., the options have a +set of possible values, you may choose one. For instance, the option +|structure| has the possible values |flat| and |hierarchic|. You tell +that you want a flat document structure by +% +\begin{quote} + |\documentclass[structure=flat]{cweb}| +\end{quote} +% +As usual, options are separated by commas. From the set of possible +option values, two ones are special: The \textsl{predefined value} and +the \textsl{default value}. The predefined value is the one that's +used when you don't specify the option at all. The default value is +used of you don't specify the value in the option; e.g., +% +\begin{quote} + |\documentclass[suppress]{cweb}| +\end{quote} +% +selects the default value of the option |suppress|. (Not that there is +one currently. :--) + +There is always a predefined value, a default value may not be there. +If a default value exists, it is always different from the predefined +one. The default value gives you an easy specification of an option +value that is expected to be common. If that value would be the +predefined one, you won't need to specify the option in the first +hand. + +The following options are available and explained below: +% +\begin{options} +\item[structure] Select the structure model used by the \cls{cweb} + class. +\item[suppress] Suppress output of different document parts. +\item[baseclass] Select the base document class. +\item[language] Select a language for inserted texts. +\end{options} + + +\sect \label{chunk:structure-option} + +We have two possibilities to output chunks and sections, either +as a flat or as a hierarchic structure. This configuration is selected +by the option |structure|, either through the value |flat| or +|hierarchic|. +% +\begin{options} + +\item[flat] The flat structure is the ``classic'' approach, + the way Plain \cweb{} renders its chunks. Then each chunk starts + with its number. The chunk numbers are output in boldface, followed + by a dot and a quad. + + Sections show chunk numbers as well (remember, they implicitly + start a chunk). ``Important'' sections are added to the table of + contents. + +\item[hierarchic] The hierarchic structure is the + ``modernistic'' (aka \LaTeX{}) approach, then we mark the start of a + chunk by a start sign. (By default, that's a paragraph sign, `\P'). + Chunk numbers are rendered in the margin of the program part. If + there's no program part, no chunk number will be rendered---after + all, they are only used for identification of program parts. + + Section numbers are hierarchic, like in other \LaTeX{} document + classes. + +\end{options} +% +The predefined value of |structure| is |hierarchic|. There doesn't +exist a default value. + + +\sect The option |suppress| allows to select suppression of different +document parts. You have different parts you can suppress. The value +of the |suppress| option is a comma-separated list of identifiers, +enclosed in braces. If you have only one thing you want to suppress, +you don't need to surround that identifier by braces. Possible +identifiers are: + +\begin{options} + +\item[changehints] suppress output of hints that a changefile was + used: The change flag (by default a star at the start of a chunk) + and the list of changed chunks at the end of the document. + +\item[unchanged] suppress output of chunks that are not changed by + a changefile. This value implies |changehints|---by definition all + printed chunks are changed, it doesn't make any sense to hint to + that fact in addition. + +\item[index] suppress the identifier index. + +\item[reflist] suppress the refinement list. + +\item[format] suppress output of `|@f|' directives. + +\end{options} + +The predefined value is the empty list, i.e., nothing is suppressed. +There is no default value since I don't know which parts are +suppressed most often. Send email with your demands, I'll add a +default if I see that there is one major application of this option. + + +\sect \label{chunk:baseclass} The option |baseclass| allows to select +the base document class used by the \cls{cweb} class. In particular, +if the base class has |\chapter| defined the layout of major section +divisions (`|@**|' and `\verb*|@* |') will be changed to be in a +chapter layout. + +The predefined value is |article|, the default value is |report|. + + +\sect The option |language| allows to adapt inserted texts to +different languages. E.g., with the option `|language=german|' German +texts are inserted for cross references, headings, etc. That option +will neither switch on language-specific hyphenation, nor will it +trigger any other processing -- that's the task of Babel or any other +\LaTeX{} language style. + +There is neither a predefined nor a default value. (Without the +|language| option, inserted texts are in English.) + +That option actually triggers the usage of a package +\pkg{cwbl-\textit{language}}. To see if a language is supported, you +have to look for respective files in the \LaTeX{} \cweb{} macro +directory.% + \footnote{That's |texmf/tex/latex/cweb|, on a TDS compliant + installation. Please beware that pseudo operating systems like DOS + cripple file names and shorten them to eight characters; if you + see a file |cwbl-ger.sty| you'll know that the option value + |german| is supported.} +Of course, the easiest way to check the availability is to try it +out -- you'll get a comprehensible error message if there is no +respective \cweb{} language package. In November 1995, |german|, +|french|, and |italian| were supported, more might have been added +later. + +\smallskip + +For compatibility with Babel, some other options (e.g., |german| or +|french|) are also supported as nicknames for +|language=|\textit{option}. If you use packages that make also use of +these options (e.g., \pkg{babel} or \pkg{varioref}), you'll probably +prefer them over |language| since they are picked up by those packages +as well. + + + + + +\chap Restrictions. + +The following restrictions will not be withdrawn as far as I can +see---except if somebody will send me a patch with changes. I tried to +sort the restrictions in order of severity. + + +\sect \emph{(Restrictions due to the design of \cweave{}.)} + +Please be aware that the vertical bar (`\verb"|"') is used by \cweb{} +to delimit small C code pieces in the documentation parts, and is +therefore processed (and mangled) by \cweave{}. \emph{You cannot use +it for \TeX{} any more.} + +In particular, you cannot specify rules for the |tabular| or the +|array| environment. Since you most certainly want to do so: You have +two choices left: +% +\begin{enumerate} + +\item Make sure you have the \pkg{array} package (by Frank Mittelbach and + David Carlisle, from the Tools bundle) installed. Then you may use + the package \pkg{cwebarray}, it defines `|I|' (that's an uppercase~`i') + as a specifier for rules. I.e., instead of + \verb"\begin{tabular}{l|l}" you have to write + |\begin{tabular}{lIl}|. Not the most elegant solution, but it + works\,\dots + +\item + Use `|^^7c|' instead of `\verb"|"'. I.e., instead of + \verb"\begin{tabular}{l|l}" you may write |\begin{tabular}{l^^7cl}|. + +\end{enumerate} +% +These two choices are compatible, you may use both in one document. +Needless to say, I consider the first alternative the better one. + + +\sect Neither a refinement name nor an index entry made by~|@^| may +consist of a \emph{single} dot-accented term. I.e., you must not +write `|@<\.O@>|', `|@^\.o@>|', or even `|@^\.{foolish}@>|'. Of +course you may write `|@^\.o, accent@>|' or `|@< Handle accent \.o @>|'. + + +\sect \emph{(Restriction due to the implementation of \LaTeX{}.)} + +One cannot use restricted C mode in moving arguments. Most notably, +this is disturbing in the section titles and in |\caption| +tags. Sorry, folks. + +(Basically, that's because the definition of |\addcontentsline|, etc., +in the \LaTeX{} kernel is brain damaged; it wants to expand its +argument. And I don't want to maintain redefinitions of such basic +macros.) + + +\sect \emph{(Restrictions due to \TeX{}.)} + +\C++ comments (i.e., from |//| to the end of the line) are typeset as C +comments. This is especially bad if they are used for a whole block of +comment lines, as it is quite common. Please put such comment blocks +in the documentation part. (An |\everyline| implementation would be +needed to lift that restriction, and that's impossible in general.) + + + + +\chap Details. + +The following tags are reserved and must neither be used nor redefined: + |\ATL|, + |\B|, + |\M|, + |\N|, + |\PB|, + and~|\Y|. + +|\9| is already explained in the \cweb{} user manual: It's a special +control sequence used for the index entries tagged with~`|@:|'. Its +default definition is setup in such a way that you can cheat +\cweave{} concerning the sort order of this entry: If you enter +`|@:sort}{print@>|' you will get an index entry ``print'' next to the +place where the index entry ``sort'' would be. But you're allowed to +change this default definition.% + \footnote{Remember: A package is a very good place to place such + redefinitions; your document should be concerned with contents, not + with appearance.} + +The names of all other control sequences defined by this +class---besides the common \LaTeX{} control sequences---start with +|cweb|, |Cweb|, or |cwbb|. Please don't define new control sequences starting +with this prefix. (The control sequences starting with |Cweb| may be +redefined in a package to change the appearance of the \cweb{} +document or the behavior in a controlled manner, check the +description of the internal interface for this possibility.) + + +\sect Plain \cweb{} users +should note that the macros from |cwebmac.tex| are not available any +more. E.g., you cannot use |\.| to typeset typewriter material; use +either |\texttt| or~|\verb|, as it fits the situation. On the other hand, +now you're able to use |\.| for the dot accent, you can define |\3| +for the `sharp~s', |\C++| for the \C++ logo,% + \footnote{I will not define any such logos in this class. A + package like \pkg{logos} with lots of name definitions is the + appropriate place for this.} +etc. + +Another detail for ex-plainies: The table of contents is produced by +the |\tableofcontents| tag (during the second \LaTeX{} run), not +automatically. But this is the standard \LaTeX{} behavior. + + + + +\chap Known Problems. +\label{sec:problems} + +There is a bunch of known bugs, problems, and ommisions. + +\bigbreak + +\noindent \textit{Bugs:} + % +\begin{itemize} + +\item The presentation of |@l| redefinitions is not proper. But it +wasn't in Plain \cweb{}, either. + +\end{itemize} + +\noindent \textit{Problems:} + % +\begin{itemize} + +\item You can't use |\index| and |\makeindex| as-is to create an + index. Add your entries instead to \cweave{}'s index using `|@^|', + `|@.|', or `|@:|'. That problem is caused by a clash in the usage of + the filename extension |idx| by \cweave{} and \LaTeX{}. The + \pkg{index} package by \textsc{David Jones} will help you to define + additional index categories (that use an other extension) if you + don't want to mix identifiers and your other index entries. + +\end{itemize} + +\noindent \textit{Ommisions} (``wouldn't it be nice, if''s): + % +\begin{itemize} + +\item The current chunk number and most section titles (below rank 1 + or~2, depending on the base class) are not available as a mark for + inclusion in a running head. + +\item Better integration of \pkg{rcs} package. That package is used to + support including information from the revision management system + RCS into the document. E.g., the revision log at the end of that + document was produced by that package. + +\end{itemize} + + +\sect I would like to thank those who helped me to improve this bundle. +% In particular, XXX provided XXXsubstantial parts of the code. + +\textsc{Michael M\"uller} and \textsc{Zden\v{e}k Wagner} did thorough +checks that helped me to improve the alpha test version. + +\textsc{Christian Kumpf} triggered the addition of language support +and pointed out where configuration could be made easier by supplying +more macros in the protected interface. \textsc{Andreas Scherer} +provided packages for French and Italian \cweb{} documents. + +\textsc{Laurent Desnogues}, +\textsc{Felix G\"artner}, +and +\textsc{John S. Robinson} +provided error and problem reports. +\textsc{Bronne Louis} pointed out the embarrassing error that section +numbers were not reset when a higher-level section began. + + + +\endSubDocument + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newpage + +\begin{rcslog} +$DocLog: cweb-user.tex,v $ +\Revision 2.10 1995/11/20 22:34:16 schrod +Add language support.\\ +Triggered by Christian Kumpf \path|| and Andreas +Scherer \path||. + +Use my `official' (ACM) email address. + +\Revision 2.9 1995/11/20 10:39:34 schrod + Explicate that one must not use |\section| etc., that one cannot +\LaTeX{} the \cweb{} program directly but must run \cweave{} first, +and that the \cls{cweb} class does not provide inclusion of \cweb{} +programs in other \LaTeX{} documents.\\ +Clarification triggered by Laurent Desnogues +\path||. + +\Revision 2.8 1995/09/15 10:22:58 schrod +The \cls{cweb} class needs at least \LaTeX{} version +\mbox{$\langle$1994/12/01$\rangle$}.\\ +Problem reported by John S. Robinson \path|jsrobin@umiacs.umd.edu|. + +\Revision 2.7 1995/09/12 22:58:38 schrod +|cwbb| is also a reserved namespace. + +Added acknowledgements. + +\Revision 2.6 1995/08/29 17:34:14 schrod + \LaTeX{} \cweb{}, version 1.0. + +\Revision 2.5 1995/08/29 02:07:28 schrod +Discard dependencies on 10\,pt fonts. + +Support suppression of format directives. + +\Revision 2.4 1995/08/27 19:31:11 schrod +Suppression of index and reference list is supported. + +Discard documentation on |\cwebSecNoEject|, that's part of the +protected interface. + +\Revision 2.3 1995/08/27 17:24:45 schrod +Make usage of baseclass with chapters work. + +\Revision 2.2 1995/08/27 13:25:59 schrod +Add possibility to suppress change hints. Suppression of unchanged +chunks suppress change hints as well, they are meaningless as all +printed chunks are changed by definition. + +Update problems section, they were partly resolved by the current +changes. Added hint to \pkg{index} package that resolves the problem +of extensions clashes with \MakeIndex{}. + +\Revision 2.1 1995/08/25 19:11:17 schrod +Add keyword-value option style, with new \pkg{keyvald} package. + +Hierarchic strucutures are supported now, in addition to the flat +structure of the beta-test version. One can choose with an option. For +that step, the terminology was cleaned up, too: Chunks are not named +sections any more. (That change involved reimplementation of almost +all the structure and toc stuff.) + +The chunk number supplied by \cweave{} is used now, not some computed +number. Change flags are printed, too. + +One can suppress output of unchanged sections. + +One can select the baseclass with an option. That may be used to use +\cls{report} or \cls{book} to get chapter-style layout. Of course, +using an arbitrary baseclass is dangerous, it must conform to the +conventions of \LaTeX{} standard classes. + +\Revision 1.10 1995/08/08 00:14:28 schrod +Updated to \LaTeXe{}, the |cweb| style is now a document class. Used +my standard templates for that, no changes in functionality. + +\Revision 1.9 1993/08/10 14:15:40 schrod +New page on main section only if group level $<$ |\cwebSecNoEject|. +Default for the latter is 3. + +Document that logos will not be defined in this style file. + +Copy of plain macros for |\CwebNumber| does not work. Repaired the +most important one (subscript must be accessed via |\sb|). +Incompatibility to NFSS will be addressed later.\\ +(Problems reported by Zden\v{e}k Wagner \path||.) + +\Revision 1.8 1993/08/10 11:21:03 schrod +Reference to section number does not render a period after the +number any more. + +\Revision 1.7 1993/08/09 18:05:54 schrod +Mentioned that `\verb"|"' cannot be used for LaTeX purposes, in +particular, not for ruled tables. Described workarounds, one of them +is the new style option |cwebarray|.\\ +(Problem reported by Felix G\"artner +\path||.) + +\Revision 1.6 1993/06/17 16:10:06 schrod +`|cweb|' was still an option in the example. + +\Revision 1.5 1993/06/17 15:09:30 schrod +\cweb{} 3.0 was released officially on June 16, 1993. Mentioned in +the documentation that this version is needed for the |cweb| style. + +\Revision 1.4 1993/06/15 15:19:11 schrod +It's a style now, was an option formerly. + +\Revision 1.3 1993/06/14 15:40:42 schrod +Added section about restrictions (no restricted C mode material +in moving arguments, no single dot-accented term in an index entry). + +\Revision 1.2 1993/05/12 20:23:32 schrod +Adapted to recent changes of \cweave{} (of April 93): Main sections +have a group level, represented in the table of contents. + +Boxed the example, it was not legible formerly. + +\Revision 1.1 1993/04/09 15:00:37 schrod +Initial revision + +\end{rcslog} + + + +\end{document} + +% LocalWords: baseclass DFS PSPACE graphicx changehints changefile reflist idx +% LocalWords: cwebarray cwebmac plainies ommisions if''s rcs cwbb uller Zden diff --git a/Master/texmf-dist/doc/latex/cweb-latex/src/cweb.doc b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb.doc new file mode 100644 index 00000000000..8fb7a0a5582 --- /dev/null +++ b/Master/texmf-dist/doc/latex/cweb-latex/src/cweb.doc @@ -0,0 +1,1396 @@ +% $StyleId: cweb.doc,v 3.6 1995/11/30 15:44:53 schrod Exp $ +%---------------------------------------------------------------------- +% Written by Joachim Schrod . +% Copyright conditions see below (GPL). + +% +% LaTeX class cweb +% support for LaTeX markup in CWEB sources +% +% [LaTeX in MAKEPROG] +% (history at end) + +% If you have received this style file without the user manual (in the +% file cweb-user.dvi or the respective LaTeX file), it's incomplete and +% near to useless. If it was given to you as something that you shall +% use as an author -- complain bitterly to your provider. You need the +% documentation and you have a right on it! (Below you can find info +% where to get the reference version.) + + + + +\documentclass{progltx} + +\usepackage{cweb-doc} % document-specific markup +\usepackage{fullpage} + + +\RCS $StyleRevision: 3.6 $ +\RCS $StyleDate: 1995/11/30 15:44:53 $ + + +\begin{document} + + +\title{The \texttt{cweb} Class\\ + {\large (Implementation)}% + } +\author{% % LaTeX does not discard unnecessary glue... + Joachim Schrod% + \thanks{% + \protect\raggedright + TU~Darmstadt, Computer Science Department, WG Systems Programming, + Alexanderstr.~10, D-64283~Darmstadt, Germany. + Email: \texttt{jschrod@acm.org}% + }% + } +\date{% + Revision \RCSStyleRevision\\ + (as of \RCSStyleDate)% + } + +\maketitle + + +% doesn't work with progltx yet +%\tableofcontents + + + +% ------------------------------------------------------------ +% +% subdocument: The user interface of cweb.cls +% + +\input{cweb-user} + +% +% ------------------------------------------------------------ +% +% subdocument: The internal interface +% + +\input{cweb-conf} + +% +% ------------------------------------------------------------ + + + + +\chap Implementation. + +This implementation must typeset complete files output by \cweave{}. +Large parts of this task are available from the module \pkg{cwebbase}. +It remains mainly to implement document-level markup and front and +back matter (table of contents, index, etc.) In particular, the back +matter material is not trivial; its tags are behind |\end{document}|, +we have to read carefully behind the end of our \cweb{} document to +detect if we have to typeset them at all. + + +\sect This module reserves the namespace |cweb|. + +\beginprog +\ifx \cweb@loaded\undefined + \def\cweb@loaded{$StyleRevision: 3.6 $} +\else + \PackageWarningNoLine{cweb}% + {Some other package already uses namespace `cweb'} +\fi +\endprog + + +\sect Let's identify this class. + +\noindent The code below is explained in the implementation +documentation of the \pkg{rcs} package. + +\beginprog +\begingroup + \def\RCSClass#1#2 $#3: #4 #5\endRCS $#6: #7 #8\endRCS{% + \def\date{#4}\def\id{v#7}% + \ProvidesClass{#1}[\date\space\id\space #2]% + } + + \RCSClass{cweb}{LaTeX markup for CWEB sources} + $StyleDate: 1995/11/30 15:44:53 $: 9999/00/00 \endRCS + $StyleRevision: 3.6 $: 0.0 \endRCS +\endgroup +\endprog + + +\sect This module is from a supported bundle. Send bug reports, +comments and repairs. + +The reference version may be retrieved via anonymous ftp from +|ftp.th-darmstadt.de| [130.83.47.112], directory +|pub/programming/literate-programming/c.c++/|. It's +placed there as a gzipped tar file. (The information on the IP~number +is dated August~29,~1995. +It might have changed, although this is very unlikely. Use +your friendly nameserver.) + + +\sect This is freely distributable software; you can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version~2 of the +License, or (at your option) any later version. + +This software is distributed in the hope that it will be useful, but +\textbf{without any warranty}; without even the implied warranty of +\textbf{merchantability} or \textbf{fitness for a particular purpose}. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License in +the file |License| along with this package; if not, write to the Free +Software Foundation, Inc., 675~Mass Ave, Cambridge, MA~02139,~USA. + + +\sect Before we start we declare some shorthands for category codes. +By declaring the underscore~`(|_|)' as letter we can use it in our +macros. (I agree with \textsc{D.~Knuth} that +|\identifier_several_words_long| is more readable than +|\IdentifierSeveralWordsLong| and in every case better than |\p@@@s|.) + +As this is a \LaTeX{} style file the at sign is a letter anyhow; so +we can use the ``private'' \LaTeX{} macros; and with the underscore we +can make our own macros more readable. But as we have to restore this +category code at the end of this macro file we store its former value +in the control sequence |\CatUsCode|. This method is better than to +use a group because not all macros have to be defined global this way. + +Since somebody might use more styles from me, this cseqs might be +defined already. + +\beginprog +\ifx \CatEscape\undefined + \chardef\CatEscape=0 + \chardef\CatOpen=1 + \chardef\CatClose=2 + \chardef\CatIgnore=9 + \chardef\CatLetter=11 + \chardef\CatOther=12 + \chardef\CatActive=13 % is defined in Plain already + + \chardef\CatUsCode=\catcode`\_ +\fi + +\catcode`\_=\CatLetter % top level macro file +\endprog + + +\sect Problems over problems with different \LaTeX{} versions. I have +decided that I will take the same stand as the \LaTeX{} team: I will +only support the last two official \LaTeX{} versions, folks who run +older software might need to upgrade. + +The implementation will use `star'-forms of \LaTeX{}'s command +definition macros. They were introduced with \LaTeX{} +\mbox{$\langle$1994/12/01$\rangle$}. + +Currently (as of 07 Nov 95), 1995/06/01 is the most recent version. +I want to use a features introduced with that version: |\newif| is not +outer any more. So I check here for the version and supply the new +definition if necessary. + +\beginprog +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\@ifl@t@r \fmtversion{1995/06/01}{}% else + { + \@namedef{newif}#1{% + \count@\escapechar \escapechar\m@ne + \let#1\iffalse + \@if#1\iftrue + \@if#1\iffalse + \escapechar\count@ + } + \def\@if#1#2{% + \expandafter\def + \csname \expandafter\@gobbletwo\string#1% + \expandafter\@gobbletwo\string#2\endcsname {% + \let#1#2% + }% + } + } +\endprog + + + + +\chap Options. + +Our options are of the ``keyword-value'' category. We realize them by +the \pkg{keyvald} package, an enhancement of the \pkg{keyval} package +from the Graphics bundle that supports defaulting for unknown keys. + +\begin{fixme} + Most of the code below should be extracted and moved to a + \pkg{keyvalx} package (or a new version of \pkg{keyval}). In + particular, support for package/class option processing, enumeration + values, and set values for keyword options. +\end{fixme} + +|\ProcessKeyValOptions| may be used instead of |\ProcessOptions|, it +takes the keyval set identifier as argument. At the end it evaluates +and resets a hook. That hook may be used at option definition to +define further dependencies. (E.g., enabling that option implies +enabling an other option, too.) +% +\begin{fixme} + Like |\ProcessOptions|, I define |\@curroptions|, since I don't know + if that's needed later. The only place where it could been needed is + in the check for unprocessed options. +\end{fixme} + +\beginprog +\RequirePackage{keyvald} + +\let\ProcessKeyValOptionsHook\empty +\providecommand*\ProcessKeyValOptions[1]{% + \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% + \edef\next{\noexpand\setkeys{#1}{\@curroptions}}% + \next + \ProcessKeyValOptionsHook + \let\ProcessKeyValOptionsHook\empty + } +\endprog + + +\sect The enumeration option |structure| selects hierarchic~(0) or +flat~(1) structure. The predefined value is `hierarchic', there is no +default. The option value is bound to |\cweb@structure|. + +\beginprog +%% \define@key@enum{cweb}{structure}{hierarchic,flat}[hierarchic] +\@namedef{KV@cweb@structure@enum:hierarchic}{0 } % <-- space! +\@namedef{KV@cweb@structure@enum:flat}{1 } % <-- space! +\define@key{cweb}{structure}{% + \expandafter\let \expandafter\@tempa + \csname KV@cweb@structure@enum:#1\endcsname % \relax if undefined + \ifx \@tempa\relax + \PackageError{cweb}% + {% + Invalid value `#1' for option structure% + }{% +Possible valid values are `hierarchic' and `flat'.\MessageBreak +The predefined value is `hierarchic'.\MessageBreak +There's no default value, you have to specify one.% + }% + \else + \let\cweb@structure\@tempa + \fi + } +\setkeys{cweb}{structure=hierarchic} +\endprog + + +\sect With the set option |suppress| one can select suppression of +different document parts: |changehints| suppresses output of hints +that a changefile was involved, |unchanged| output of unchanged +chunks, |index| and |reflist| output of index and reference list, and +|format| output of `|@f|' directives. + +The predefined value is no suppression. There is no default value. +% +\begin{fixme} + Shouldn't I supply a default value? `|{index,reflist}|'? +\end{fixme} + +Set options are represented by flags named +|@cweb@|\