% This file generates the user manual; TeX it, don't read it!

\def\tangref{3} % where the main explanation of CTANGLing is given
\input cwebmac
\def\page{\box255 } \normalbottom
\parskip 0pt plus 1pt
\def\RA{\char'31 } % right arrow
\def\hang{\hangindent 4em\ignorespaces}
\font\eightrm=cmr8
\font\ninerm=cmr9
\font\ninett=cmtt9
\font\eighttt=cmtt8
\font\twelvett=cmtt12
\font\quoterm=cmssq8
\font\quoteit=cmssqi8
\font\authorfont=cmr12
\font\sectionfont=cmbx12

\def\pb{\.{|...|}}
\def\v{\.{\char'174}} % vertical (|) in typewriter font
\def\lpile{\def\cr{\hfill\endline}\matrix} % I only use \lpile by itself
\abovedisplayskip=.5\abovedisplayskip
\belowdisplayskip=.5\belowdisplayskip
\abovedisplayshortskip=.5\abovedisplayshortskip
\belowdisplayshortskip=.5\belowdisplayshortskip
\advance\baselineskip by -.5pt
\advance\pageheight by \baselineskip % the manual just got a bit longer
\advance\fullpageheight by \baselineskip
\setpage

\outer\def\section #1.{\penalty-500\bigskip
        \centerline{\sectionfont\def\.##1{{\twelvett##1}} #1}\nobreak\vskip 6pt
        \everypar{\hskip-\parindent\everypar{}}}

\def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
\def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
\def\runninghead{rukovodstvo pol'zovatelya {\tentt CWEB} (versiya 3.0)}

% This verbatim mode assumes that ! marks are !! in the text being copied.
\def\verbatim{\begingroup
  \def\do##1{\catcode`##1=12 } \dospecials
  \parskip 0pt \parindent 0pt \let\!=!
  \catcode`\ =13 \catcode`\^^M=13
  \tt \catcode`\!=0 \verbatimdefs \verbatimgobble}
{\catcode`\^^M=13{\catcode`\ =13\gdef\verbatimdefs{\def^^M{\ \par}\let =\ }} %
  \gdef\verbatimgobble#1^^M{}}

\null\vfill
\centerline{\titlefont The {\ttitlefont CWEB} System of
    Structured Documentation}
\vskip 18pt\centerline{(Version 3.0)}
\vskip 24pt
\centerline{\authorfont Donald E. Knuth and Silvio Levy}
\vfill

\noindent
\TeX\ is a trademark of the American Mathematical Society.

\bigskip\noindent
The printed form of this manual is copyright \copyright\ 1994
  by Addison-Wesley Publishing Company, Inc.  All rights reserved.
\smallskip\noindent
The electronic form is copyright \copyright\ 1987, 1990, 1993
  by Silvio Levy and Donald E. Knuth.
\smallskip\noindent
The russian translation is copyright \copyright\ 1999
  by Sergey V. Korop \.{<svk@lib.ru>}

\bigskip\noindent
Permission is granted to make and distribute verbatim copies of the
electronic form of this document provided that the electronic copyright
notice and this permission notice are preserved on all copies.

\smallskip\noindent
Permission is granted to copy and distribute modified versions of the
electronic form of this document under the conditions for verbatim copying,
provided that the entire resulting derived work is distributed under the terms
of a permission notice identical to this one.

\smallskip\noindent
Individuals may make copies of the documentation from the electronic files
for their own personal use.

\pageno=0 \titletrue\eject

\null\vfill
\centerline{\titlefont sISTEMA STRUKTURNOGO DOKUMENTIROVANIYA {\ttitlefont CWEB}}
\vskip 18pt\centerline{(vERSIYA 3.0)}
\vskip 24pt
\centerline{\authorfont dONALXD e. kNUT I sILXVIO lEVI}
\vfill

\noindent
\TeX\ YAVLYAETSYA TORGOVOJ MARKOJ American Mathematical Society.

\bigskip\noindent
\copyright\ 1994. pRAVAMI NA IZDANIE |TOGO RUKOVODSTVA OBLADAET
Addison-Wesley Publishing Company, Inc.  vSE PRAVA SOHRANENY.
\smallskip\noindent
\copyright\ 1987, 1990, 1993. pRAVA NA |LEKTRONNUYU FORMU |TOGO
RUKOVODSTVA  PRINADLEZHAT sILXVIO lEVI I dONALXDU e. kNUTU.
\smallskip\noindent
\copyright\ 1999. pEREVOD NA RUSSKIJ YAZYK: sERGEJ kOROP \.{<svk@lib.ru>}

\bigskip\noindent
v SLUCHAE KONFLIKTA RUSSKOGO PEREVODA USLOVIJ RASPROSTRANENIYA S IH ANGLIJSKIM
VARIANTOM, PRIORITETOM POLXZUETSYA ORIGINAL.

\bigskip\noindent
Permission is granted to make and distribute verbatim copies of the
electronic form of this document provided that the electronic copyright
notice and this permission notice are preserved on all copies.


\smallskip\noindent
Permission is granted to copy and distribute modified versions of the
electronic form of this document under the conditions for verbatim copying,
provided that the entire resulting derived work is distributed under the terms
of a permission notice identical to this one.

\smallskip\noindent
Individuals may make copies of the documentation from the electronic files
for their own personal use.

\smallskip\noindent
rAZRESHAETSYA RASPROSTRANENIE TOCHNYH KOPIJ |LEKTRONNOJ VERSII |TOGO DOKUMENTA
PRI USLOVII, CHTO SOOBSHCHENIE OB AVTORSKIH PRAVAH NA |LEKTRONNUYU VERSIYU
I |TO RAZRESHENIE PRISUTSTVUET VO VSEH KOPIYAH.


\smallskip\noindent
rAZRESHAETSYA RASPROSTRANENIE IZMENENNYH KOPIJ |LEKTRONNOJ VERSII |TOGO
DOKUMENTA NA USLOVIYAH TOCHNOGO KOPIROVANIYA, I PRI USLOVII, CHTO PROIZVODNAYA
RABOTA  RASPROSTRANYAETSYA NA USLOVIYAH, IDENTICHNYH |TIM.

\smallskip\noindent
chASTNYE LICA MOGUT DELATX KOPII DOKUMENTACII IZ |LEKTRONNYH FAJLOV
DLYA LICHNOGO ISPOLXZOVANIYA.

\pageno=0 \titletrue\eject


\titletrue
\centerline{\titlefont sISTEMA STRUKTURNOGO DOKUMENTIROVANIYA {\ttitlefont CWEB}}


\vskip 15pt plus 3pt minus 3pt
\centerline{\authorfont dONALXD e. kNUT I sILXVIO lEVI}

\vskip 24pt plus 3pt minus 3pt
\noindent
eTOT DOKUMENT YAVLYAETSYA OPISANIEM VERSII SISTEMY \.{WEB} d.~kNUTA,
ADAPTIROVANNOJ K YAZYKU \CEE/ sILXVIO lEVI. s MOMENTA SVOEGO SOZDANIYA V
1987~G., \.{CWEB} SOVMESTNYMI USILIYAMI kNUTA I lEVI VO MNOGOM BYL
MODIFICIROVAN I ULUCHSHEN.  v NASTOYASHCHIJ MOMENT MY POLAGAEM EGO |VOLYUCIYU
BLIZKOJ K ZAVERSHENIYU, NO TEM NE MENEE, SOOBSHCHENIYA OB OSHIBKAH, PREDLOZHENIYA
I KOMMENTARII VESXMA ZHELATELXNY I MOGUT NAPRAVLYATXSYA lEVI
(\.{levy@math.berkeley.edu}).

chITATELI, ZNAKOMYE S MEMORANDUMOM ``The \.{WEB} System of Structured
Documentation'' kNUTA, MOGUT LISHX BEGLO OZNAKOMITXSYA S |TIM DOKUMENTOM,
POSKOLXKU \.{CWEB} I \.{WEB} IMEYUT OBSHCHUYU FILOSOFIYU I (V OSNOVNOM)
SINTAKSIS. v NEKOTORYH VOPROSAH \.{CWEB} YAVLYAETSYA UPROSHCHENIEM \.{WEB}:
NAPRIMER, \.{CWEB} NE NUZHDAETSYA V MEHANIZMAH OPREDELENIYA MAKROSOV I
OBRABOTKI STROK \.{WEB}, POSKOLXKU YAZYK \CEE/ I EGO PREPROCESSOR BERUT
|TU RABOTU NA SEBYA. aNALOGICHNO, SOGLASHENIYA \.{WEB} OTNOSITELXNO FORMATA
VOSXMIRICHNYH I SHESTNADCATIRICHNYH CHISEL \.{@'77} I \.{@"3f} ZAMENENY
PRINYATYMI V YAZYKE \CEE/ \.{077} I \.{0x3f}. vSE PROCHIE VOZMOZHNOSTI
\.{WEB} SOHRANENY I RASSHIRENY.

mY VYRAZHAEM SVOYU BLAGODARNOSTX VSEM, KTO SVOIMI POZHELANIYAMI I ZAMECHANIYAMI
UCHASTVOVAL V RAZRABOTKE \.{CWEB}. oSOBUYU PRIZNATELXNOSTX MY PRINOSIM Steve
Avery, Nelson Beebe, Hans-Hermann Bode, Klaus Guntermann, Norman Ramsey I
Joachim Schnitter, KOTORYE PREDOSTAVILI PROGRAMMNYJ KOD, A TAKZHE Cameron
Smith, ZA MNOZHESTVO PREDLOZHENIJ PO DOKUMENTACII. Ramsey SDELAL
"GRAMOTNOE PROGRAMMIROVANIE" ("literate programming",---TAK d. kNUT NAZYVAET
METODIKU PROGRAMMIROVANIYA S ISPOLXZOVANIEM \.{CWEB}---{\sl PRIM. PEREV.\/})
DOSTUPNYM DLYA DRUGIH YAZYKOV SVOEJ SISTEMOJ
\.{SPIDER} [SM. {\sl Communications of the ACM\/ \bf32} (1989),
1051--1055].  Bode ADAPTIROVAL \.{CWEB} K YAZYKU \CPLUSPLUS/, TAK CHTO
DALEE PO TEKSTU VSE SSYLKI NA \CEE/ PODRAZUMEVAYUT I \CPLUSPLUS/.

\section vVEDENIE.
sUTX FILOSOFII \.{CWEB} V TOM, CHTO PROGRAMMISTY, ZHELAYUSHCHIE SNABDITX SVOYU
PROGRAMMU NAILUCHSHEJ DOKUMENTACIEJ, DOLZHNY ODNOVREMENNO POLXZOVATXSYA
YAZYKOM, PODOBNYM \TeX{}, DLYA PODGOTOVKI DOKUMENTACII I YAZYKOM, PODOBNYM
\CEE/, DLYA PROGRAMMIROVANIYA. nI TOT, NI DRUGOJ SAM PO SEBE NE
PREDOSTAVLYAET VSEGO NEOBHODIMOGO, NO BUDUCHI DOLZHNYM OBRAZOM OB�EDINENY,
OKAZYVAYUTSYA KUDA BOLEE POLEZNYMI, CHEM POROZNX.

sTRUKTURA KOMPXYUTERNOJ PROGRAMMY MOZHET BYTX PREDSTAVLENA, KAK ``SETX''
(``web'' --- ``PAUTINA''), SOSTOYASHCHAYA IZ MNOZHESTVA VZAIMNO ZAVISIMYH CHASTEJ.
chTOBY DOKUMENTIROVATX
TAKUYU PROGRAMMU, NEOBHODIMO OPISATX KAZHDUYU TAKUYU CHASTX I EE
VZAIMOOTNOSHENIYA S DRUGIMI. sREDSTVA OBRABOTKI TEKSTOV, PREDOSTAVLYAEMYE
\TeX{}, POZVOLYAYUT NAM OPISATX LOKALXNUYU STRUKTURU KAZHDOJ CHASTI PROGRAMMY,
A SREDSTVA PROGRAMMIROVANIYA YAZYKA \CEE/ --- FORMALXNO I ODNOZNACHNO
SPECIFICIROVATX ALGORITMY. oB�EDINIV IH, MY POLUCHAEM STILX
PROGRAMMIROVANIYA, MAKSIMALXNO SPOSOBSTVUYUSHCHIJ PONIMANIYU STRUKTURY SLOZHNYH
PROGRAMM, I ODNOVREMENNO --- HOROSHO DOKUMENTIROVANNYE PROGRAMMY, DLYA KOTORYH
AVTOMATICHESKI OBESPECHIVAETSYA VZAIMNOE SOOTVETSTVIE PROGRAMMY I DOKUMENTACII.

sISTEMA \.{CWEB} SOSTOIT IZ DVUH PROGRAMM, NAZVANNYH \.{CWEAVE} I
\.{CTANGLE}. pRI PROGRAMMIROVANII V SISTEME \.{CWEB} PROGRAMMA NA YAZYKE
\CEE/ I DOKUMENTACIYA K NEJ OB�EDINENY V ODNOM FAJLE, NAZYVAEMOM
\.{CWEB}-FAJL, S IMENEM VRODE \.{something.w}. kOMANDA
`\.{cweave} \.{something}' SOZDAET FAJL \.{something.tex}, KOTORYJ S
POMOSHCHXYU \TeX{} PREVRASHCHAETSYA V KRASIVO OFORMLENNUYU (``pretty printed'')
VERSIYU \.{something.w},
KOTORAYA SOBLYUDAET VSE TIPOGRAFSKIE SOGLASHENIYA, TAKIE KAK DIZAJN
STRANICY, ISPOLXZOVANIE OTSTUPOV, KURSIVNYH I ZHIRNYH SHRIFTOV,
MATEMATICHESKIH SIMVOLOV. dOPOLNITELXNO AVTOMATICHESKI STROITSYA SISTEMA
PEREKRESTNYH SSYLOK. aNALOGICHNO, KOMANDA `\.{ctangle} \.{something}'
POROZHDAET PROGRAMMU NA YAZYKE \CEE/ \.{something.c}, KOTORAYA MOZHET BYTX
OTKOMPILIROVANA V ISPOLNIMYJ KOD.

pOMIMO PREDOSTAVLENIYA UDOBNOGO SREDSTVA DOKUMENTIROVANIYA, \.{CWEB}
RASSHIRYAET YAZYK \CEE/ VOZMOZHNOSTXYU MENYATX MESTAMI CHASTI TEKSTA PROGRAMMY,
TAK CHTO BOLXSHIE PROGRAMMNYE SISTEMY MOGUT BYTX VOSPRINYATY CELIKOM V
TERMINAH NEBOLXSHIH SEKCIJ I IH LOKALXNYH VZAIMOSVYAZEJ. pROGRAMMA \.{CTANGLE}
NAZVANA TAK POTOMU, CHTO ONA RASSTAVLYAET SEKCII web-STRUKTURY V PORYADKE,
TREBUEMOM \CEE/; PREIMUSHCHESTVOM PROGRAMMIROVANIYA V \.{CWEB} YAVLYAETSYA TO,
CHTO ALGORITMY MOGUT BYTX VYRAZHENY V "RAZVERNUTOJ" FORME, V KOTOROJ
KAZHDAYA SEKCIYA OB�YASNYAETSYA OTDELXNO OT DRUGIH. pROGRAMMA \.{CWEAVE}, V
SOOTVETSTVII SVOEMU NAZVANIYU, "SPLETAET" SODERZHASHCHIESYA V KAZHDOJ SEKCII
\TeX I \CEE/-CHASTI V STRUKTURIROVANNYJ DOKUMENT. vOZMOZHNO, NE SLUCHAJNO
NEMECKIM |KVIVALENTOM ``weave'' YAVLYAETSYA ``{\it webe\/}'', A
SOOTVETSTVUYUSHCHIJ IM LATINSKIJ IMPERATIV --- ``{\it texe\/}''!

pOLXZOVATELX \.{CWEB} DOLZHEN BYTX HOROSHO ZNAKOM S YAZYKOM \CEE/.
mINIMALXNOE ZNAKOMSTVO S \TeX{} TAKZHE ZHELATELXNO, NO FAKTICHESKI MOZHET
BYTX POLUCHENO UZHE V PROCESSE RABOTY S \.{CWEB}, POSKOLXKU PROSTOJ TEKST
PODGOTAVLIVAETSYA V \TeX{} PRAKTICHESKI BEZ KAKOGO-LIBO ZNANIYA EGO
YAZYKA. tEM, KTO HOROSHO ZNAKOM S OBEIMI SISTEMAMI POTREBUYUTSYA SOVSEM
NEBOLXSHIE USILIYA, CHTOBY IZUCHITX KOMANDY \.{CWEB}.

\section oBZOR.
sODERZHIMYM FAJLOV \.{CWEB} MOZHET BYTX \TeX{}-TEKST I \CEE/-TEKST.
\.{CWEB}-PROGRAMMIST DOLZHEN CHETKO PREDSTAVLYATX VSE PROISHODYASHCHEE S NIMI
KAK V PROCESSE GENERACII DOKUMENTACII, TAK I PROGRAMMY, T.E. ZNATX SUTX
VSEH TEH DEJSTVIJ, KOTORYE BUDUT PROIZVODITXSYA NAD \.{CWEB}-FAJLOM
PROGRAMMAMI \.{CWEAVE} I \.{CTANGLE}. tEKST V FORMATE \TeX{} POLNOSTXYU
KOPIRUETSYA PROGRAMMOJ \.{CWEAVE} I IGNORIRUETSYA \.{CTANGLE}, |TO "CHISTAYA
DOKUMENTACIYA". s DRUGOJ STORONY, \CEE/-PROGRAMMA FORMATIRUETSYA
\.{CWEAVE} I PREOBRAZUETSYA \.{CTANGLE} PO PRAVILAM, KOTORYE BUDUT STROGO
OPREDELENY POZDNEE. v NASTOYASHCHIJ MOMENT DOSTATOCHNO PONYATX, CHTO SUSHCHESTVUET
DVE RAZNOVIDNOSTI TEKSTA. sOZDANIE \.{CWEB}-PROGRAMMY V CHEM-TO SHOZHE S
PODGOTOVKOJ DOKUMENTA \TeX{} S ISPOLXZOVANIEM DOPOLNITELXNOJ
``\CEE/-MODY'', PODOBNOJ IMEYUSHCHIMSYA V \TeX{} GORIZONTALXNOJ, VERTIKALXNOJ
I MATEMATICHESKOJ MODAM.

\.{CWEB}-FAJL SODERZHIT {\sl SEKCII\/}, KOTORYE BOLEE ILI MENEE
SAMODOSTATOCHNY. kAZHDAYA SEKCIYA SOSTOIT IZ TREH CHASTEJ:

\yskip\item{$\bullet$} \TEX/-CHASTX, SODERZHASHCHAYA MATERIAL, RAZ�YASNYAYUSHCHIJ
SUTX SODERZHIMOGO SEKCII.

\item{$\bullet$} pROMEZHUTOCHNAYA (middle) CHASTX SODERZHIT
MAKROOPREDELENIYA, SLUZHASHCHIE SOKRASHCHENIYAMI DLYA \CEE/-KONSTRUKCIJ, KOTORYE
NEUDOBNO VYPISYVATX KAZHDYJ RAZ ZANOVO. oNI PREOBRAZUYUTSYA \.{CTANGLE} V
MAKROSY PREPROCESSORA.

\item{$\bullet$} \CEE/-CHASTX, SODERZHASHCHAYA CHASTX PROGRAMMY, GENERIRUEMOJ
\.{CTANGLE}. dLINA \CEE/-CHASTI V IDEALE NE DOLZHNA PREVYSHATX DYUZHINY
STROCHEK, CHTOBY ONA SOSTAVLYALA ZAKONCHENNYJ
FRAGMENT PROGRAMMY I BYLA LEGKO PONIMAEMOJ.

\yskip\noindent tRI CHASTI KAZHDOJ SEKCII DOLZHNY RASPOLAGATXSYA V |TOM
PORYADKE, T.E. \TeX-KOMMENTARIJ DOLZHEN SLEDOVATX PERVYM, ZATEM
PROMEZHUTOCHNAYA CHASTX I, NAKONEC, \CEE/-KOD. lYUBAYA IZ |TIH CHASTEJ MOZHET
BYTX PUSTOJ.

sEKCIYA NACHINAETSYA LIBO `\.{@\ }', LIBO `\.{@*}', GDE `\.{\ }' OZNACHAET
SIMVOL "PROBEL". sEKCIYA ZAKANCHIVAETSYA NACHALOM SLEDUYUSHCHEJ SEKCII, T.E.
SLEDUYUSHCHIM `\.{@\ }' ILI `\.{@*}', LIBO KONCOM FAJLA. \.{CWEB}-FAJL MOZHET
SODERZHATX PROIZVOLXNYJ TEKST, RASPOLAGAYUSHCHIJSYA PERED NACHALOM PERVOJ
SEKCII I NE VHODYASHCHIJ NI V ODNU IZ SEKCIJ. pODOBNYJ TEKST DALEE BUDEM
IMENOVATX "PREAMBULOJ" (``in limbo''), ON IGNORIRUETSYA \.{CTANGLE} I
POLNOSTXYU KOPIRUETSYA \.{CWEAVE}, TAK CHTO EGO NAZNACHENIE SOSTOIT V OPREDELENII
PROIZVOLXNYH INSTRUKCIJ \TeX'A. kAK PRAVILO, |TI INSTRUKCII ZAGRUZHAYUT
TREBUEMYE SHRIFTY, OPREDELYAYUT MAKROSY, IZMENYAYUT RAZMERY STRANICY I/ILI
GENERIRUYUT TITULXNYJ LIST.

sEKCII NUMERUYUTSYA POSLEDOVATELXNO, NACHINAYA S~1. eTI NOMERA POYAVLYAYUTSYA V
NACHALE KAZHDOJ SEKCII V \TeX-DOKUMENTE, POLUCHENNOM \.{CWEAVE}, A TAKZHE V
KOMMENTARIYAH, OTMECHAYUSHCHIH NACHALO I KONEC KAZHDOJ SEKCII V \CEE/-PROGRAMME,
SGENERIROVANNOJ \.{CTANGLE}.

\section iMENA SEKCIJ.
k SCHASTXYU, NET NIKAKOJ NADOBNOSTI NUMEROVATX SEKCII VRUCHNUYU. pROSTO
POMESTITE `\.{@\ }' LIBO `\.{@*}' V NACHALE KAZHDOJ NOVOJ SEKCII, I IH
NOMERA BUDUT SGENERIROVANY \.{CWEAVE} I \.{CTANGLE} AVTOMATICHESKI. pRI
NEOBHODIMOSTI SEKCII MOZHET BYTX PRISVOENO {\sl IMYA} VMESTO NOMERA. iMYA
NACHINAETSYA `\.{@<}', DALEE SLEDUET PROIZVOLXNYJ TEKST \TEX/, A ZATEM ---
`\.{@>}'. kOGDA \.{CWEAVE} VYVODIT IMYA SEKCII, `\.{@<}' I `\.{@>}'
ZAMENYAYUTSYA UGLOVYMI SKOBKAMI, I DOBAVLYAETSYA NOMER SEKCII BOLEE MELKIM
SHRIFTOM. pO|TOMU, KOGDA VY CHITAETE VYVOD \.{CWEAVE}, LEGKO PROSLEDITX
VSE VZAIMOSVYAZI MEZHDU SEKCIYAMI.

dLYA NAGLYADNOSTI IMYA SEKCII DOLZHNO BYTX HOROSHIM OPISANIEM SODERZHIMOGO
SEKCII, T.E. POYASNYATX ABSTRAKCIYU, PREDSTAVLENNUYU SEKCIEJ. vPOSLEDSTVIE
SEKCIYA MOZHET BYTX "VSTROENA" V DRUGIE SEKCII TAK, CHTO MALOZNACHIMYE
DETALI EE REALIZACII OKAZHUTSYA SKRYTYMI. iMYA SEKCII, SLEDOVATELXNO, DOLZHNO
BYTX DOSTATOCHNO DLINNYM, CHTOBY VYRAZITX PRI |TOM EE SUTX.

k SOZHALENIYU, UTOMITELXNO I CHREVATO OSHIBKAMI PISATX DLINNOE IMYA SEKCII
SNOVA I SNOVA. pO|TOMU \.{CTANGLE} I \.{CWEAVE} POZVOLYAYUT
ISPOLXZOVATX SOKRASHCHENIYA. vSYAKIJ RAZ, KOGDA V \.{CWEB}-FAJLE DOLZHNO
POYAVITXSYA IMYA SEKCII, VY MOZHETE ISPOLXZOVATX `\.{@<$\alpha$...@>}', GDE
$\alpha$ --- LYUBAYA STROKA, YAVLYAYUSHCHAYASYA PREFIKSOM POLNOGO IMENI. nAPRIMER,
`\.{@<Clear the arrays@>}' MOZHET BYTX SOKRASHCHENO DO `\.{@<Clear...@>}',
ESLI NIKAKOE DRUGOE IMYA SEKCII NE NACHINAETSYA S `\.{Clear}'. aNALOGICHNO
MOZHNO ISPOLXZOVATX SOKRASHCHENIE `\.{@<Clear t...@>}' I T.D.

iMENA SEKCIJ V PROCHIH SLUCHAYAH DOLZHNY SOVPADATX POSIMVOLXNO, ZA
ISKLYUCHENIEM POSLEDOVATELXNOSTEJ PROBELXNYH SIMVOLOV (SOBSTVENNO PROBELA,
SIMVOLOV TABULYACII, KONCA STROKI I/ILI STRANICY), KOTORYE TRAKTUYUTSYA KAK
ODIN PROBEL. v NACHALE I KONCE IMENI VSE PROBELXNYE SIMVOLY BUDUT
OTBROSHENY. tAK,  `\.{@< Clear { }the arrays @>}' BUDET SOOTVETSTVOVATX
IMENI V PREDYDUSHCHEM PRIMERE. pROBELXNYE SIMVOLY POSLE MNOGOTOCHIYA TAKZHE
BUDUT IGNORIROVATXSYA, NO NE PERED NIM, TAK CHTO `\.{@<Clear t ...@>}' NE
SOOTVETSTVUET `\.{@<Clear the arrays@>}'.

\section chTO DELAET \.{CTANGLE}.
kAK BYLO SKAZANO VYSHE, SEKCIYA NACHINAETSYA `\.{@\ }' LIBO `\.{@*}', NO
NICHEGO --- O TOM, KAK ONA DELITSYA NA \TeX-CHASTX, PROMEZHUTOCHNUYU I
\CEE/-CHASTI. pROMEZHUTOCHNAYA CHASTX NACHINAETSYA S PERVYM POYAVLENIEM V TELE
SEKCII `\.{@d}' LIBO `\.{@f}', A \CEE/-CHASTX NACHINAETSYA PERVYM `\.{@c}'
ILI `\.{@<section name@>=}'. v POSLEDNEM SLUCHAE IMYA PRISVAIVAETSYA DANNOJ
\CEE/-SEKCII, ESLI ZHE SEKCIYA NACHATA `\.{@c}', TO ONA BUDET {\sl
NEIMENOVANNOJ}.

kONSTRUKCIYA `\.{@<section name@>}' MOZHET POYAVITXSYA V TELE \CEE/-SEKCII
PROIZVOLXNOE KOLICHESTVO RAZ: POSLEDUYUSHCHIE SSYLKI NA IMYA OZNACHAYUT EGO
"ISPOLXZOVANIE", A NE "OB�YAVLENIE", T.E. CHTO IMENOVANNAYA SEKCIYA,
OPREDELENNAYA GDE-LIBO ESHCHE, DOLZHNA BYTX VSTAVLENA V |TO MESTO
\CEE/-PROGRAMMY. dEJSTVITELXNO, OSNOVNAYA IDEYA \.{CTANGLE} --- SOZDATX
PROGRAMMU, OB�EDINIV NEKOTOROE KOLICHESTVO IMENOVANNYH I NEIMENOVANNYH
SEKCIJ. tOCHNYE PRAVILA TAKOGO OB�EDINENIYA TAKOVY: VNACHALE VSE
MAKROOPREDELENIYA, OTMECHENNYE `\.{@d}' PREOBRAZUYUTSYA V INSTRUKCII
PREPROCESSORA I SOBIRAYUTSYA V NACHALE FAJLA. dALEE TUDA KOPIRUYUTSYA
NEIMENOVANNYE \CEE/-SEKCII. tAK OBRAZUETSYA PERVOE PRIBLIZHENIE TEKSTA
PROGRAMMY (DOLZHNA SUSHCHESTVOVATX HOTYA BY ODNA NEIMENOVANNAYA SEKCIYA). zATEM
VSE IMENA SEKCIJ, NAJDENNYE V POLUCHENNOM TEKSTE, ZAMENYAYUTSYA
\CEE/-CHASTYAMI SOOTVETSTVUYUSHCHIH SEKCIJ I |TOT PROCESS PODSTANOVKI
PRODOLZHAETSYA DO RAZRESHENIYA VSEH SSYLOK. vSE KOMMENTARII UDALYAYUTSYA,
POSKOLXKU POLUCHENNAYA PROGRAMMA NA \CEE/ NE PREDNAZNACHAETSYA DLYA CHTENIYA
CHELOVEKOM.

eSLI ODNO I TO ZHE IMYA BYLO DANO BOLEE CHEM ODNOJ SEKCII, \CEE/-FRAGMENT
POLUCHAETSYA OB�EDINENIEM \CEE/-CHASTEJ VSEH TAKIH SEKCIJ. eTO OKAZYVAETSYA
POLEZNYM, NAPRIMER, ESLI IMEETSYA SEKCIYA S IMENEM `Global variables', V
KOTOROJ BUDUT SOBRANY VSE GLOBALXNYE PEREMENNYE, GDE BY ONI NI BYLI
OB�YAVLENY.
kOGDA NESKOLXKO SEKCIJ IMEYUT ODINAKOVOE IMYA, \.{CWEAVE} POLAGAET NOMER
PERVOJ IZ NIH NOMEROM, SOOTVETSTVUYUSHCHIM |TOMU IMENI, I ONA VSTAVLYAET V
KONEC SEKCII SSYLKU: `See also sections~\dots' ("sM. TAKZHE
SEKCII~\dots"),  V KOTOROJ
PERECHISLENY NOMERA VSEH OSTALXNYH SEKCIJ, IMEYUSHCHIH |TO ZHE IMYA.
sOOTVETSTVUYUSHCHIJ \CEE/-TEKST FORMATIRUETSYA \.{CWEAVE} TAK, CHTO VMESTO
ZNAKA RAVENSTVA V VYHODNOM DOKUMENTE PRISUTSTVUET ZNAK |KVIVALENTNOSTI,
T.E. `$\langle\,$section name$\,\rangle\equiv\null$\CEE/ text'.
pRI |TOM V POSLEDUYUSHCHIH SEKCIYAH S |TIM IMENEM ZNAK  `$\equiv$' ZAMENYAETSYA
NA `$\mathrel+\equiv$', UKAZYVAYUSHCHIM NA TO, CHTO \CEE/-FRAGMENT |TOJ SEKCII
BUDET DOBAVLEN K FRAGMENTU DRUGOJ SEKCII.

kOGDA \.{CTANGLE} NACHINAET I OKANCHIVAET OBRABOTKU SEKCII, ONA VSTAVLYAET
V VYHODNOJ FAJL DIREKTIVY PREPROCESSORA \.{\#line}, TAK CHTO NOMERA STROK
V SOOBSHCHENIYAH OB OSHIBKAH I PRI OTLADKE PROGRAMMY BUDUT SSYLATXSYA NA
ISHODNYJ \.{CWEB}-FAJL. bLAGODARYA |TOMU, V BOLXSHINSTVE SLUCHAEV O
POLUCHAEMOM \CEE/-FAJLE MOZHNO PROSTO ZABYTX.

\section chTO DELAET \.{CWEAVE}. oBSHCHAYA IDEYA \.{CWEAVE} --- SOZDATX IZ
FAJLA \.{CWEB} FAJL \.{.tex} TAKIM OBRAZOM: PERVAYA STROKA POLUCHAEMOGO
FAJLA \.{.tex} UKAZYVAET \TeX'U ZAGRUZITX FAJL MAKROOPREDELENIJ,
OPISYVAYUSHCHIH FORMAT \.{CWEB}-DOKUMENTOV. dALEE V \.{tex}-FAJL KOPIRUETSYA
TEKST PREAMBULY, RASPOLOZHENNYJ PERED PERVOJ SEKCIEJ. zATEM SLEDUET PO
OCHEREDI VYVOD KAZHDOJ SEKCII, VOZMOZHNO VPEREMESHKU S KOMANDAMI OKONCHANIYA
STRANICY. nAKONEC, \.{CWEAVE} GENERIRUET SISTEMU PEREKRESTNYH SSYLOK: DLYA
KAZHDOGO \CEE/-IDENTIFIKATORA UKAZYVAYUTSYA NOMERA VSEH SEKCIJ, V KOTORYH
ON ISPOLXZUETSYA, A TAKZHE STROITSYA ALFAVITNYJ SPISOK VSEH IMEN SEKCIJ, A
TAKZHE OGLAVLENIE, SODERZHASHCHEE NOMERA STRANIC I SEKCIJ DLYA VSEH
``ZAGLAVNYH'' SEKCIJ.

vY SPROSITE,  CHTO TAKOE ``ZAGLAVNAYA'' SEKCIYA (``starred-section'')?
sEKCII, KOTORYE NACHINAYUTSYA
`\.{@*}' VMESTO `\.{@\ }' OBOZNACHAYUT NACHALO NOVOJ GRUPPY SEKCIJ.  pOSLE
`\.{@*}' UKAZYVAETSYA IMYA GRUPPY, OKANCHIVAYUSHCHEESYA TOCHKOJ. tAKIE GRUPPY V
DOKUMENTE \TEX/ VSEGDA NACHINAYUT NOVUYU STRANICU, I IH IMYA ISPOLXZUETSYA V
KOLONTITULE VSEH POSLEDUYUSHCHIH STRANIC DO POYAVLENIYA OCHEREDNOJ
ZAGLAVNOJ SEKCII. iMYA GRUPPY TAKZHE ZANOSITSYA V OGLAVLENIE I PECHATAETSYA V
NACHALE SEKCII ZHIRNYM SHRIFTOM. pREDOSTEREZHENIE: NE ISPOLXZUJTE V TAKIH
IMENAH UPRAVLYAYUSHCHIH PREDLOZHENIJ \TeX'A, ESLI VY NE UVERENY, CHTO
MAKROOPREDELENIYA IZ \.{cwebmac} NE KONFLIKTUYUT S NIMI. pRICHINOJ |TOMU
SLUZHIT TO, CHTO IMYA GRUPPY BUDET PREOBRAZOVANO V VERHNIJ REGISTR, KOGDA
ONO POYAVLYAETSYA V KOLONTITULE, A TAKZHE BUDET VYVEDENO ZHIRNYM SHRIFTOM V
NACHALE SEKCII I ZAPISANO VO VREMENNYJ FAJL-OGLAVLENIE, TAK CHTO
ISPOLXZUEMYE KOMANDY DOLZHNY RABOTATX PRAVILXNO VO VSEH |TIH REZHIMAH.

\TeX-FAJL, POLUCHENNYJ S POMOSHCHXYU \.{CWEAVE}, DLYA KAZHDOJ SEKCII SODERZHIT
SLEDUYUSHCHEE: VO-PERVYH, NOMER SEKCII (T.E. `\.{\\M123.}' V NACHALE SEKCII
NOMER 123, ZA ISKLYUCHENIEM ZAGLAVNYH SEKCIJ, V NACHALE KOTORYH VMESTO
`\.{\\M}' SLEDUET `\.{\\N}'). dALEE SLEDUET \TeX-CHASTX SEKCII,
SKOPIROVANNAYA POCHTI DOSLOVNO, KAK OPISANO NIZHE. vSLED ZA |TIM IDUT
PROMEZHUTOCHNAYA I \CEE/-CHASTI SEKCII, RAZDELENNYE NEBOLXSHIM PROMEZHUTKOM,
ESLI ONI OBE NEPUSTYE. eTI DVE CHASTI POLUCHENY VSTAVKOJ MNOZHESTVA
ZATEJLIVYH \TeX-MAKROSOV V \CEE/-PROGRAMMU. eTI MAKROSY UPRAVLYAYUT
TIPOGRAFSKIMI PODROBNOSTYAMI, TAKIMI, KAK SHRIFTY, PRAVILXNAYA
RASSTANOVKA PROBELOV V MATEMATICHESKIH FORMULAH, RAZBIENIE NA STROKI I
OTSTUPY.

\section \CEE/-KOD V TEKSTE \TeX'A I NAOBOROT.
kOGDA VY NABIRAETE \TeX-TEKST, VOZMOZHNO, CHTO VAM PONADOBITSYA
SOSLATXSYA NA PEREMENNYE I DRUGIE OB�EKTY \CEE/-PROGRAMMY, PRICHEM
ZHELATELXNO, CHTOBY IH OFORMLENIE SOOTVETSTVOVALO TOMU, CHTO ISPOLXZUETSYA V
PROGRAMME. dLYA |TOGO \.{CWEB} PREDUSMATRIVAET VOZMOZHNOSTX RAZMESTITX V
TELE \TeX-TEKSTA KONSTRUKCII YAZYKA \CEE/, OGRANICHIV IH SIMVOLAMI `\.|'.
nAPRIMER, PUSTX MY HOTIM NAPISATX CHTO-TO VRODE
$$\hbox{ If \\{pa} is declared as `\&{int} ${}{*}\\{pa}$',
the assignment $\\{pa}\K{\AND}\|a[\T{0}]$ makes \\{pa}
point to the zeroth element of \|a.}$$
tEKST NA YAZYKE \TeX\ V  \.{CWEB}-FAJLE BUDET TAKIM:
$$\lpile{\.{If |pa| is declared as `|int *pa|', the}\cr
\.{assignment |pa=\&a[0]| makes |pa| point
to the zeroth element of |a|.}\cr}$$
i NAKONEC, \.{CWEAVE} PREOBRAZUET EGO V NECHTO TAKOE, CHTO NIKOMU NE
ZAHOTELOSX BY VVODITX VRUCHNUYU:
$$\lpile{\.{If \\\\\{pa\} is declared as
  `\\\&\{int\} \$\{\}\{*\}\\\\\{pa\}\$',}\cr
\.{the assignment \$\\\\\{pa\}\\K\{\\AND\}\\|a[\\T\{0\}]\$}\cr
\.{makes \\\\\{pa\} point to the zeroth element of \\|a.}\cr}$$
oTMETIM, CHTO TABLICA PEREKRESTNYH SSYLOK, SOZDANNAYA \.{CWEAVE}, DLYA
PODOBNOGO KOMMENTARIYA BUDET VKLYUCHATX
NOMER TEKUSHCHEJ SEKCII V SPISKE SSYLOK NA \\{pa}
NESMOTRYA NA TO, CHTO \\{pa} MOZHET I NE POYAVITXSYA V \CEE/-CHASTI |TOJ
SEKCII. dEJSTVITELXNO, INDEKS VKLYUCHAET SSYLKI NA IDENTIFIKATORY V
POYASNYAYUSHCHIH KOMMENTARIYAH TAK ZHE, KAK I V SAMOJ PROGRAMME; CHTOBY OCENITX
|TU VOZMOZHNOSTX NE POTREBUETSYA MNOGO VREMENI.
v TO ZHE VREMYA, IDENTIFIKATORY
\&{int} I \|a\ V INDEKS NE POPADUT,
POTOMU CHTO \.{CWEAVE} NE POMESHCHAET V INDEKS ZAREZERVIROVANNYE SLOVA I
ODNOBUKVENNYE IDENTIFIKATORY. tAKIE IDENTIFIKATORY POLAGAYUTSYA STOLX
VEZDESUSHCHIMI, CHTO NET SMYSLA PERECHISLYATX VSE MESTA, GDE ONI VSTRECHAYUTSYA.

nESMOTRYA NA TO, CHTO SEKCIYA NACHINAETSYA \TEX/-CHASTXYU I ZAKANCHIVAETSYA
\CEE/-CHASTXYU, GRANICA MEZHDU NIMI TOCHNO NE OPREDELENA, POSKOLXKU
\CEE/-KOD MOZHET BYTX VKLYUCHEN V TEKST \TEX/, ESLI ON OGRANICHEN `\pb'.
aNALOGICHNO, TEKST \TEX/ ZACHASTUYU POYAVLYAETSYA VNUTRI \CEE/-KODA, POSKOLXKU
VSE, CHTO SCHITAETSYA KOMMENTARIEM (T.E. VSE VNUTRI \.{/*} I \.{*/}, LIBO POSLE
\.{//}) INTERPRETIRUETSYA KAK TEKST \TEX/. tOCHNO TAK ZHE IMYA SEKCII
SODERZHIT TEKST \TEX/, NO KONSTRUKCIYA \.{@<IMYA SEKCII@>} CELIKOM MOZHET
ISPOLXZOVATXSYA V \CEE/-KODE; SLEDOVATELXNO, PEREHOD MEZHDU REZHIMAMI \CEE/
I~\TEX/ OSUSHCHESTVLYAETSYA ESTESTVENNO, KAK V |TIH PRIMERAH:
$$
\displaylines{
\hbox{\.{if} \.{(x==0)} \.{@<Empty} \.{the} \.{|buffer|} \.{array@>}} \cr
\hbox{\.{...} \.{using}  \.{the} \.{algorithm}
\.{in} \.{|@<Empty} \.{the} \.{|buffer|} \.{array@>|.}} }
$$
pERVYJ IZ NIH MOZHET BYTX NAJDEN V \CEE/-CHASTI SEKCII, V KOTORUYU BUDET
VSTAVLEN KOD IZ SEKCII, NAZVANNOJ ``Empty the \\{buffer} array''. vTOROJ
PRIMER IZ \TEX/-CHASTI SEKCII, KOTORAYA LISHX SSYLAETSYA NA DRUGUYU SEKCIYU,
NO NE OPREDELYAET I NE ISPOLXZUET EE. (oBRATITE VNIMANIE NA `\pb' VOKRUG
IMENI SEKCII V |TOM SLUCHAE.)

\section mAKROOPREDELENIYA.
uPRAVLYAYUSHCHIJ KOD \.{@d}, ZA KOTORYM SLEDUET
$$\\{identifier}\.{ }\hbox{\CEE/-KOD}\qquad\hbox{LIBO}\qquad
\\{identifier}\.(\\{par}_1,\ldots,\\{par}_n\.{) }\hbox{\CEE/-KOD}$$
(\\{identifier} I SKOBKA VO VTOROM SLUCHAE NE DOLZHNY RAZDELYATXSYA
PROBELAMI) PREOBRAZUETSYA \.{CTANGLE} V DIREKTIVU PREPROCESSORA
\.{\#define}, KOTORYE RASPOLAGAYUTSYA V NACHALE GENERIRUEMOJ
\CEE/-PROGRAMMY, KAK OPISANO RANEE.

mAKROOPREDELENIE `\.{@d}' MOZHET BYTX RAZBITO NA NESKOLXKO STROK, PRICHEM
NE NUZHNO STAVITX V KONCE STROKI `\.{\\}' --- IH AVTOMATICHESKI
VSTAVIT \.{CTANGLE}. eSLI PO KAKOJ-TO PRICHINE POTREBUETSYA DIREKTIVA
\.{\#define} V KONKRETNOJ TOCHKE \CEE/-FAJLA, MOZHNO ZADATX EE V
\CEE/-KODE, A NE S POMOSHCHXYU \.{CWEB}, NO V |TOM SLUCHAE PRIDETSYA
MASKIROVATX SIMVOLY PEREVODA STROKI SAMOSTOYATELXNO.

\section sTROKI I KONSTANTY.
eSLI VAM NUZHNA V \CEE/-KODE STROKOVAYA KONSTANTA, OGRANICHENNAYA \.' ILI
\.", EE MOZHNO ZADATX KAK OBYCHNO, ZA ISKLYUCHENIEM TOGO, CHTO SIMVOL `\.@'
DOLZHEN BYTX PREDSTAVLEN `\.{@@}' (|TO EDINSTVENNYJ UPRAVLYAYUSHCHIJ SIMVOL,
KOTORYJ MOZHET POYAVLYATXSYA VNUTRI STROKI, SM. DALEE). sTROKOVYE KONSTANTY NE
DOLZHNY SODERZHATX SIMVOLOV PEREVODA STROKI, ESLI ONI NE
ZAMASKIROVANY~`\.{\\}'.

\TEX/ I \CEE/ PREDLAGAYUT RAZLICHNYE SPOSOBY ZADANIYA VOSXMERICHNYH I
SHESTNADCATIRICHNYH KONSTANT, POSKOLXKU \TEX/ ORIENTIROVAN NA PODGOTOVKU
TEKSTA CHELOVEKOM, A \CEE/ --- NA MASHINNUYU OBRABOTKU. v \TEX/ KONSTANTA
OB�YAVLYAETSYA VOSXMERICHNOJ ILI SHESTNADCATIRICHNOJ S POMOSHCHXYU PREFIKSA \.'
LIBO~\." SOOTVETSTVENNO; V \CEE/ PREFIKSY IMEYUT VID \.0 I \.{0x}.
v~\.{CWEB} RAZRESHENO ISPOLXZOVATX OBA SOGLASHENIYA TAM, GDE ONI PRINYATY: V
\CEE/-KODE CHTOBY POLUCHITX $40_8$ ZADAETSYA `\.{040}' I \.{CTANGLE} BEZ
IZMENENIJ KOPIRUET |TO V \CEE/-FAJL K UDOVOLXSTVIYU KOMPILYATORA, A \.{CWEAVE}
PECHATAET KAK $\T{\~40}$. aNALOGICHNO, \.{CWEAVE} PECHATAET SHESTNADCATIRICHNUYU
\CEE/-KONSTANTU  `\.{0x20}' KAK \T{\^20}. iSPOLXZOVANIE KURSIVA DLYA
VOSXMERICHNYH CIFR I SHRIFTA PISHUSHCHEJ MASHINKI DLYA SHESTNADCATIRICHNYH ULUCHSHAET
VOSPRIYATIE |TIH KONSTANT V DOKUMENTE.  dLYA SOHRANENIYA OBSHCHNOSTI MOZHNO
ISPOLXZOVATX `\.{|040|}' I~`\.{|0x20|}' V \TEX/-CHASTI SEKCII.

\section uPRAVLYAYUSHCHIE SIMVOLY.
{\sl uPRAVLYAYUSHCHIJ SIMVOL (control code)\/} \.{CWEB} --- |TO KOMBINACIYA
DVUH SIMVOLOV, IZ KOTORYH PERVYJ `\.@'. mY UZHE OZNAKOMILISX S
NAZNACHENIEM NEKOTORYH IZ NIH, A TEPERX IZLOZHIM |TO BOLEE TOCHNO.

v NIZHESLEDUYUSHCHEM SPISKE BUKVY V KVADRATNYH SKOBKAH UKAZYVAYUT KONTEKST, V
KOTOROM KAZHDYJ UPRAVLYAYUSHCHIJ SIMVOL IMEET SMYSL. $L$ OZNACHAET, CHTO SIMVOL
DOPUSTIM V PREAMBULE, $T$ (\TEX/), $M$ (middle) I $C$ --- V KAZHDOJ IZ
TREH CHASTEJ SEKCII NA VERHNEM UROVNE (T.E. VOVNE KONSTRUKCII `\pb' I
IMEN SEKCIJ). sTRELKA $\to$ OBOZNACHAET, CHTO UPRAVLYAYUSHCHIJ SIMVOL ZAVERSHAET
TEKUSHCHUYU CHASTX \.{CWEB}-FAJLA I NACHINAET SLEDUYUSHCHUYU CHASTX, UKAZANNUYU
BUKVOJ POSLE STRELKI. nAPRIMER, $[LTMC\to T]$ POSLE \.{@\ } ZNACHIT, CHTO
UPRAVLYAYUSHCHIJ KOD MOZHET POYAVITXSYA V PREAMBULE LIBO V LYUBOJ IZ TREH CHASTEJ
SEKCII, I CHTO ON NACHINAET \TEX/-CHASTX (VOZMOZHNO PUSTUYU) TEKUSHCHEJ SEKCII.

eSHCHE DVA SOKRASHCHENIYA MOGUT BYTX UKAZANY V |TIH KVADRATNYH SKOBKAH:
bUKVA~$r$ OZNACHAET {\it OGRANICHENNYJ KONTEKST (restricted context)}, TO
ESTX, SODERZHIMOE \CEE/-KOMMENTARIEV, IMEN SEKCIJ, \CEE/-STROK I
UPRAVLYAYUSHCHIH TEKSTOV (OPREDELENY DALEE). bUKVA $c$ --- |TO
{\it VNUTRENNIJ \CEE/-KONTEKST (inner \CEE/ context)} ILI \CEE/-KOD
VNUTRI`\pb' (VKLYUCHAYA KOMMENTARII VNUTRI `\pb', NO NE V DRUGIH
OGRANICHENNYH KONTEKSTAH). zVEZDOCHKA $*$ POSLE SKOBOK UKAZYVAET, CHTO
|TIM UPRAVLYAYUSHCHIM SIMVOLOM NACHINAETSYA OGRANICHENNYJ KONTEKST, KOTORYJ
ZAVERSHAETSYA PARNOJ \.{@>}

bUKVY V UPRAVLYAYUSHCHIH SIMVOLAH NE RAZLICHAYUTSYA PO REGISTRU. tAK, \.{@d}
OZNACHAET TO ZHE SAMOE, CHTO I \.{@D}. dALEE RASSMOTRENY TOLXKO SIMVOLY S
BUKVAMI NIZHNEGO REGISTRA.

\gdef\@#1[#2] {\penalty-50\yskip\hangindent 2em\noindent\.{@#1\unskip
  \spacefactor1000{ }}$[#2]$\quad}
\def\more{\hangindent 2em \hangafter0}
\def\subsec{\penalty-300\medskip\noindent}

\@@ [LTMCrc] pARA SIMVOLOV \.@ PREDSTAVLYAET SAM SIMVOL `\.@'. eTO
EDINSTVENNYJ UPRAVLYAYUSHCHIJ KOD, KOTORYJ DEJSTVUET POVSYUDU. zAMETIM, CHTO
VAM PRIDETSYA ISPOLXZOVATX |TO SOGLASHENIE, ESLI VY UKAZYVAETE email-ADRES
V \.{CWEB}-FAJLE (NAPRIMER, \.{levy@@geom.umn.edu}).

\subsec
sLEDUYUSHCHIE KODY PREDSTAVLYAYUT \TEX/-CHASTX SEKCII.

\@\ [LTMC\to T] oZNACHAET NACHALO NOVOJ (NE ZAGLAVNOJ) SEKCII. sIMVOL
TABULYACII, PROGONA STRANICY ILI KONCA STROKI, SLEDUYUSHCHIE ZA ZNAKOM \.@,
|KVIVALENTNY PROBELU (KAK I V BOLXSHINSTVE DRUGIH SLUCHAEV).

\@* [LTMC\to T] oTMECHAET NACHALO NOVOJ ZAGLAVNOJ SEKCII, T.E. SEKCII,
NACHINAYUSHCHEJ NOVUYU GRUPPU. nAZVANIE |TOJ GRUPPY DOLZHNO SLEDOVATX ZA \.{@*}
I ZAVERSHATXSYA TOCHKOJ. kAK UKAZANO VYSHE, V NEM NE DOLZHNY ISPOLXZOVATXSYA
UPRAVLYAYUSHCHIE POSLEDOVATELXNOSTI \TEX/'A, KROME DOSTATOCHNO PROSTYH.
kOGDA \.{CWEAVE} I \.{CTANGLE} SCHITYVAYUT \.{@*}, ONI VYVODYAT NA TERMINAL
SIMVOL `*' I NOMER TEKUSHCHEJ SEKCII, TAK CHTO POLXZOVATELX MOZHET VIZUALXNO
SLEDITX ZA PRODVIZHENIEM RABOTY.
sAMAYA PERVAYA SEKCIYA ZHELATELXNO DOLZHNA BYTX ZAGLAVNOJ.

\more vY MOZHETE UKAZATX ``GLUBINU'' ZAGLAVNOJ SEKCII, VVODYA \.* LIBO
DESYATIRICHNOE CHISLO POSLE \.{@*}, OTMECHAYA |TIM OTNOSITELXNOE RASPOLOZHENIE
TEKUSHCHEJ GRUPPY SEKCIJ V IERARHII PROGRAMMY. chASTI PROGRAMMY VERHNEGO
UROVNYA, OBOZNACHENNYE \.{@**}, VYDELYAYUTSYA V OGLAVLENII ZHIRNYM SHRIFTOM:
BUDEM GOVORITX, CHTO IH GLUBINA~$-1$. v PROTIVNOM SLUCHAE, GLUBINA
PREDSTAVLYAET SOBOJ NEOTRICATELXNOE CHISLO, KOTOROE OPREDELYAET VELICHINU
OTSTUPA V OGLAVLENII. pODOBNYE OTSTUPY POMOGAYUT PROYASNITX STRUKTURU
DLINNOJ PROGRAMMY. eSLI GLUBINA NE UKAZANA YAVNO, ONA POLAGAETSYA RAVNOJ 0.
eSLI VASHA PROGRAMMA KOROTKA, TO, PO-VIDIMOMU, VOZMOZHNO BUDET OSTAVITX
ZNACHENIE GLUBINY NULEVYM. zAGLAVNYE SEKCII VSEGDA RASPOLAGAYUTSYA NA NOVOJ
STRANICE VYVODA,  ESLI TOLXKO GLUBINA NE PREVYSHAET~1.

\subsec
pROMEZHUTOCHNAYA CHASTX KAZHDOJ SEKCII SODERZHIT PROIZVOLXNOE KOLICHESTVO
MAKROOPREDELENIJ (NACHINAYUSHCHIHSYA S \.{@d}) I OPREDELENIJ FORMATOV (PREDVARYAEMYH
\.{@f} LIBO \.{@s}), RASPOLOZHENNYH V PROIZVOLXNOM PORYADKE.

\@d [TM\to M] mAKROOPREDELENIE: NACHINAETSYA \.{@d}, ZA KOTORYM IDUT
IDENTIFIKATOR, NEOBYAZATELXNYE PARAMETRY I \CEE/-KOD, KAK OPISANO RANEE.

\@f [TM\to M] oPREDELENIE FORMATA: NACHINAETSYA \.{@f}; ONI UKAZYVAYUT
\.{CWEAVE} OBRABATYVATX IDENTIFIKATORY OSOBYM OBRAZOM, KOGDA ONI
VSTRECHAYUTSYA V \CEE/-KODE. oBSHCHIJ VID OPREDELENIYA FORMATA ---
`\.{@f} \|l \|r', DALEE SLEDUET NEOBYAZATELXNYJ KOMMENTARIJ, OGRANICHENNYJ
\.{/*} I \.{*/}, GDE \|l I \|r --- IDENTIFIKATORY:
\.{CWEAVE} V DALXNEJSHEM BUDET RASSMATRIVATX IDENTIFIKATOR \|l TAK, KAK
ON |TO DELAET V NASTOYASHCHIJ MOMENT DLYA \|r.
eTO DAET \.{CWEB}-PROGRAMMISTU VOZMOZHNOSTX
VVODITX NOVYE ZAREZERVIROVANNYE SLOVA I/ILI OTMENYATX REZERVIROVANIE
NEKOTORYH IDENTIFIKATOROV YAZYKOM \CEE/. eSLI \|r --- SPECIALXNYJ
IDENTIFIKATOR `\\{TeX}', IDENTIFIKATOR \|l
BUDET OTFORMATIROVAN KAK UPRAVLYAYUSHCHAYA POSLEDOVATELXNOSTX \TEX/. nAPRIMER,
`\.{@f foo TeX}' V \.{CWEB}-FAJLE PRIVEDET K TOMU, CHTO IDENTIFIKATOR \\{foo}
BUDET VYVODITXSYA  \.{CWEAVE} KAK \.{\\foo}. pROGRAMMIST DOLZHEN OPREDELITX
\.{\\foo} PO SVOEMU USMOTRENIYU, POLAGAYA, CHTO \TEX/ NAHODITSYA V
MATEMATICHESKOJ MODE. (kAZHDYJ SIMVOL PODCHERKIVANIYA PREOBRAZUETSYA V \.{x},
KOGDA SOZDAETSYA UPRAVLYAYUSHCHAYA POSLEDOVATELXNOSTX \TEX/; TAK, \\{foo\_bar}
STANOVITSYA \.{\\fooxbar}. pROCHIE SIMVOLY, VKLYUCHAYA CIFRY, NE
TRANSLIRUYUTSYA, TAK CHTO \TEX/ BUDET POLAGATX IH PARAMETRAMI MAKROSA, A NE
CHASTXYU SAMOJ UPRAVLYAYUSHCHEJ POSLEDOVATELXNOSTI.
nAPRIMER,
$$\.{\\def\\x\#1\{x\_\{\#1\}\} @f x1 TeX @f x2 TeX}$$
BUDET VYVODITX \.{x1} I \.{x2} NE KAK \\{x1} I \\{x2}, A KAK $x_1$ I $x_2$.

\more \.{CWEAVE} AVTOMATICHESKI FORMATIRUET IDENTIFIKATORY, VVEDENNYE
POSREDSTVOM \&{typedef}, KAK ZAREZERVIROVANNYE SLOVA, PO|TOMU VAM NE
PRIDETSYA OPREDELYATX FORMATY SLISHKOM CHASTO.

\@s [TM\to M;\;L] aNALOGICHNO \.{@f}, NO \.{CWEAVE} NE OTOBRAZHAET
OPREDELENIYA FORMATOV V SVOEM VYVODE, I NEOBYAZATELXNYJ \CEE/-KOMMENTARIJ
NEDOPUSTIM. iSPOLXZUETSYA GLAVNYM OBRAZOM V \.{@i}-FAJLAH.

\subsec
sLEDUYUSHCHIE KODY UPRAVLYAYUT \CEE/-CHASTXYU SEKCII.

\@{c @p} [TM\to C] \CEE/-CHASTX NEIMENOVANNOJ SEKCII NACHINAETSYA \.{@c}
(LIBO \.{@p}, T.E. ``program''; OBA UPRAVLYAYUSHCHIH SIMVOLA DELAYUT ODNO I TO ZHE).
eTO ZASTAVLYAET \.{CTANGLE} DOPOLNITX SLEDUYUSHCHIM \CEE/-KODOM PERVOE
PRIBLIZHENIE TEKSTA PROGRAMMY, KAK OPISANO NA STRANICE~\tangref.
zAMETIM, CHTO \.{CWEAVE} NE POMESHCHAET `\.{@c}' V \TEX/-VYVOD,
TAK CHTO ESLI VY SOZDAETE FAJL \.{CWEB}, OSNOVYVAYASX NA RASPECHATANNOJ
\TEX/'OM \.{CWEB}-DOKUMENTACII, NE ZABUDXTE UKAZATX \.{@c} V
SOOTVETSTVUYUSHCHIH MESTAH NEIMENOVANNYH SEKCIJ.

\@< [TM\to C;\; C;\; c] $*$ eTOT UPRAVLYAYUSHCHIJ SIMVOL PREDSTAVLYAET IMYA
SEKCII (LIBO UNIKALXNYJ PREFIKS, KAK UKAZANO VYSHE), SODERZHASHCHEE TEKST
\TEX/ I ZAVERSHAYUSHCHEESYA \.{@>}.
kONSTRUKCIYA \.{@<...@>} V CELOM KONCEPTUALXNO YAVLYAETSYA |LEMENTOM \CEE/-KODA.
eE POVEDENIE ZAVISIT OT KONTEKSTA:

\more sIMVOL \.{@<} V KONTEKSTAH $T$ I $M$ SVYAZYVAET
SLEDUYUSHCHEE DALEE IMYA SEKCII S TEKUSHCHEJ SEKCIEJ, I OTKRYVAET
\CEE/-CHASTX SEKCII.  iMYA ZAVERSHAETSYA \.{@>}, ZA KOTORYM
SLEDUET \.{=} ILI \.{+=}.

\more
v KONTEKSTE $C$, \.{@<} UKAZYVAET, CHTO SEKCIYA ZDESX
ISPOLXZUETSYA --- EE \CEE/-OPREDELENIYA BUDUT POMESHCHENY SYUDA
\.{CTANGLE}, KAK OPISANO NA STRANICE~\tangref.
dLYA BOLEE POLNOGO VYYAVLENIYA OSHIBOK
\.{CTANGLE} I \.{CWEAVE} PREDUSMATRIVAYUT VYVOD SOOBSHCHENIYA V SLUCHAE, ESLI ZA
TAKIM IMENEM SEKCII SLEDUET \.=, POSKOLXKU |TO SKOREE VSEGO OZNACHAET
OPREDELENIE NOVOJ SEKCII, I PO|TOMU DOLZHNO PREDVARYATXSYA \.{@\ }.
eSLI VAM DEJSTVITELXNO
NUZHNO NAPISATX $\langle\,$foo$\,\rangle=\\{bar}$, GDE $\langle\,$foo$\,\rangle$
ISPOLXZUETSYA, A NE OPREDELYAETSYA, POMESTITE \.= NA NOVOJ STROKE.

\more
nAKONEC, VO VNUTRENNEM \CEE/-KONTEKSTE (T.E., VNUTRI `\pb' V \TEX/-CHASTI
SEKCII ILI V KOMMENTARII), \.{@<...@>}
OZNACHAET, CHTO |TA SECIYA CITIRUETSYA.
tAKOE ISPOLXZOVANIE IGNORIRUETSYA \.{CTANGLE}. oTMETIM, CHTO DAZHE V |TOM SLUCHAE
MY TRAKTUEM IMYA SEKCII KAK |LEMENT \CEE/, TAK KAK ONO OGRANICHENO \pb.

\@( [TM\to C;\;C;\;c] $*$ iMYA SEKCII MOZHET NACHINATXSYA \.{@(}.
vSE BUDET RABOTATX, KAK I DLYA \.{@<}, NO S TEM ISKLYUCHENIEM, CHTO \CEE/-KOD
SEKCII, NAZVANNOJ \.{@(foo@>} BUDET ZAPISAN \.{CTANGLE} V FAJL \.{foo}.
tEM SAMYM MY MOZHEM POLUCHITX IZ ODNOGO FAJLA \.{CWEB} NESKOLXKO VYHODNYH
FAJLOV.
(oPREDELENIYA \.{@d} NE POPADAYUT V TAKIE FAJLY,
A LISHX V OSNOVNOJ \.{.c}-FAJL.) oDNO IZ PREDNAZNACHENIJ |TOJ VOZMOZHNOSTI
V TOM, CHTOBY  SOZDATX ZAGOLOVOCHNYE FAJLY DLYA PROGRAMMNYH MODULEJ.
dRUGIM PRIMEROM EE ISPOLXZOVANIYA SLUZHIT  GENERACIYA
TESTOV, RASPROSTRANYAEMYH S VASHEJ PROGRAMMOJ. sOHRANYAYA ISHODNYE TEKSTY
PROGRAMMY, EE ZAGOLOVOCHNYE FAJLY I TESTOVYE PROCEDURY SOVMESTNO,
MY IMEEM BOLXSHE SHANSOV PODDERZHATX IH SOGLASOVANNOSTX.
oTMETIM, CHTO IMENOVANNAYA SEKCIYA MOZHET BYTX VYVEDENA V
NESKOLXKO RAZLICHNYH VYHODNYH FAJLOV, POSKOLXKU
VY MOZHETE UPOMYANUTX \.{@<foo@>} KAK V \.{@(bar1@>}, TAK I V \.{@(bar2@>}.

\@h [Cc] pREDPISYVAET \.{CTANGLE}
VSTAVITX V |TU TOCHKU OPREDELENIYA \.{\#define}
IZ PROMEZHUTOCHNYH CHASTEJ VSEH SEKCIJ I {\it NE\/} ZAPISYVATX IH V NACHALO
\CEE/-FAJLA. pOLEZNO, K PRIMERU, PRI NEOBHODIMOSTI RAZMESTITX MAKROOPREDELENIYA
POSLE VKLYUCHAEMYH FAJLOV.
(iGNORIRUETSYA \.{CTANGLE} VNUTRI `\pb'.)

\subsec
nESKOLXKO SLEDUYUSHCHIH UPRAVLYAYUSHCHIH SIMVOLOV NACHINAYUT ``UPRAVLYAYUSHCHIE TEKSTY''
(``control texts''), ZAVERSHAYUSHCHIESYA `\.{@>}'.
zAKRYVAYUSHCHAYA `\.{@>}' DOLZHNA BYTX NA
TOJ ZHE STROKE \.{CWEB} FAJLA, CHTO I NACHALO UPRAVLYAYUSHCHEGO TEKSTA.
kONTEKST, NACHINAYUSHCHIJSYA |TIMI UPRAVLYAYUSHCHIMI SIMVOLAMI I OKANCHIVAYUSHCHIJSYA
\.{@>}, YAVLYAETSYA OGRANICHENNYM.

\@\^ [TMCc] $*$ dALXNEJSHIJ UPRAVLYAYUSHCHIJ TEKST, VPLOTX DO `\.{@>}',
BUDET POMESHCHEN V INDEKS NARYADU S IDENTIFIKATORAMI
\CEE/-PROGRAMMY; |TOT TEKST BUDET NABRAN ROMANSKIM SHRIFTOM. nAPRIMER, CHTOBY
POMESTITX FRAZU ``system dependencies'' (SISTEMNYE ZAVISIMOSTI) V
INDEKS, GENERIRUEMYJ \.{CWEAVE}, POMESTITE `\.{@\^system dependencies@>}'
V KAZHDOJ SEKCII, KOTRUYU VY HOTITE OTMETITX KAK SISTEMNO-ZAVISIMUYU.

\@. [TMCc] $*$ pOSLEDUYUSHCHIJ UPRAVLYAYUSHCHIJ TEKST BUDET POMESHCHEN V INDEKS
V STILE PISHUSHCHEJ MASHINKI (\.{typewriter} \.{type}).

\@: [TMCc] $*$ sOOTVETSTVUYUSHCHIJ TEKST BUDET POMESHCHEN V INDEKS
V FORMATE, OPISANNOM \TEX/-MAKROSOM `\.{\\9}', KOTORYJ VY DOLZHNY
OPREDELITX TAK, KAK |TO NEOBHODIMO.

\@t [MCc] $*$ dALXNEJSHIJ UPRAVLYAYUSHCHIJ TEKST BUDET ZAKLYUCHEN V
\TEX/ \.{\\hbox} I OTFORMATIROVAN KAK CHASTX OKRUZHAYUSHCHEJ EGO
\CEE/-PROGRAMMY. eTOT TEKST IGNORIRUETSYA \.{CTANGLE}, NO MOZHET ISPOLXZOVATXSYA
V RAZLICHNYH CELYAH \.{CWEAVE}. nAPRIMER, VY MOZHETE DELATX KOMMENTARII,
KOTORYE SOCHETAYUT \CEE/ I KLASSICHESKUYU MATEMATIKU, VRODE  `$\\{size}<2^{15}$',
VVODYA `\.{|size < 2@t\$\^\{15\}\$@>|}'.

\@= [MCc] $*$ uPRAVLYAYUSHCHIJ TEKST BUDET
DOSLOVNO VYVEDEN V \CEE/-PROGRAMMU.

\@q [LTMCc] $*$ uPRAVLYAYUSHCHIJ TEKST POLNOSTXYU IGNORIRUETSYA
--- |TO KOMMENTARIJ ISKLYUCHITELXNO DLYA CHITATELEJ \.{CWEB}-FAJLA.
fAJL, PREDNAZNACHENNYJ DLYA VKLYUCHENIYA V PREAMBULU S POMOSHCHXYU \.{@i},
MOZHET SODERZHATX INFORMACIYU O SEBE SAMOM V \.{@q} KOMMENTARII. dRUGIM
ISPOLXZOVANIEM |TOJ KONSTRUKCII MOZHET BYTX VOSSTANOVLENIE BALANSA SKOBOK
VNUTRI C-STROK, CHTOBY TEKSTOVYE REDAKTORY, OTSLEZHIVAYUSHCHIE IH PARNOSTX, "NE
PADALI V SHTOPOR"
(DA, IMENNO TAK: "go into a tailspin" --- {\sl pRIM. PEREV.\/}).

\@! [TMCc] $*$
nOMER SEKCII V INDEKSE BUDET PODCHERKNUT, ESLI `\.{@!}' NEPOSREDSTVENNO
PREDSHESTVUET IDENTIFIKATORU LIBO UPRAVLYAYUSHCHEMU TEKSTU, POMESHCHAEMOMU V
INDEKS. eTO SOGLASHENIE
ISPOLXZUYUT, CHTOBY RAZLICHATX SEKCII, V KOTORYH IDENTIFIKATOR OPREDELEN LIBO
OB�YASNYAETSYA NEKOTORYM OSOBYM OBRAZOM, OT SEKCIJ, GDE ON ISPOLXZOVAN.
sSYLKI NA ZAREZERVIROVANNYE SLOVA LIBO ODNOSIMVOLXNYE IDENTIFIKATORY V INDEKS
NE POMESHCHAYUTSYA, ZA ISKLYUCHENIEM PODCHERKNUTYH. `\.{@!}' NEYAVNO VSTAVLYAETSYA
\.{CWEAVE} KOGDA IDENTIFIKATOR OB�YAVLYAETSYA LIBO OPREDELYAETSYA V \CEE/-KODE;
NAPRIMER, OPREDELENIE
$$\hbox{\&{int} \\{array}[\\{max\_dim}], \\{count}${}=\\{old\_count};$}$$
POMESHCHAET V INDEKS IMENA \\{array} I \\{count}, VYDELYAYA IH PODCHERKIVANIEM.
mETKI, OPREDELENIYA FUNKCIJ, PODOBNYE
\\{main}(\&{int}~\\{argc},\,\&{char}~$*$\\{argv}[\,]),
I OPREDELENIYA \&{typedef} TAKZHE PODRAZUMEVAYUT PODCHERKIVANIE.
oPREDELENIYA FUNKCIJ STAROGO STILYA (BEZ PROTOTIPA)
NE OPREDELYAYUT IH ARGUMENTOV, TEM NE MENEE, ARGUMENTY BUDUT POLAGATXSYA
OPREDELENNYMI (I BUDUT OTOBRAZHATXSYA V INDEKSE S PODCHERKIVANIEM),
ESLI IH TIPY OB�YAVLENY PERED TELOM FUNKCII OBYCHNYM OBRAZOM,
(NAPRIMER, `\&{int}~\\{argc}; \&{char}~${*}\\{argv}[\,]$; $\{\,\ldots\,\}$').

\subsec
pEREJDEM, NAKONEC, K UPRAVLYAYUSHCHIM SIMVOLAM, KOTORYE VLIYAYUT TOLXKO NA RABOTU
\.{CTANGLE}.

\@' [MCc] iSPOLXZOVANIE |TOGO UPRAVLYAYUSHCHEGO SIMVOLA OPASNO, POSKOLXKU EGO
ZNACHENIE V \.{CWEB} SUSHCHESTVENNO OTLICHAETSYA OT EGO PROOBRAZA V \.{WEB}.
v \.{CWEB} ON RASKRYVAETSYA V DESYATIRICHNUYU KONSTANTU, SOOTVETSTVUYUSHCHUYU
ASCII-KODU STROKI EDINICHNOJ DLINY (T.E. \.{@'a'} PREOBRAZUETSYA
\.{CTANGLE} V \.{97}, A \.{@'\\t'} --- V \.9). vY MOZHETE VOSPOLXZOVATXSYA
|TIM, ESLI HOTITE RABOTATX S ASCII NA MASHINE, NE ISPOLXZUYUSHCHEJ |TU KODIROVKU,
NO V BOLXSHINSTVE SLUCHAEV SREDSTVA YAZYKA  \CEE/, OPREDELENNYE V \.{<ctype.h>},
VPOLNE DOSTATOCHNY DLYA USTRANENIYA ZAVISIMOSTI OT KODIROVKI SIMVOLOV.

\@\& [MCc] oPERACIYA \.{@\&} SCEPLYAET TEKST SLEVA OT SEBYA S TEKSTOM
SPRAVA I VYVODIT V \CEE/-FAJL TAK, CHTO NI PROBELY, NI
MARKERY KONCA STROKI NE BUDUT VSTAVLENY MEZHDU NIMI.

\@l [L] \.{CWEB}-PROGRAMMISTY VOLXNY ISPOLXZOVATX V \TEX/TE LYUBOJ 8-BITNYJ
SIMVOLXNYJ KOD IZ NEREDKO ZAPRETNOGO DIAPAZONA 128--255; |TI SIMVOLY TAKZHE
DOPUSTIMY V STROKAH I DAZHE V IDENTIFIKATORAH \CEE/-PROGRAMMY.
v RAZLICHNYH RASSHIRENIYAH BAZOVOGO STANDARTA ASCII NIZHNYAYA CHASTX TABLICY
(KODY, BOLXSHIE 128) SOOTVETSTVUET BUKVAM S DIAKRITICHESKIMI ZNAKAMI,
SIMVOLAM NE LATINSKIH ALFAVITOV I T.D.
kOGDA TAKIE SIMVOLY POYAVLYAYUTSYA V IDENTIFIKATORAH, \.{CTANGLE} ZAMENYAET
IH STANDARTNYMI ALFAVITNO-CIFROVYMI SIMVOLAMI ASCII LIBO \.{\_}, CHTOBY
IMENA SOOTVETSTVOVALI SOGLASHENIYAM YAZYKA \CEE/.  pRI |TOM PRIMENYAETSYA
TABLICA PEREKODIROVKI, KOTORAYA PO UMOLCHANIYU SOPOSTAVLYAET S KAZHDYM
SIMVOLOM, IMEYUSHCHIM ASCII-KOD \T{\^}$ab$ (GDE $a$ I $b$ --- SHESTNADCATERICHNYE
CIFRY I $a\ge8$) STROKU \.{Xab}. pOMESTIV V PREAMBULE KONSTRUKCIYU
\.{@l\ ab\ newstring}, VY UKAZHETE \.{CTANGLE} ZAMENYATX |TOT SIMVOL
STROKOJ \.{newstring}. nAPRIMER, V KODIROVKE ISO Latin-1 BUKVA `\"u'
IMEET KOD \T{\^FC} (LIBO \.{'\char`\\374'}), I \.{CTANGLE} PO UMOLCHANIYU
ZAMENYAET V IDENTIFIKATORAH |TOT KOD POSLEDOVATELXNOSTXYU SIMVOLOV
\.{XFC}. eSLI VY ZADADITE \.{@l} \.{fc} \.{ue}, TO DALEE VMESTO |TOJ
BUKVY BUDET PODSTAVLYATXSYA \.{ue}.

\more
\.{CWEAVE} PROPUSKAET 8-BITNYE SIMVOLY PRYAMO V \TEX/ BEZ TRANSLITERACII;
NO PRI |TOM \TEX/ DOLZHEN BYTX, V SVOYU OCHEREDX, PODGOTOVLEN K IH OBRABOTKE.
eSLI VY FORMATIRUETE VSE NESTANDARTNYE IDENTIFIKATORY KAK OSOBYE (``custom'')
UPRAVLYAYUSHCHIE POSLEDOVATELXNOSTI, SLEDUET NASTROITX \TEX/ TAK, CHTOBY ON
VOSPRINIMAL VSE IH SIMVOLY KAK BUKVY. v PROTIVNOM SLUCHAE SLEDUET
LIBO OB�YAVITX V \TEX/'E 8-BITNYE SIMVOLY ``AKTIVNYMI'', LIBO ZAGRUZITX
SHRIFTY, SODERZHASHCHIE V SOOTVETSTVUYUSHCHEJ POZICII NUZHNYE SPECIALXNYE SIMVOLY.
(dLYA IDENTIFIKATOROV ISPOLXZUETSYA SHRIFT, VYBIRAEMYJ KOMANDOJ \TEX/'A
\.{\\it}.)
iSHCHITE SPECIALXNYE MAKROPAKETY, NAPISANNYE DLYA ISPOLXZOVANIYA V \.{CWEB}
VASHEGO YAZYKA LIBO, ESLI NE BOITESX TRUDNOSTEJ, NAPISHITE SVOJ SOBSTVENNYJ.

\subsec
sLEDUYUSHCHIE VOSEMX UPRAVLYAYUSHCHIH SIMVOLOV (A IMENNO, `\.{@,}', `\.{@/}', `\.{@|}',
`\.{@\#}',
`\.{@+}', `\.{@;}', `\.{@[}', I `\.{@]}') NE VLIYAYUT NA GENERACIYU
\CEE/-PROGRAMMY \.{CTANGLE}, NO V NEKOTORYH NEOBYCHNYH SLUCHAYAH MOGUT POMOCHX
ULUCHSHITX CHITAEMOSTX EE \TEX/-PREDSTAVLENIYA, POLUCHENNOGO \.{CWEAVE}.
vSTOENNYJ ALGORITM FORMATIROVANIYA VESXMA HOROSH, KOGDA
PRIMENYAETSYA K SINTAKSICHESKI PRAVILXNOJ PROGRAMME, NO NE MOZHET UCHESTX VSEH
VOZMOZHNYH SITUACIJ, POTOMU CHTO RABOTAET S FRAGMENTAMI TEKSTA, VKLYUCHAYUSHCHIMI
MAKROSY I IMENA SEKCIJ; TAKIE FRAGMENTY NE VSEGDA SOBLYUDAYUT SINTAKSIS.
nESMOTRYA NA TO, CHTO \.{CWEB} POZVOLYAET PEREKRYVATX
AVTOMATICHESKOE FORMATIROVANIE, LUCHSHEJ STRATEGIEJ BUDET NACHATX S
NEGO, POSKOLXKU MOZHET OKAZATXSYA, CHTO PONADOBYATSYA LISHX NESKOLXKO MELKIH
KORREKTIV.

\@, [MCc] eTOT UPRAVLYAYUSHCHIJ SIMVOL VSTAVLYAET TONKIJ PROBEL (thin space) V
VYVOD \.{CWEAVE}.
iNOGDA DOPOLNITELXNYJ PROBEL MOZHET PONADOBITXSYA PRI NEOBYCHNOM ISPOLXZOVANII
MAKROSOV, NAPRIMER, KOGDA DVA IDENTIFIKATORA RASPOLOZHENY RYADOM.

\@/ [MC] eTOT UPRAVLYAYUSHCHIJ SIMVOL VYZYVAET RAZRYV STROKI V
\CEE/-PROGRAMME, OTFORMATIROVANNOJ \.{CWEAVE}. rAZRYVY STROK AVTOMATICHESKI
VYBIRAYUTSYA
\TEX/'OM PO SHEME, RABOTAYUSHCHEJ KORREKTNO V 99\%\ SLUCHAEV, NO INOGDA
NEOBHODIMO YAVNOE UKAZANIE, CHTOBY RAZBIENIE SOOTVETSTVOVALO,
POMIMO VNESHNEJ PRIVLEKATELXNOSTI, LOGIKE PROGRAMMY.
nAPRIMER, ISPOLXZUJTE `\.{@/@,}' PERED KOMMENTARIYAMI, CHTOBY ONI
NACHINALISX S NOVOJ STROKI.

\@| [MC] eTOT UPRAVLYAYUSHCHIJ SIMVOL ZADAET NEOBYAZATELXNYJ RAZRYV STROKI
POSREDI VYRAZHENIYA. nAPRIMER, ESLI IMEETSYA DLINNOE VYRAZHENIE V PRAVOJ CHASTI
PRISVAIVANIYA, S POMOSHCHXYU `\.{@|}' MOZHNO UKAZATX V NEM VOZMOZHNYE TOCHKI
RAZRYVA, KOTORYE BUDUT LUCHSHE PODCHERKIVATX LOGIKU PROGRAMMY, NEZHELI
VYBRANNYE \TEX/'OM AVTOMATICHESKI.

\@\# [MC] eTOT UPRAVLYAYUSHCHIJ SIMVOL VYZYVAET RAZRYV STROKI PODOBNO \.{@/},
A TAKZHE VSTAVLYAET NEBOLXSHOJ DOPOLNITELXNYJ PROBEL V TOCHKU RAZRYVA.
oN MOZHET ISPOLXZOVATXSYA, NAPRIMER,
MEZHDU LOGICHESKI RAZLICHNYMI GRUPPAMI MAKROSOV, RAZMESHCHENNYMI V ODNOJ SEKCII.
\.{CWEB} AVTOMATICHESKI VSTAVLYAET TAKOJ DOPOLNITELXNYJ
PROBEL MEZHDU FUNKCIYAMI, VNESHNIMI OB�YAVLENIYAMI I FUNKCIYAMI, A TAKZHE MEZHDU
OB�YAVLENIYAMI I OPERATORAMI V TELE FUNKCII.

\@+ [MC] eTOT UPRAVLYAYUSHCHIJ SIMVOL MASKIRUET RAZRYV STROKI, KOTORYJ DOLZHEN
BYTX SDELAN \.{CWEAVE}, NAPRIMER, PERED `\&{else}', ESLI VY HOTITE
RAZMESTITX KOROTKUYU if--else KONSTRUKCIYU NA ODNOJ STROKE.
eSLI UKAZATX `\.{\{@+}' V NACHALE SOSTAVNOGO OPERATORA, YAVLYAYUSHCHEGOSYA TELOM
FUNKCII, TO PERVOE OB�YAVLENIE ILI OPERATOR FUNKCII BUDUT RASPOLOZHENY NA
TOJ ZHE STROKE, CHTO I OTKRYVAYUSHCHAYA SKOBKA, I S OTSTUPOM, KOTORYJ BUDET
PREDSHESTVOVATX VTOROMU OPERATORU ILI OB�YAVLENIYU NA SLEDUYUSHCHEJ STROKE.

\@; [MC] eTOT UPRAVLYAYUSHCHIJ SIMVOL PRI FORMATIROVANII ANALOGICHEN TOCHKE S
ZAPYATOJ, NO NEVIDIM. vY MOZHETE VOSPOLXZOVATXSYA NIM, NAPRIMER, POSLE
IMENI SEKCII ILI MAKROSA, KOGDA \CEE/-KOD, PREDSTAVLENNYJ V |TOJ SEKCII
ILI MAKROSE, ESTX SOSTAVNOJ OPERATOR LIBO OKANCHIVAETSYA TOCHKOJ S ZAPYATOJ.
pRIMEROM TAKOJ KONSTRUKCII YAVLYAETSYA
$$\lpile{\.{if (condition) macro @;}\cr
\.{else break;}\cr}$$
GDE OPREDELENIEM \\{macro} SLUZHIT SOSTAVNOJ OPERATOR (ZAKLYUCHENNYJ V FIGURNYE
SKOBKI).
eTO HOROSHO IZVESTNYJ NEDOSTATOK SINTAKSISA \CEE/.

\@{[} [MC] sM. \.{@]}.

\@] [MC] pOMESTITE KVADRATNYE SKOBKI \.{@[...@]} VOKRUG TEKSTA PROGRAMMY,
KOTORYJ DOLZHEN BYTX OTFORMATIROVAN \.{CWEAVE}
 KAK VYRAZHENIE, ESLI |TOGO NE PROIZOSHLO. (tAKOE
INOGDA SLUCHAETSYA S NEOBYCHNYMI ARGUMENTAMI MAKROSOV.)
tAKZHE VSTAVLYAJTE `\.{@[@]}' MEZHDU IMENEM TIPA I LEVOJ SKOBKOJ, KOGDA
OB�YAVLYAETE UKAZATELX NA FUNKCIYU, VRODE,
$$\.{int @[@] (*f)();}$$
V PROTIVNOM SLUCHAE \.{CWEAVE} SPUTAET PERVUYU CHASTX |TOGO OPREDELENIYA
S VYRAZHENIEM \CPLUSPLUS/ `\&{int}($*f$)'.

\subsec
oSTALXNYE UPRAVLYAYUSHCHIE SIMVOLY \.{CWEB} RUKOVODYAT VVODOM DANNYH.

\@{x @y @z}[\\{change\_file}]
\.{CWEAVE} I \.{CTANGLE} PREDNAZNACHENY DLYA RABOTY S DVUMYA VHODNYMI FAJLAMI,
NAZYVAEMYMI \\{web\_file} I FAJL IZMENENIJ \\{change\_file},
GDE \\{change\_file} SODERZHIT DANNYE, ZAMESHCHAYUSHCHIE OTDELXNYE CHASTI \\{web\_file}.
rEZULXTIRUYUSHCHIJ TEKST I ESTX TOT SAMYJ FAJL \.{CWEB}, KOTORYJ UPOMINAETSYA
POVSEMESTNO V |TOM RUKOVODSTVE.

\more kAK |TO RABOTAET: FAJL IZMENENIJ SODERZHIT NULX I BOLEE ``KORREKTIV'',
GDE  KORREKTIVA IMEET VID `\.{@x}$\langle$STARYE STROKI$\rangle$\.{@y}$\langle$%
NOVYE STROKI$\rangle$\.{@z}'. sPECIALXNYE UPRAVLYAYUSHCHIE SIMVOLY \.{@x}, \.{@y}, \.{@z},
DOPUSTIMYE TOLXKO V FAJLAH IZMENENIJ, DOLZHNY POYAVLYATXSYA V NACHALE STROKI,
OSTATOK TAKOJ STROKI IGNORIRUETSYA.
sODERZHIMOE $\langle$STARYE STROKI$\rangle$ PREDSTAVLYAET MATERIAL,
KOTORYJ TOCHNO SOOTVETSTVUET
POSLEDOVATELXNYM STROKAM \\{web\_file}; A $\langle$NOVYE STROKI$\rangle$
SODERZHIT NULX ILI BOLEE STROK, KOTORYMI PREDPOLAGAETSYA ZAMENITX STARYE.
kAK TOLXKO PERVAYA ``STARAYA STROKA'' KORREKTIVY OKAZYVAETSYA SOVPADAYUSHCHEJ
SO STROKOJ V~\\{web\_file}, VSE OSTALXNYE STROKI |TOJ KORREKTIVY TAKZHE
DOLZHNY SOVPASTX.

\more mEZHDU KORREKTIVAMI, PERED PERVOJ KORREKTIVOJ I POSLE POSLEDNEJ
KORREKTIVY
FAJL IZMENENIJ MOZHET SODERZHATX LYUBOE KOLICHESTVO STROK, NE NACHINAYUSHCHIHSYA
`\.{@x}', `\.{@y}', LIBO~`\.{@z}'. tAKIE STROKI PROPUSKAYUTSYA I NE
ISPOLXZUYUTSYA V SOPOSTAVLENII.

\more tAKAYA VOZMOZHNOSTX POLEZNA, KOGDA RABOTAESHX S ORIGINALXNYM \.{CWEB}-FAJLOM,
POLUCHENNYM OTKUDA-LIBO (NAPRIMER, \.{tangle.w} I
\.{weave.w} LIBO \.{tex.web}), KOTORYJ NEOBHODIMO IZMENITX DLYA ADAPTACII
PROGRAMMY K OSOBENNOSTYAM VASHEJ SISTEMY. vY MOZHETE OTLAZHIVATX SVOI
SISTEMNO-ZAVISIMYE IZMENENIYA, NE ISPRAVLYAYA OSNOVNOGO FAJLA; I KAK
TOLXKO ONI ZARABOTAYUT, IH MOZHNO BUDET LEGKO VKLYUCHATX V NOVYE VERSII
OSNOVNOGO FAJLA, KOTORYE BUDUT POYAVLYATXSYA VREMYA OT VREMENI.

\@i [\\{web\_file}]
v SVOYU OCHEREDX, \\{web\_file} SAM PO SEBE MOZHET BYTX KOMBINACIEJ
NESKOLXKIH FAJLOV.
kOGDA \.{CWEAVE} LIBO \.{CTANGLE}, SCHITYVAYA FAJL, OBNARUZHIVAYUT
UPRAVLYAYUSHCHIJ SIMVOL \.{@i} V NACHALE STROKI, ONI PRERYVAYUT CHTENIE I
NACHINAYUT OBRABOTKU FAJLA, IMYA KOTOROGO SLEDUET ZA \.{@i},
PODOBNO PREPROCESSORU KOMPILYATORA \CEE/, OBRABATYVAYUSHCHEMU DIREKTIVU
\.{\#include}.
pOSLE ZAVERSHENIYA CHTENIYA VKLYUCHAEMOGO FAJLA PROGRAMMA
PEREHODIT K SLEDUYUSHCHEJ STROKE ISHODNOGO FAJLA.
iMYA FAJLA, SLEDUYUSHCHEE ZA \.{@i}, MOZHET OKRUZHATXSYA SIMVOLAMI
\.", NO |TO NEOBYAZATELXNO.
vKLYUCHENIE MOZHET BYTX VLOZHENNYM.

\more
fAJLY IZMENENIJ MOGUT IMETX STROKI, NACHINAYUSHCHIESYA \.{@i}. tAKIM SPOSOBOM
VY MOZHETE PODMENYATX ODIN VKLYUCHAEMYJ FAJL DRUGIM. kONCEPTUALXNO, OPISANNYJ
VYSHE MEHANIZM PODSTANOVKI DEJSTVUET PERVYM, A ZATEM V EGO VYVODE
OBRABATYVAYUTSYA DIREKTIVY \.{@i}. eSLI \.{@i} \.{foo}
POYAVITSYA MEZHDU \.{@y} I \.{@z} V FAJLE IZMENENIJ, OTDELXNYE STROKI
FAJLA \.{foo} I FAJLY, KOTORYE ON VKLYUCHAET, NE IZMENYAYUTSYA; MODIFIKACII
MOGUT BYTX VNESENY V STROKI, KOTRYE VKLYUCHALISX NE IZMENENNOJ DIREKTIVOJ
input.

\more v SISTEME UNIX (I DRUGIH, PODDERZHIVAYUSHCHIH PEREMENNYE OKRUZHENIYA),
ESLI USTANOVLENA PEREMENNAYA \.{CWEBINPUTS}, LIBO ESLI ODNOIMENNOE
OPREDELENIE BYLO ZADANO PRI KOMPILYACII,
\.{CWEB} BUDET ISPOLXZOVATX EE ZNACHENIE V KACHESTVE IMENI KATALOGA, V
KOTOROM BUDET PROISHODITX POISK VKLYUCHAEMYH FAJLOV, ESLI ONI NE BUDUT
NAJDENY V TEKUSHCHEM KATALOGE.

\section dOPOLNITELXNYE VOZMOZHNOSTI I PREDOSTEREZHENIYA.

1. v NEKOTORYH REALIZACIYAH \.{CWEB}, KOTORYE
{\def\\#1#2{`{\tentex\char'#1#2}'}%
DOPUSKAYUT ISPOLXZOVANIE RASSHIRENNOGO SIMVOLXNOGO NABORA, SIMVOLY
\\13, \\01, \\31, \\32, \\34, \\35,
\\36, \\37, \\04, \\20 I~\\21}
MOGUT PRIMENYATXSYA KAK SOKRASHCHENIYA DLYA `\.{++}', `\.{--}', `\.{->}',
`\.{!=}', `\.{<=}', `\.{>=}', `\.{==}', `\.{\v\v}', `\.{\&\&}',
`\.{<<}' I~`\.{>>}' SOOTVETSTVENNO.

2. eSLI VASHA SISTEMA IMEET RASSHIRENNYJ NABOR SIMVOLOV, ON MOZHET BYTX
ISPOLXZOVAN S MINIMALXNYMI OGRANICHENIYAMI,
KAK |TO OPISANO VYSHE PRI OBSUZHDENII \.{@l}.
nO VAM SLEDUET PRIDERZHIVATXSYA STANDARTNYH SIMVOLOV ASCII, ESLI VY
HOTITE PISATX PROGRAMMY, KOTORYE OKAZHUTSYA POLEZNYMI I TEM, KOMU TAKOE
RASSHIRENIE NEDOSTUPNO.

3. dOKUMENT \TEX/, PROIZVEDENNYJ \.{CWEAVE}, RAZBIVAETSYA NA STROKI S
MAKSIMALXNOJ DLINOJ 80 SIMVOLOV.
kOGDA TEKST \TEX/ KOPIRUETSYA, VOSPROIZVODYATSYA I SUSHCHESTVUYUSHCHIE RAZRYVY STROK.
eSLI VY NE DELAETE NICHEGO SLISHKOM HITROGO, \.{CWEAVE} RASPOZNAET, KOGDA
KOMMENTARIJ \TEX/'A RAZBIVAETSYA NA NESKOLXKO STROK, I DOBAVIT
`\.\%' V NACHALO KAZHDOJ TAKOJ STROKI.

4. \CEE/-TEKST TRANSLIRUETSYA ``VOSHODYASHCHEJ'' (``bottom up'') PROCEDUROJ,
KOTORAYA RASPOZNAET KAZHDUYU LEKSEMU KAK ``CHASTX RECHI'' (``part of speech'')
I KOMBINIRUET |TI CHASTI VO VSE B\'OLXSHIE I B\'OLXSHIE FRAZY, POKA |TO
VOZMOZHNO, SOGLASNO SPECIALXNOJ GRAMMATIKE, OPISANNOJ V DOKUMENTACII
K~\.{CWEAVE}. lEGKO PONYATX SHEMU, PRIMENYAEMUYU K PROSTYM KONSTRUKCIYAM,
TAKIM KAK OTDELXNYE IDENTIFIKATORY I KOROTKIE VYRAZHENIYA, PROSTO IZUCHIV
NESKOLXKO PRIMEROM VYVODA \.{CWEAVE}, NO OBSHCHIJ MEHANIZM NESKOLXKO
SLOZHNEE, POSKOLXKU DOLZHEN OBRABATYVATX NECHTO BOLXSHEE, CHEM PROSTO \CEE/.
pOMIMO |TOGO, VYVOD SODERZHIT KOMANDY, KOTORYE ZASTAVLYAYUT \TEX/ DELATX
OTSTUPY I RAZRYVY STROK GDE NEOBHODIMO,
SOOTVETSTVENNO ISPOLXZOVANNYM SHRIFTAM I RAZMERU STRANICY. dLYA DOSTIZHENIYA
NAILUCHSHIH REZULXTATOV BLAGORAZUMNO
IZBEGATX ZAKLYUCHENIYA DLINNYH \CEE/-TEKSTOV V \pb, POSKOLXKU
OTSTUPY I MARKERY KONCA STROKI IGNORIRUYUTSYA, KOGDA SODERZHIMOE \pb\
TRANSLIRUETSYA S \CEE/ V \TEX/. sTREMITESX K PROSTOTE VYRAZHENIJ I
OPERATOROV.  eSLI DIREKTIVA PREPROCESSORA ZAKLYUCHENA V \pb,
TO NACHINAYUSHCHIJ EE \.\#  DOLZHEN RASPOLAGATXSYA V NACHALE STROKI,
INACHE \.{CWEAVE} NE NAPECHATAET EE PRAVILXNO.

5. kOMMENTARII V \pb-TEKSTE NEDOPUSTIMY. pOSLE `\.|', UKAZYVAYUSHCHEGO NA
PEREHOD OT TEKSTA \TEX/ K \CEE/, SLEDUYUSHCHIJ `\.|', KOTORYJ NE YAVLYAETSYA
CHASTXYU STROKI, UPRAVLYAYUSHCHEGO TEKSTA LIBO IMENI SEKCII, ZAVERSHAET \CEE/-TEKST.

6. kOMMENTARIJ DOLZHEN IMETX PRAVILXNOE VLOZHENIE FIGURNYH SKOBOK,
V PROTIVNOM SLUCHAE \.{CWEAVE} VYRAZIT SVOE NEDOVOLXSTVO, NO PRI |TOM
SDELAET POPYTKU VOSSTANOVITX BALANS SKOBOK, TAK CHTO
\TEX/'U NE PRIDETSYA SLISHKOM TRUDNO.

7. eSLI VO VREMYA OTLADKI PROGRAMMY VOZNIKAET NEOBHODIMOSTX OPUSTITX
NEKOTORUYU CHASTX \CEE/-KODA, ne SLEDUET PYTATXSYA PROSTO EGO ``ZAKOMMENTIROVATX''.
tAKIE KOMMENTARII NE V DUHE \.{CWEB}; CHITATELYAM ONI POKAZHUTSYA POYASNENIYAMI
K OSTALXNYM INSTRUKCIYAM.
kROME TOGO, KOMMENTARII DOLZHNY BYTX KORREKTNY S TOCHKI ZRENIYA \TEX/'A;
SLEDOVATELXNO, \.{CWEAVE} BUDET V ZATRUDNENII, ESLI VY ZAKLYUCHITE
PREDLOZHENIYA \CEE/ V
\.{/*...*/} VMESTO \.{/*|...|*/}.  eSLI CHASTX \CEE/-KODA DOLZHNA BYTX
``ZAKOMMENTIROVANA'', VY MOZHETE OGRANICHITX EE DIREKTIVAMI PREPROCESSORA,
PODOBNYMI \.{\#if 0==1} I \.{\#endif}.

8. pRI POMOSHCHI \.{@f} VOZMOZHNO OPREDELITX ODIN IDENTIFIKATOR TAK, CHTOBY ON VEL
SEBYA PODOBNO DRUGOMU, I  |TI OPREDELENIYA FORMATA PRIMENYAYUTSYA POSLEDOVATELXNO.
vOOBSHCHE GOVORYA, DANNYJ IDENTIFIKATOR IMEET EDINSTVENNYJ FORMAT VYVODA NA
PROTYAZHENII VSEGO DOKUMENTA, I |TOT FORMAT ISPOLXZUETSYA DAZHE DO TOGO, KAK
BUDET OPREDELEN POSREDSTVOM \.{@f}. eTO OB�YASNYAETSYA TEM, CHTO \.{CWEAVE}
RABOTAET V DVA
PROHODA; NA PERVOM PROHODE OBRABATYVAYUTSYA DIREKTIVY \.{@f} I
PEREKRESTNYE SSYLKI, A NA VTOROM PROIZVODITSYA VYVOD.
(tEM NE MENEE, IDENTIFIKATORY, VVEDENNYE \.{typedef}, KOTORYM
NEYAVNO PRISVAIVAETSYA FORMAT VYVODA ZHIRNYM SHRIFTOM,
NE SLEDUYUT |TOMU PRAVILU: ONI VYVODYATSYA PO-RAZNOMU DO I POSLE
SOOTVETSTVUYUSHCHEGO \.{typedef}.  eTO RAZOCHAROVYVAET, NO CHTO-LIBO ISPRAVITX
ZATRUDNITELXNO. vY MOZHETE OBOJTI |TO OGRANICHENIE, ISPOLXZUYA \.{@s}, DO LIBO
POSLE \.{typedef}.)

9. iNOGDA ZHELATELXNO VSTAVITX V OTFORMATIROVANNYJ \CEE/-KOD PROBEL,
OTLICHNYJ OT PREDOSTAVLYAEMOGO `\.{@,}'. dLYA |TOGO MOZHNO VOSPOLXZOVATXSYA
\.{@t}; NAPRIMER, `\.{@t\\hskip 1in@>}' DAET PROBEL DLINOJ 1~DYUJM.
kROME TOGO, `\.{@t\\4@>}' MOZHET ISPOLXZOVATXSYA DLYA
VOZVRATA NA ODNU EDINICU OTSTUPA, POSKOLXKU UPRAVLYAYUSHCHAYA
POSLEDOVATELXNOSTX \.{\\4} OPREDELENA V \.{cwebmac} TAK, CHTOBY DELATX
TAKOJ VOZVRAT. (oNA ISPOLXZUETSYA, K PRIMERU, V NACHALE STROK, KOTORYE
SODERZHAT POMECHENNYE OPERATORY, TAK CHTO METKA BUDET NEMNOGO SMESHCHENA
VLEVO.) vY TAKZHE MOZHETE ISPOLXZOVATX `\.{@t\}\\3\{-5@>}' DLYA
PRINUDITELXNOGO RAZRYVA STROKI POSREDI VYRAZHENIYA.

10. kAZHDYJ IDENTIFIKATOR V \.{CWEB} IMEET ODIN STILX FORMATIROVANIYA. pO|TOMU
VY NE DOLZHNY ISPOLXZOVATX ODNO I TO ZHE IMYA DLYA ODNOVREMENNOGO OBOZNACHENIYA,
NAPRIMER, IMENI TIPA I POLYA \.{struct}, NESMOTRYA NA TO, CHTO \CEE/
POZVOLYAET |TO.

\section zAPUSK PROGRAMM.
kOMANDNAYA STROKA \UNIX/ KAK DLYA \.{CTANGLE}, TAK I DLYA \.{CWEAVE} IMEET VID
$$\.{ctangle [options] web\_file[.w] [\{change\_file[.ch]|-\} [out\_file]]}$$
eSLI FAJL IZMENENIJ OPUSHCHEN LIBO ZADAN `\.-', ON POLAGAETSYA PUSTYM.
rASSHIRENIYA \.{.w} I \.{.ch} DOBAVLYAYUTSYA TOLXKO V TOM SLUCHAE, ESLI
ZADANNYE IMENA FAJLOV NE SODERZHAT TOCHEK.
eSLI FAJL S TAKIM IMENEM NE NAJDEN, BUDET ISPROBOVANO RASSHIRENIE
\.{.web}.
nAPRIMER, `\.{cweave} \.{cob}' POPYTAETSYA PROCHITATX
\.{cob.w}; ESLI |TO NE UDAETSYA, BUDET ISPROBOVANO \.{cob.web} PERED
AVARIJNYM ZAVERSHENIEM RABOTY.
eSLI IMYA VYHODNOGO FAJLA NE ZADANO, IMYA \CEE/-FAJLA, GENERIRUEMOGO
\.{CTANGLE}, POLUCHAETSYA DOBAVLENIEM RASSHIRENIYA \.{.c};
IMYA \TEX/-FAJLA, PROIZVEDENNOGO \.{CWEAVE}, POLUCHIT RASSHIRENIE \.{.tex}.
v INDEKSNYH FAJLAH, POROZHDAEMYH \.{CWEAVE}, \.{.tex} ZAMENYAETSYA \.{.idx} I
\.{.scn}.

pRIVERZHENCY LAKONICHNOSTI MOGUT TAK NASTROITX SVOJ KOMANDNYJ
INTERPRETATOR, CHTO `\.{wv}' BUDET OZNACHATX `\.{cweave -bhp}'; |TO
PODAVLYAET VESX VYVOD \.{CWEAVE} NA TERMINAL, ZA ISKLYUCHENIEM SOOBSHCHENIJ OB
OSHIBKAH.

pARAMETRY-OPCII NACHINAYUTSYA LIBO SIMVOLOM `\.-', ZAPRESHCHAYUSHCHIM DEJSTVIE
OPCII, LIBO `\.+', KOTORYJ EGO RAZRESHAET. nAPRIMER, `\.{-fb}' ZAPRESHCHAET
OPCII \.f I \.b; `\.{+s}' RAZRESHAET OPCIYU \.s. oPCII MOGUT
ZADAVATXSYA PERED IMENAMI FAJLOV, POSLE NIH, LIBO I TO, I DRUGOE. v
NASTOYASHCHIJ MOMENT PODDERZHIVAYUTSYA SLEDUYUSHCHIE OPCII:

\yskip
\def\option#1 {\textindent{\.#1}\hangindent2\parindent}

\option b vYVODITX SOOBSHCHENIE PRI STARTE. (rAZRESHENO PO UMOLCHANIYU.)

\option f pRINUZHDAET ZAVERSHATX KAZHDYJ OPERATOR \CEE/, OTFORMATIROVANNYJ
\.{CWEAVE}, MARKEROM KONCA STROKI.
(rAZRESHENO PO UMOLCHANIYU; \.{-f} |KONOMIT BUMAGU, NO MNOGIE POLAGAYUT, CHTO
TAKOJ STILX FORMATIROVANIYA PROGRAMMY VYGLYADIT V \CEE/ "NEESTESTVENNO".)
(nE VLIYAET NA \.{CTANGLE}.)

\option h vYVOD SOOBSHCHENIYA O NORMALXNOM ZAVERSHENII PROGRAMMY. (rAZRESHEN
PO UMOLCHANIYU.)

\option p oTOBRAZHATX VO VREMYA RABOTY PROGRAMMY SOOBSHCHENIYA O EE
PROGRESSE. (rAZRESHENO PO UMOLCHANIYU.)

\option s vYDAET STATISTIKU ISPOLXZOVANIYA PAMYATI PO OKONCHANII RABOTY
PROGRAMMY. (zAPRESHCHENO PO UMOLCHANIYU.)
eSLI VASHI \.{CWEB}-FAJLY LIBO SEKCII VELIKI, MOZHET OKAZATXSYA POLEZNYM UVIDETX,
NASKOLXKO VY BLIZKI K ISCHERPANIYU RESURSOV \.{CTANGLE} I/ILI \.{CWEAVE}.

\option x vKLYUCHATX INDEKS I OGLAVLENIE V \TEX/-FAJL, VYVODIMYJ
\.{CWEAVE}. (rAZRESHENO PO UMOLCHANIYU.) (nE VLIYAET NA \.{CTANGLE}.)

\section dOPOLNITELXNYE SVEDENIYA O FORMATIROVANII.
vAM MOZHET NE PONRAVITXSYA, KAK \.{CWEAVE} OBRABATYVAET NEKOTORYE
SITUACII. eSLI U VAS NET DRUGOGO VYHODA, VY MOZHETE NASTROITX \.{CWEAVE}
IZMENYAYA EGO GRAMMATIKU.  eTO TREBUET MODIFIKACII ISHODNYH TEKSTOV,
RABOTY, KOTORAYA MOZHET POKAZATXSYA ZANIMATELXNOJ. tABLICA GRAMMATICHESKIH
PRAVIL SODERZHITSYA V ISHODNYH TEKSTAH \.{CWEAVE}, I VY MOZHETE SDELATX
OTDELXNUYU KOPIYU |TOJ TABLICY, SKOPIROVAV FAJL~\.{prod.w}, NAJDENNYJ V
ISHODNYH TEKSTAH \.{CWEB} I SKOMANDOVAV `\.{cweave}~\.{-x}~\.{prod}' I
`\.{tex}~\.{prod}'.

vY MOZHETE TOCHNO UZNATX, KAK \.{CWEAVE} RAZBIRAET VASH \CEE/-KOD, ESLI
POMESTITE PERED NIM STROKU `\.{@ @c @2}'. (uPRAVLYAYUSHCHIJ KOD `\.{@2}'
AKTIVIZIRUET ``SLEDYASHCHIJ'' (``peeping'') REZHIM RABOTY, A `\.{@0}'
OTMENYAET EGO.) nAPRIMER, ESLI PROPUSTITX CHEREZ \.{CWEAVE} FAJL
\medskip
\begingroup
\verbatim
@ @c @2
main (argc,argv)
char **argv;
{ for (;argc>0;argc--) printf("%s\n",argv[argc-1]); }
!endgroup
\endgroup
\medskip\noindent
NA |KRAN BUDET VYVEDENA SLEDUYUSHCHAYA TARABARSHCHINA:
\medskip
\begingroup
\verbatim
[...]
4:*exp ( +exp+ )...
11:*exp +exp+ int...
5:*+exp+ int +unorbinop+...
[...]
60: +fn_decl+*+{+ -stmt- +}-
55:*+fn_decl+ -stmt-
52:*+function-
[...]
!endgroup
\endgroup
\medskip
pERVAYA STROKA UKAZYVAET, CHTO BYLO PRIMENENO PRAVILO NOMER 4, I  \.{CWEAVE}
V NASTOYASHCHIJ MOMENT SODERZHIT V SVOEJ PAMYATI POSLEDOVATELXNOSTX FRAGMENTOV
(chunk) TEKSTA V FORMATE \TEX/ (NAZYVAEMYH ``VYREZKAMI'', ``scraps''),
IMEYUSHCHIH SOOTVETSTVENNO TIP \\{exp} (DLYA VYRAZHENIJ), OTKRYVAYUSHCHAYA SKOBKA,
SNOVA \\{exp}, ZAKRYVAYUSHCHAYA SKOBKA, I POSLEDUYUSHCHIE VYREZKI, KOTORYE NE BYLI
ESHCHE SCHITANY SINTAKSICHESKIM ANALIZATOROM.  (zNAKI \.+ I \.-  UKAZYVAYUT, CHTO
\TEX/ DOLZHEN VOJTI V MATEMATICHESKUYU MODU LIBO VYJTI IZ NEE NA GRANICE VYREZKI.
sIMVOL \.* OTMECHAET TEKUSHCHUYU POZICIYU ANALIZATORA.)
dALEE PRIMENYAETSYA PRAVILO 11, I POSLEDOVATELXNOSTX $(\,exp\,)$
SVERTYVAETSYA DO \\{exp} I TAK DALEE.  v KONCE KONCOV
VESX \CEE/-TEKST OKAZYVAETSYA ODNOJ BOLXSHOJ VYREZKOJ TIPA \\{function}.

iNOGDA VSE IDET NE TAK GLADKO, I VY POLUCHAETE GRUPPU STROK, SVALENNYH V
ODNU KUCHU.  eTO ZNACHIT, CHTO \.{CWEAVE} NE SMOG PEREVARITX
CHTO-TO V VASHEM \CEE/-KODE.  nAPRIMER, PUSTX
`\.{@<Argument definitions@>}' ZAJMET MESTO `\.{char **argv;}' V
PROGRAMME, UPOMYANUTOJ VYSHE. v |TOM SLUCHAE \.{CWEAVE} BUDET SLEGKA
OZADACHEN, POSKOLXKU SCHITAET, CHTO IMENA SEKCIJ VSEGO LISHX
TOLXKO  \\{exp}.  pO|TOMU \TEX/'U BUDET PREDPISANO VYVESTI
`\X2:Argument declarations\X' V TOJ ZHE SAMOJ STROKE, CHTO I
`$\\{main}(\\{argc},\39\\{argv}{}$)'.
v |TOM SLUCHAE MOZHNO POMOCHX \.{CWEAVE}, POMESHCHAYA `\.{@/}' POSLE
`\.{main(argc,argv)}'.

\.{CWEAVE} AVTOMATICHESKI VSTAVLYAET NEBOLXSHOJ PROMEZHUTOK MEZHDU
OPISANIYAMI I PERVYM OPERATOROM BLOKA. vOT ODIN SPOSOB LOKALXNO EGO
OTMENITX:
$$\vbox{\halign{#\hfil\cr
\.{int x;@+@t\}\\6\{@>}\cr
\.{@<Other locals@>@;@\#}\cr}}$$
`\.{@\#}' POMESTIT DOPOLNITELXNYJ PROBEL POSLE `$\langle\,$Other locals$\,\rangle$'.

\section pRILOZHENIYA.

kAK PRIMER REALXNOJ PROGRAMMY, NAPISANNOJ V \.{CWEB}, pRILOZHENIE~A
SODERZHIT FRAGMENTY PROGRAMM, VHODYASHCHIH V SOSTAV SAMOJ SISTEMY \.{CWEB}.
tE IZ CHITATELEJ, KTO TSHCHATELXNO IZUCHAT LISTINGI V |TOM PRILOZHENII,
SMOGUT GLUBOKO PROCHUVSTVOVATX OSNOVNYE IDEI \.{CWEB}.

pRILOZHENIE~B  --- |TO FAJL OPREDELENIJ, KOTORYE NASTRAIVAYUT \TEX/ NA
RABOTU S VYVODOM \.{CWEAVE}, A V pRILOZHENII~C OBSUZHDAETSYA, KAK
ISPOLXZOVATX NEKOTORYE IZ |TIH MAKROSOV DLYA IZMENENIYA FORMATA VYVODA.

``pOLNAYA'' VERSIYA |TOGO RUKOVODSTVA, KOTORAYA MOZHET BYTX SGENERIROVANA IZ
ISHODNYH TEKSTOV \.{CWEB} KOMANDOJ \UNIX/ \.{make} \.{fullmanual},
SODERZHIT TAKZHE PRILOZHENIYA D, E, I~F, PREDSTAVLYAYUSHCHIE SOBOJ POLNYE
ISHODNYE TEKSTY \.{CTANGLE} I \.{CWEAVE}.

\vfil\eject\titletrue

\def\runninghead{pRILOZHENIE A --- FORMAT ISHODNOGO FAJLA {\tentt CWEB}}
\section pRILOZHENIE~A: fRAGMENTY PROGRAMM \.{CWEB}.

eTO PRILOZHENIE SODERZHIT CHETYRE LISTINGA.
pERVYJ SODERZHIT VHODNYE DANNYE DLYA \.{CWEB}, PO KOTORYM GENERIRUYUTSYA
SEKCII~12--15 FAJLA~\.{common.w}, KOTORYJ SODERZHIT PODPROGRAMMY, OBSHCHIE
DLYA \.{CWEAVE} I~\.{CTANGLE}. oTMETIM, CHTO NEKOTORYE STROKI SODERZHAT
OTSTUPY, PODCHERKIVAYUSHCHIE STRUKTURU PROGRAMMY; OTSTUPY |TI IGNORIRUYUTSYA
KAK  \.{CWEAVE}, TAK I \.{CTANGLE}, NO POLXZOVATELI NAHODYAT, CHTO FAJLY
\.{CWEB} GORAZDO LEGCHE VOSPRINIMAYUTSYA, ESLI V NIH IMEYUTSYA TAKIE OTSTUPY.


vTOROJ I TRETIJ LISTINGI SODERZHAT SOOTVETSTVUYUSHCHIE FRAGMENTY
\CEE/-KODA, SGENERIROVANNOGO \.{CTANGLE} I TEKSTA V FORMATE \TEX/,
POLUCHENNOGO \.{CWEAVE} PRI OBRABOTKE \.{common.w}.
chETVERTYJ LISTING DEMONSTRIRUET, KAK BUDET VYGLYADETX |TOT VYHODNOJ FAJL
NA BUMAGE.

\vskip 6pt
\begingroup \def\tt{\eighttt} \baselineskip9pt
\verbatim
@ Procedure |prime_the_change_buffer|
sets |change_buffer| in preparation for the next matching operation.
Since blank lines in the change file are not used for matching, we have
|(change_limit==change_buffer && !!changing)| if and only if
the change file is exhausted. This procedure is called only when
|changing| is 1; hence error messages will be reported correctly.

@c
void
prime_the_change_buffer()
{
  change_limit=change_buffer; /* this value is used if the change file ends */
  @<Skip over comment lines in the change file; |return| if end of file@>;
  @<Skip to the next nonblank line; |return| if end of file@>;
  @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>;
}

@ While looking for a line that begins with \.{@@x} in the change file, we
allow lines that begin with \.{@@}, as long as they don't begin with \.{@@y},
\.{@@z} or \.{@@i} (which would probably mean that the change file is fouled up).

@<Skip over comment lines in the change file...@>=
while(1) {
  change_line++;
  if (!!input_ln(change_file)) return;
  if (limit<buffer+2) continue;
  if (buffer[0]!!='@@') continue;
  if (xisupper(buffer[1])) buffer[1]=tolower(buffer[1]);
  if (buffer[1]=='x') break;
  if (buffer[1]=='y' || buffer[1]=='z' || buffer[1]=='i') {
    loc=buffer+2;
    err_print("!! Missing @@x in change file");
@.Missing @@x...@>
  }
}

@ Here we are looking at lines following the \.{@@x}.

@<Skip to the next nonblank line...@>=
do {
  change_line++;
  if (!!input_ln(change_file)) {
    err_print("!! Change file ended after @@x");
@.Change file ended...@>
    return;
  }
} while (limit==buffer);

@ @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>=
{
  change_limit=change_buffer-buffer+limit;
  strncpy(change_buffer,buffer,limit-buffer+1);
}

!endgroup
\endgroup
\vfill\eject

\def\runninghead{pRILOZHENIE A  --- VYVOD {\tentt CTANGLE}}

zDESX PRIVEDENA PORCIYA \CEE/-KODA, SGENERIROVANNOGO \.{CTANGLE}, KOTORYJ
SOOTVETSTVUET ISHODNOMU TEKSTU NA PREDYDUSHCHEJ STRANICE.  oBRATITE VNIMANIE,
CHTO SEKCII~13, 14 I~15 BYLI "VPLETENY" V SEKCIYU~12.

\vskip6pt
\begingroup \def\tt{\eighttt} \baselineskip9pt
\verbatim
/*:9*//*12:*/
#line 247 "common.w"

void
prime_the_change_buffer()
{
change_limit= change_buffer;
/*13:*/
#line 261 "common.w"

while(1){
change_line++;
if(!!input_ln(change_file))return;
if(limit<buffer+2)continue;
if(buffer[0]!!='@')continue;
if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]);
if(buffer[1]=='x')break;
if(buffer[1]=='y'||buffer[1]=='z'||buffer[1]=='i'){
loc= buffer+2;
err_print("!! Missing @x in change file");

}
}

/*:13*/
#line 252 "common.w"
;
/*14:*/
#line 278 "common.w"

do{
change_line++;
if(!!input_ln(change_file)){
err_print("!! Change file ended after @x");

return;
}
}while(limit==buffer);

/*:14*/
#line 253 "common.w"
;
/*15:*/
#line 288 "common.w"

{
change_limit= change_buffer-buffer+limit;
strncpy(change_buffer,buffer,limit-buffer+1);
}

/*:15*/
#line 254 "common.w"
;
}

/*:12*//*16:*/
!endgroup
\endgroup
\vfill\eject

\def\runninghead{pRILOZHENIE A --- VYVOD {\tentt CWEAVE}}

sOOTVETSTVUYUSHCHIJ OTRYVOK \.{common.tex} VYGLYADIT TAK:

\vskip6pt
\begingroup \def\tt{\eighttt} \baselineskip9pt
\verbatim
\M{12}Procedure \PB{\\{prime\_the\_change\_buffer}}
sets \PB{\\{change\_buffer}} in preparation for the next matching operation.
Since blank lines in the change file are not used for matching, we have
\PB{$(\\{change\_limit}\E\\{change\_buffer}\W\R\\{changing})$} if and only if
the change file is exhausted. This procedure is called only when
\PB{\\{changing}} is 1; hence error messages will be reported correctly.
!vskip-.5!baselineskip
\Y\B\&{void} \\{prime\_the\_change\_buffer}(\,)\1\1\2\2\6
${}\{{}$\1\6
${}\\{change\_limit}\K\\{change\_buffer}{}$;\C{ this value is used if the
change file ends }\6
\X13:Skip over comment lines in the change file; \PB{\&{return}} if end of file%
\X;\6
\X14:Skip to the next nonblank line; \PB{\&{return}} if end of file\X;\6
\X15:Move \PB{\\{buffer}} and \PB{\\{limit}} to \PB{\\{change\_buffer}} and %
\PB{\\{change\_limit}}\X;\6
\4${}\}{}$\2\par
\fi
!vskip-.5!baselineskip
\M{13}While looking for a line that begins with \.{@x} in the change file, we
allow lines that begin with \.{@}, as long as they don't begin with \.{@y},
\.{@z} or \.{@i} (which would probably mean that the change file is fouled up).
!vskip-.5!baselineskip
\Y\B\4\X13:Skip over comment lines in the change file; \PB{\&{return}} if end
of file\X${}\E{}$\6
\&{while} (\T{1})\5
${}\{{}$\1\6
${}\\{change\_line}\PP;{}$\6
\&{if} ${}(\R\\{input\_ln}(\\{change\_file})){}$\1\5
\&{return};\2\6
\&{if} ${}(\\{limit}<\\{buffer}+\T{2}){}$\1\5
\&{continue};\2\6
\&{if} ${}(\\{buffer}[\T{0}]\I\.{'@'}){}$\1\5
\&{continue};\2\6
\&{if} (\\{xisupper}(\\{buffer}[\T{1}]))\1\5
${}\\{buffer}[\T{1}]\K\\{tolower}(\\{buffer}[\T{1}]);{}$\2\6
\&{if} ${}(\\{buffer}[\T{1}]\E\.{'x'}){}$\1\5
\&{break};\2\6
\&{if} ${}(\\{buffer}[\T{1}]\E\.{'y'}\V\\{buffer}[\T{1}]\E\.{'z'}\V\\{buffer}[%
\T{1}]\E\.{'i'}){}$\5
${}\{{}$\1\6
${}\\{loc}\K\\{buffer}+\T{2};{}$\6
\\{err\_print}(\.{"!!\ Missing\ @x\ in\ cha}\)\.{nge\ file"});\6
\4${}\}{}$\2\6
\4${}\}{}$\2\par
\U12.\fi
!vskip-.5!baselineskip
\M{14}Here we are looking at lines following the \.{@x}.
!vskip-.5!baselineskip
\Y\B\4\X14:Skip to the next nonblank line; \PB{\&{return}} if end of file\X${}%
\E{}$\6
\&{do}\5
${}\{{}$\1\6
${}\\{change\_line}\PP;{}$\6
\&{if} ${}(\R\\{input\_ln}(\\{change\_file})){}$\5
${}\{{}$\1\6
\\{err\_print}(\.{"!!\ Change\ file\ ended}\)\.{\ after\ @x"});\6
\&{return};\6
\4${}\}{}$\2\6
\4${}\}{}$\2\5
\&{while} ${}(\\{limit}\E\\{buffer}){}$;\par
\U12.\fi
!vskip-.5!baselineskip
\M{15}\B\X15:Move \PB{\\{buffer}} and \PB{\\{limit}} to \PB{\\{change\_buffer}}
and \PB{\\{change\_limit}}\X${}\E{}$\6
${}\{{}$\1\6
${}\\{change\_limit}\K\\{change\_buffer}-\\{buffer}+\\{limit};{}$\6
${}\\{strncpy}(\\{change\_buffer},\39\\{buffer},\39\\{limit}-\\{buffer}+%
\T{1});{}$\6
\4${}\}{}$\2\par
\Us12\ET16.\fi
!endgroup
\endgroup
\vfil\eject

\def\runninghead{pRILOZHENIE A --- OKONCHATELXNYJ DOKUMENT}

a VOT TAK |TOT ZHE SAMYJ FRAGMENT VYGLYADIT PRI PECHATI.

\M{12}Procedure \PB{\\{prime\_the\_change\_buffer}}
sets \PB{\\{change\_buffer}} in preparation for the next matching operation.
Since blank lines in the change file are not used for matching, we have
\PB{$(\\{change\_limit}\E\\{change\_buffer}\W\R\\{changing})$} if and only if
the change file is exhausted. This procedure is called only when
\PB{\\{changing}} is 1; hence error messages will be reported correctly.

\Y\B\&{void} \\{prime\_the\_change\_buffer}(\,)\1\1\2\2\6
${}\{{}$\1\6
${}\\{change\_limit}\K\\{change\_buffer}{}$;\C{ this value is used if the
change file ends }\6
\X13:Skip over comment lines in the change file; \PB{\&{return}} if end of file%
\X;\6
\X14:Skip to the next nonblank line; \PB{\&{return}} if end of file\X;\6
\X15:Move \PB{\\{buffer}} and \PB{\\{limit}} to \PB{\\{change\_buffer}} and %
\PB{\\{change\_limit}}\X;\6
\4${}\}{}$\2\par
\fi

\M{13}While looking for a line that begins with \.{@x} in the change file, we
allow lines that begin with \.{@}, as long as they don't begin with \.{@y},
\.{@z} or \.{@i} (which would probably mean that the change file is fouled up).

\Y\B\4\X13:Skip over comment lines in the change file; \PB{\&{return}} if end
of file\X${}\E{}$\6
\&{while} (\T{1})\5
${}\{{}$\1\6
${}\\{change\_line}\PP;{}$\6
\&{if} ${}(\R\\{input\_ln}(\\{change\_file})){}$\1\5
\&{return};\2\6
\&{if} ${}(\\{limit}<\\{buffer}+\T{2}){}$\1\5
\&{continue};\2\6
\&{if} ${}(\\{buffer}[\T{0}]\I\.{'@'}){}$\1\5
\&{continue};\2\6
\&{if} (\\{xisupper}(\\{buffer}[\T{1}]))\1\5
${}\\{buffer}[\T{1}]\K\\{tolower}(\\{buffer}[\T{1}]);{}$\2\6
\&{if} ${}(\\{buffer}[\T{1}]\E\.{'x'}){}$\1\5
\&{break};\2\6
\&{if} ${}(\\{buffer}[\T{1}]\E\.{'y'}\V\\{buffer}[\T{1}]\E\.{'z'}\V\\{buffer}[%
\T{1}]\E\.{'i'}){}$\5
${}\{{}$\1\6
${}\\{loc}\K\\{buffer}+\T{2};{}$\6
\\{err\_print}(\.{"!\ Missing\ @x\ in\ cha}\)\.{nge\ file"});\6
\4${}\}{}$\2\6
\4${}\}{}$\2\par
\U12.\fi

\M{14}Here we are looking at lines following the \.{@x}.

\Y\B\4\X14:Skip to the next nonblank line; \PB{\&{return}} if end of file\X${}%
\E{}$\6
\&{do}\5
${}\{{}$\1\6
${}\\{change\_line}\PP;{}$\6
\&{if} ${}(\R\\{input\_ln}(\\{change\_file})){}$\5
${}\{{}$\1\6
\\{err\_print}(\.{"!\ Change\ file\ ended}\)\.{\ after\ @x"});\6
\&{return};\6
\4${}\}{}$\2\6
\4${}\}{}$\2\5
\&{while} ${}(\\{limit}\E\\{buffer}){}$;\par
\U12.\fi

\M{15}\B\X15:Move \PB{\\{buffer}} and \PB{\\{limit}} to \PB{\\{change\_buffer}}
and \PB{\\{change\_limit}}\X${}\E{}$\6
${}\{{}$\1\6
${}\\{change\_limit}\K\\{change\_buffer}-\\{buffer}+\\{limit};{}$\6
${}\\{strncpy}(\\{change\_buffer},\39\\{buffer},\39\\{limit}-\\{buffer}+%
\T{1});{}$\6
\4${}\}{}$\2\par
\Us12\ET16.\fi

\vfil\eject\titletrue
\rightskip=0pt % get out of C mode (cf. \B)
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50

\def\runninghead{pRILOZHENIE B --- FORMATIRUYUSHCHIE MAKROSY}
\section pRILOZHENIE~B: FAJL \.{cwebmac.tex}.
eTOT FAJL RASSHIRYAET FORMAT ``plain \TEX/'' OPREDELENIYAMI, NEOBHODIMYMI
DLYA OBRABOTKI VYVODA \.{CWEAVE}.

\vskip6pt
\begingroup \def\tt{\eighttt} \baselineskip9pt
\def\printmacs{\input cwebmac}
\verbatim
!printmacs
!endgroup
\endgroup
\vfill\eject

\def\runninghead{pRILOZHENIE C --- ZAMECHANIYA PO FORMATIROVANIYU}
\section pRILOZHENIE~C: kAK POLXZOVATXSYA MAKROSAMI \.{CWEB}.
mAKROOPREDELENIYA, SODERZHASHCHIESYA V \.{cwebmac}, OBESPECHIVAYUT POLUCHENIE
VYVODA V RAZLICHNOM FORMATE BEZ KORREKTIROVKI REZULXTATA RABOTY
\.{CWEAVE}, I CELX |TOGO PRILOZHENIYA --- RAZ�YASNITX NEKOTORYE IZ
VOZMOZHNOSTEJ.

\def\point#1.{\yskip\indent#1.\quad\ignorespaces}

\point 1. v DOPOLNENIE K STANDARTNYM SHRIFTAM FORMATA \.{PLAIN} VVODYATSYA
CHETYRE NOVYH: MOZHNO VVESTI `\.{\{\\mc UNIX\}}' I POLUCHITX {\mc UNIX},
VYVEDENNOE PROPISNYMI BUKVAMI SREDNEGO RAZMERA (medium-size caps);
TAKZHE MOZHNO ZADATX `\.{\{\\sc STUFF\}}' DLYA
NABORA {\sc STUFF} SHRIFTOM "MALYE PROPISNYE" (small caps);
POMIMO |TOGO MOZHNO VYBRATX SHRIFTY UVELICHENNOGO RAZMERA
\.{\\titlefont} I \.{\\ttitlefont} DLYA ZAGOLOVKOV DOKUMENTA, GDE
\.{\\ttitlefont} OPREDELYAET SHRIFT TIPA "PISHUSHCHAYA MASHINKA".
mAKROOPREDELENIYA \.{\\UNIX/} I \.{\\CEE/} OBOZNACHAYUT \UNIX/ I \CEE/,
NABRANNYE  SREDNIMI PROPISNYMI BUKVAMI.

\point 2. kOGDA V TEKSTE \TEX/ UPOMINAETSYA IDENTIFIKATOR,  OBYCHNO |TO
VYGLYADIT KAK `\.{|identifier|}'. nO TAKZHE VOZMOZHNA KONSTRUKCIYA
`\.{\\\\\{identifier\}}'. rEZULXTAT BUDET VYGLYADETX ODINAKOVO,
NO VTOROJ VARIANT NE POMESHCHAET \\{identifier} V INDEKS, POSKOLXKU NE
BUDET OBRABATYVATXSYA \.{CWEAVE} KAK KONSTRUKCIYA \CEE/. kROME TOGO, VO
VTOROM SLUCHAE PRIDETSYA POMESTITX `\.{\\}' PERED KAZHDYM SIMVOLOM
PODCHERKIVANIYA, VHODYASHCHIM V IDENTIFIKATOR.

\point 3. dLYA POLUCHENIYA STILYA "PISHUSHCHAYA MASHINKA", VRODE `\.{CWEB}', MOZHNO
VOSPOLXZOVATXSYA MAKROSOM `\.{\\.}' (NAPRIMER, `\.{\\.\{CWEB\}}').
zADAVAYA ARGUMENT |TOGO MAKROSA, SLEDUET VSTAVITX `\.{\\}' PERED
SIMVOLAMI, KOTORYE PERECHISLENY V PUNKTE `special string characters'
INDEKSA \.{CWEAVE}, T.E., PERED SIMVOLOM `\.{\\}', ZNAKOM DOLLARA
I PR. pOYAVLENIE V TEKSTE `\.{\\\ }' PRIVEDET K VSTAVKE SIMVOLA
"VIDIMOGO PROBELA"; CHTOBY POLUCHITX OBYKNOVENNYJ PROBEL POSLE KOMANDNOJ
POSLEDOVATELXNOSTI, ISPOLXZUJTE `\.{\{\ \}}'. eSLI STROKA SLISHKOM
DLINNAYA, ONA MOZHET BYTX RAZBITA NA CHASTI S POMOSHCHXYU `\.{\\)}'\,; ESLI
\TEX/ BUDET VYNUZHDEN PERENESTI STROKU, ON EE RAZDELIT NA |TOM SIMVOLE,
ISPOLXZUYA `\.{\\}' KAK SIMVOL PERENOSA.

\point 4. tRI KOMANDNYH SLOVA: \.{\\pagewidth}, \.{\\pageheight},
I \.{\\fullpageheight} MOGUT BYTX PEREOPREDELENY V SEKCII-PREAMBULE,
NACHINAYUSHCHEJ \.{CWEB}-FAJL, DLYA ZADANIYA NUZHNYH RAZMEROV STRANICY.
zNACHENIYA PO UMOLCHANIYU
$$\lpile{\.{\\pagewidth=6.5in}\cr
  \.{\\pageheight=8.7in}\cr
  \.{\\fullpageheight=9in}\cr}$$
ISPOLXZOVANY PRI PODGOTOVKE |TOGO RUKOVODSTVA; \.{\\fullpageheight}
POLUCHAETSYA SLOZHENIEM \.{\\pageheight} S RAZMEROM DOPOLNITELXNOGO ZAGOLOVKA
I NOMERA NAVERHU KAZHDOJ STRANICY. pOSLE IZMENENIYA HOTYA BY ODNOGO IZ |TIH
PARAMETROV SLEDUET NEMEDLENNO VYZVATX \.{\\setpage}.

\point 5. mAKROS \.{\\pageshift} OPREDELYAET VELICHINU, NA KOTORUYU
PRAVOSTORONNIE STRANICY (T.E., S NECHETNYMI NOMERAMI) BUDUT SDVINUTY PO
OTNOSHENIYU K LEVOSTORONNIM (CHETNYE NOMERA). iZMENYAYA |TU VELICHINU, MOZHNO
POLUCHITX DVUSTORONNIJ VYVOD, V KOTOROM NOMERA STRANIC BUDUT RASPOLAGATXSYA NA
PROTIVOPOLOZHNYH STORONAH LISTA.

\point 6. sODERZHIMOE \.{\\title} PECHATAETSYA VVERHU KAZHDOJ STRANICY
MALYMI PROPISNYMI BUKVAMI; PO UMOLCHANIYU |TO \.{\\jobname}.

\point 7. oBYCHNO PERVOJ STRANICE PRISVAIVAETSYA NOMER 1. chTOBY NACHATX SO
STRANICY 16, POMESTIV OGLAVLENIE NA STRANICE 15, ISPOLXZUJTE
`\.{\\def\\contentspagenumber\{15\}}
\.{\\pageno=\\contentspagenumber} \.{\\advance\\pageno by 1}'.

\point 8. kOMANDNOE SLOVO \.{\\iftitle} BUDET PODAVLYATX VYVOD
KOLONTITULA, ESLI ZADANO `\.{\\titletrue}'. oBYCHNOE ZNACHENIE ---
\.{\\titlefalse}, ZA ISKLYUCHENIEM OGLAVLENIYA, TAK CHTO STRANICY OGLAVLENIYA
KAK PRAVILO NE NUMERUYUTSYA.

dLYA PRIDANIYA GIBKOSTI PROCESSU GENERACII OGLAVLENIYA SLUZHAT SLEDUYUSHCHIE
MAKROSY: \.{\\topofcontents} VYZYVAETSYA NEPOSREDSTVENNO PERED
SCHITYVANIEM INFORMACII OGLAVLENIYA, I \.{\\botofcontents} --- POSLE |TOGO.
tIPICHNOE OPREDELENIE:
$$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr
  \.{ { }\\titlefalse \% include headline on the contents page}\cr
  \.{ { }\\def\\rheader\{\\mainfont The \{\\tt CWEAVE\}{ }processor\\hfil\}}\cr
  \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont CWEAVE\}{ }processor\}}\cr
  \.{ { }\\vskip 15pt \\centerline\{(Version 3.0)\}{ }\\vfill\}}\cr}$$
pEREOPREDELITX \.{\\rheader}, YAVLYAYUSHCHEESYA KOLONTITULOM PRAVOSTORONNIH STRANIC,
BUDET V |TOM SLUCHAE DOSTATOCHNO, CHTOBY RAZMESTITX NUZHNUYU INFORMACIYU V VERHNEJ
CHASTI STRANICY OGLAVLENIYA.

\point 9. dANNYE OGLAVLENIYA VYVODYATSYA V FAJL, KOTORYJ SCHITYVAETSYA POSLE
OBRABOTKI INDEKSA; KAZHDOJ ZAGLAVNOJ SEKCII SOOTVETSTVUET ODNA STROKA.
fAJL \.{common.toc} MOZHET VYGLYADETX TAK:
$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{23\}}\cr
  \.{\\ZZ \{The character set\}\{2\}\{5\}\{24\}}\cr}$$
I T.D. mAKROS \.{\\topofcontents} MOZHET PEREOPREDELITX
\.{\\ZZ}, TAK CHTO INFORMACIYA MOZHET BYTX VYVEDENA V LYUBOM NUZHNOM FORMATE.

\point 10. iNOGDA BYVAET ZHELATELXNO LIBO NEOBHODIMO RAZDELITX VYVOD
\.{CWEAVE} NA PODFAJLY, KOTORYE MOGUT OBRABATYVATXSYA RAZDELXNO.
nAPRIMER, LISTING \TEX/'A PREVYSHAET 500 STRANIC, CHEGO VPOLNE DOSTATOCHNO
DLYA ISCHERPANIYA VOZMOZHNOSTEJ MNOGIH PECHATAYUSHCHIH USTROJSTV I/ILI PROGRAMM.
kOGDA OCHENX BOLXSHOJ DOKUMENT NE RAZDELEN NA BOLEE MELKIE CHASTI,
POPYTKA OBRABOTATX EGO CELIKOM MOZHET BYTX SVEDENA NA NET EDINSTVENNOJ
OSHIBKOJ, POSLE KOTOROJ PRIDETSYA NACHATX VSE SNACHALA.

nIZHE OPISAN BEZOPASNYJ SPOSOB RAZDELITX VYHODNOJ FAJL \.{CWEAVE} NA TRI CHASTI:
pUSTX CHASTI NAZYVAYUTSYA $\alpha$, $\beta$, I $\gamma$, GDE KAZHDAYA CHASTX
NACHINAETSYA ZAGLAVNOJ SEKCIEJ.
vSE MAKROSY DOLZHNY OPREDELYATXSYA V PREAMBULE $\alpha$, A KOPII |TIH
PREDPISANIJ \TEX/'U DOLZHNY BYTX POMESHCHENY V NACHALO $\beta$ I $\gamma$.
chTOBY OBRABATYVATX CHASTI RAZDELXNO, MY DOLZHNY POZABOTITXSYA O DVUH VESHCHAH:
NOMERA NACHALXNYH STRANIC $\beta$ I $\gamma$ DOLZHNY BYTX SKORREKTIROVANY,
I DANNYE OGLAVLENIYA VSEH TREH CHASTEJ DOLZHNY BYTX OB�EDINENY.

fAJL \.{cwebmac} SODERZHIT DVA KOMANDNYH SLOVA: \.{\\contentsfile} I
\.{\\readcontents}, KOTORYE OBLEGCHAYUT VYPOLNENIE NEOBHODIMYH DEJSTVIJ.  nAM
TREBUETSYA VKLYUCHITX `\.{\\def\\contentsfile\{cont1\}}' V PREAMBULU $\alpha$,
A `\.{\\def\\contentsfile\{cont2\}}' --- V PREAMBULU $\beta$;
|TO ZASTAVIT \TEX/ VYVESTI DANNYE OGLAVLENIJ $\alpha$ I $\beta$ V
FAJLY \.{cont1.tex} I \.{cont2.tex}. tEPERX V $\gamma$ MY UKAZYVAEM
$$\.{\\def\\readcontents\{\\input cont1 \\input cont2
  \\input \\contentsfile\}}\,,$$
SOBIRAYA VSE DANNYE VMESTE V NUZHNOM PORYADKE.

tEM NE MENEE, PO-PREZHNEMU SVOEGO RESHENIYA TREBUET PROBLEMA NUMERACII
STRANIC. oDNIM IZ EE PUTEJ EE RESHENIYA BUDET VKLYUCHITX V PREAMBULU $\beta$
SLEDUYUSHCHEE:
$$\lpile{\.{\\message\{Please type the last page number of part 1: \}}\cr
  \.{\\read -1 to \\temp \\pageno=\\temp \\advance\\pageno by 1}\cr}$$
dALEE NEOBHODIMAYA INFORMACIYA PROSTO VVODITSYA PO ZAPROSU \TEX/'A;
ANALOGICHNAYA KONSTRUKCIYA POMESHCHAETSYA V NACHALE $\gamma$.

eTOT METOD, BEZUSLOVNO, MOZHET ISPOLXZOVATXSYA DLYA RAZBIENIYA VYHODNOGO
FAJLA NA PROIZVOLXNOE CHISLO FRAGMENTOV.

\point 11. vREMENAMI  NUZHNO VKLYUCHATX V INDEKS |LEMENTY, OFORMLENNYE
OSOBYM OBRAZOM. nAPRIMER, NAM MOZHET PONADOBITXSYA IMETX |LEMENT
INDEKSA DLYA `\TeX'. \.{CWEAVE} PREDOSTAVLYAET DVA PROSTYH SPOSOBA ZADATX
YAVNO |LEMENT INDEKSA (POMIMO IMEN I KLYUCHEVYH SLOV):
`\.{@\^}' DAET ROMANSKIJ STILX, A `\.{@.}' --- STILX "PISHUSHCHAYA MASHINKA".
nO ESLI MY POPYTAEMSYA VYVESTI `\TeX' V ROMANSKOM STILE,
ZADAV `\.{@\^\\TeX@>}', NAM POMESHAET SIMVOL `\.{\\}',
I |TOT |LEMENT INDEKSA NE POYAVITSYA VMESTE S DRUGIMI, NACHINAYUSHCHIMISYA
NA T.

rESHENIEM BUDET ISPOLXZOVATX KONSTRUKCIYU `\.{@:}', OPREDELIV MAKROS,
KOTORYJ PROSTO UDALYAET KLYUCH:
$$\.{\\def\\9\#1\{\}}$$
vY MOZHETE ZADATX, K PRIMERU, `\.{@:TeX\}\{\\TeX@>}' V SVOEM \.{CWEB}-FAJLE;
\.{CWEAVE} POMESTIT |TO V INDEKS V ALFAVITNOM PORYADKE, SOOTVETSTVENNO
KLYUCHU, I SGENERIRUET MAKROVYZOV `\.{\\9\{TeX\}\{\\TeX\}}', KOTORYJ
GARANTIRUET, CHTO KLYUCH NE BUDET NAPECHATAN.

aNALOGICHNO V IMENA SEKCIJ MOZHET POMESHCHATXSYA SKRYTYJ MATERIAL, TAK CHTO ONI
MOGUT BYTX SORTIROVANY V LYUBOM NEOBHODIMOM PORYADKE.
nEKOTORYE LYUDI NAZYVAYUT PODOBNYE TRYUKI ``special refinements''; DRUGIE
ZOVUT IH ``kludges''.

\point 12. kOMANDNOMU SLOVU \.{\\secno} PRISVAIVAETSYA NOMER
TEKUSHCHEJ OBRABATYVAEMOJ SEKCII.

\point 13. eSLI VY HOTITE VYVESTI NA PECHATX TOLXKO SEKCII, KOTORYE BYLI
IZMENENY (S POMOSHCHXYU FAJLA KORREKTIV) I OGLAVLENIE,
POMESTITE KOMANDU `\.{\\let\\maybe=\\iffalse}'
V PREAMBULU, PERED PERVOJ SEKCIEJ FAJLA \.{CWEB}. oBSHCHEPRINYATOJ PRAKTIKOJ
YAVLYAETSYA SDELATX EE PERVOJ KORREKTIVOJ.

\point 14. dLYA PECHATI NA DRUGIH YAZYKAH (NE PO-ANGLIJSKI), PEREOPREDELITE
MAKROSY \.{\\A}, \.{\\ET}, \.{\\Q}, \.{\\U},
\.{\\ch}, \.{\\fin}, \.{\\con}, \.{\\today}, \.{\\datethis}, I
\.{\\datecontentspage}. sOBSTVENNO \.{CWEAVE} IZMENYATX NE TREBUETSYA.

\point 15. vYVOD OTDELXNYH CHASTEJ DOKUMENTA MOZHET BYTX IZBIRATELXNO
ZAPRESHCHEN S POMOSHCHXYU \.{\\noatl}, \.{\\noinx}, \.{\\nosecs}, \.{\\nocon}.

\point 16. vSE DIAKRITICHESKIE ZNAKI I DRUGIE SPECIALXNYE TEKSTOVYE
SIMVOLY  FORMATA plain \TEX/ BUDUT RABOTATX V DOKUMENTAH \.{CWEB} V
TOCHNOSTI TAK, KAK |TO OPISANO V GLAVE~9 {\sl The \TEX/book}, S ODNIM
ISKLYUCHENIEM. aKCENT "TOCHKA" (OBYCHNO \.{\\.}) DOLZHEN VVODITXSYA KAK \.{\\:}.

\point 17. "zAKOMMENTIROVANNYE" STROKI \.{cwebmac.tex} PREDLAGAYUT
NEKOTORYE DOPOLNITELXNYE VOZMOZHNOSTI, KOTORYE MOGUT PRIGODITXSYA
POLXZOVATELYAM. nAPRIMER, ODNA IZ NIH VSTAVLYAET PUSTUYU
STRANICU, ESLI U VAS DUPLEKSNYJ PRINTER. pRILOZHENIYA D, E, I F V POLNOJ
VERSII |TOGO RUKOVODSTVA NAPECHATANY S ISPOLXZOVANIEM ZAKOMMENTIROVANNOJ
OPCII, KOTORAYA ZAMENYAET `$\gets$' NA `$=$' V LISTINGAH PROGRAMM. vY
MOZHETE PROSMOTRETX |TI PRILOZHENIYA, CHTOBY RESHITX, KAKOJ FORMAT VAM BOLXSHE
NRAVITSYA.

\vfill\end
