home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / packages / LaTeXinfo.shar.3 / latexinfo.sty < prev    next >
Encoding:
Text File  |  1990-07-22  |  18.1 KB  |  637 lines

  1. %% TeX macros to handle latexinfo files
  2. %% \include{ 5 page GNU copyleft here }
  3. %   Copyright (C) 1985, 1986 Richard M. Stallman
  4. %   Copyleft  (0) 1988, 1989 Michael E. Clarkson
  5.  
  6. \def\latexinfoversion{1.2}
  7. \message{Loading Latexinfo package [Version \latexinfoversion]:}
  8. \message{}
  9.  
  10. \setcounter{tocdepth}{2}
  11. \setcounter{secnumdepth}{3}
  12.  
  13. \def\oddfoot#1{\def\@oddfoot{#1}}
  14. \def\evenfoot#1{\def\@evenfoot{#1}}
  15.  
  16. % Save some parts of plain tex whose names we will redefine.
  17.  
  18. \let\ptexlbrace=\{
  19. \let\ptexrbrace=\}
  20. \let\ptexdot=\.
  21. \let\ptexstar=\*
  22. \let\ptexend=\end
  23. \let\ptexbullet=\bullet
  24. \let\ptexb=\b
  25. \let\ptexc=\c
  26. \let\ptexi=\i
  27. \let\ptext=\t
  28. \let\ptexl=\l
  29. \let\ptexL=\L
  30. \def\pline{\hbox to\hsize}
  31. \def\pleftline#1{\pline{#1\hss}}
  32. \def\prightline#1{\pline{\hss#1}}
  33.  
  34. \def\centerline#1{\pline{\hss#1\hss}}
  35.  
  36. \def\tie{\penalty 10000\ }     % Save plain tex definition of ~.
  37.  
  38. \let\normal=\normalsize
  39.  
  40. \message{Basics,}
  41. \chardef\other=12
  42.  
  43. \hyphenation{ap-pen-dix}
  44. \hyphenation{mini-buf-fer mini-buf-fers}
  45.  
  46. % Parse an argument, then pass it to #1.
  47. % The argument can be delimited with [...] or with "..." or braces
  48. % or it can be a whole line.
  49. % #1 should be a macro which expects
  50. % an ordinary undelimited TeX argument.
  51.  
  52. \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
  53.  
  54. \def\parseargx{%
  55. \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
  56. \aftergroup \parseargline %
  57. \fi \endgroup}
  58.  
  59. {\obeyspaces %
  60. \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
  61.  
  62. \gdef\obeyedspace{\ }
  63.  
  64. \def\parseargline{\begingroup \obeylines \parsearglinex}
  65. {\obeylines %
  66. \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
  67.  
  68. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  69.  
  70. % Single-spacing is done by various environments.
  71.  
  72. \newskip\singlespaceskip
  73. \singlespaceskip = \baselineskip
  74. \def\singlespace{%
  75. {\advance \baselineskip by -\singlespaceskip
  76. \kern \baselineskip}%
  77. \baselineskip=\singlespaceskip
  78. }
  79.  
  80. \def\arrow{$\rightarrow$}
  81.  
  82. % Used to generate quoted braces.
  83.  
  84. \def\mylbrace {{\tt \char '173}}
  85. \def\myrbrace {{\tt \char '175}}
  86. \let\{=\mylbrace
  87. \let\}=\myrbrace
  88.  
  89. % \: forces normal size whitespace following.
  90. \def\:{\spacefactor=1000 }
  91.  
  92. % \* forces a line break.
  93. \def\*{\hfil\break}
  94.  
  95. % \. is an end-of-sentence period.
  96. \def\.{.\spacefactor=3000 }
  97.  
  98. % \w prevents a word break
  99. \def\w#1{\hbox{#1}}
  100.  
  101. % \br   forces paragraph break
  102.  
  103. \let\br = \par
  104.  
  105. % \dots{}  output some dots
  106.  
  107. \def\dots{$\ldots$}
  108.  
  109. % \page    forces the start of a new page
  110. %\def\page{\clearpage}
  111.  
  112. % \exdent text....
  113. % outputs text on separate line in roman font, starting at standard page margin
  114.  
  115. \def\exdent{\errmessage{@exdent in filled text}}
  116.   % \lisp, etc, define \exdent locally from \internalexdent
  117.  
  118. {\obeyspaces
  119. \gdef\internalexdent{\parsearg\exdentzzz}}
  120.  
  121. \def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing
  122. \advance \hsize by -\leftskip
  123. \advance \hsize by -\rightskip
  124. \leftline{{\rm#1}}}}
  125.  
  126. % \sp n   outputs n lines of vertical space
  127. \def\sp#1{\par\vskip #1\baselineskip\relax}
  128.  
  129. % \comment ...line which is ignored...
  130. % \c is the same as @comment
  131. % \begin{ignore} ... \end{ignore}  is another way to write a comment
  132. \def\comment{\parsearg \commentxxx}
  133.  
  134. \def\commentxxx #1{}
  135.  
  136. \let\c=\comment
  137.  
  138. % Some texinfo constructs that are trivial in tex
  139. \newenvironment{iftex}{}{}
  140.  
  141. \catcode`@=11
  142.  
  143. \message{menus,}
  144. {\catcode`\^^M=13 \gdef\@gobblecr{\@ifnextchar
  145. {\@gobble}{\ignorespaces}}}
  146.  
  147. \chardef\active=13
  148.  
  149. {\catcode`\ =\active\gdef\@vobeyspaces{\catcode`\ \active \let \@xobeysp}}
  150.  
  151. \begingroup \catcode `|=0 \catcode `[= 1
  152. \catcode`]=2 \catcode `\{=12 \catcode `\}=12
  153. \catcode`\\=12 
  154. |gdef|@xmenu#1\end{menu}[|end[menu]]
  155. |gdef|@xifinfo#1\end{ifinfo}[|end[ifinfo]]
  156. |gdef|@xignore#1\end{ignore}[|end[ignore]]
  157. |endgroup
  158.  
  159. \def\@menu{\begingroup
  160. \@tempswafalse 
  161. \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
  162. \obeylines \let\do\@makeother \dospecials}
  163.  
  164. \def\menu{\@menu\@xmenu }
  165. \let\endmenu=\endgroup
  166. \def\ifinfo{\@menu\@xifinfo }
  167. \let\endifinfo=\endgroup
  168. \def\ignore{\@menu\@xignore }
  169. \let\endignore=\endgroup
  170.  
  171. \def\node{\parsearg\nodezzz}
  172. \def\nodezzz#1{\nodexxx [#1,]}
  173. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  174. %\def\node#1#2#3#4{\gdef\lastnode{#1}}
  175. \let\lastnode=\relax
  176.  
  177.  
  178. \let\refill=\relax
  179.  
  180. \let\setfilename=\comment
  181.  
  182. \def\inforef #1{\inforefzzz #1,,,,**}
  183. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}}, node `\losespace#1{}'}
  184. \def\losespace #1{#1}
  185.  
  186. \message{fonts,}
  187.  
  188. % Font-change commands.
  189.  
  190. \def\li{\sf}
  191.  
  192. %% Add scribe-like font environments, plus \l for inline lisp (usually sans
  193. %% serif) and \ii for TeX italic
  194.  
  195. \def\i#1{{\sl #1}}
  196. \let\var=\i
  197. \let\dfn=\i
  198. \let\emph=\i
  199.  
  200. \def\b#1{{\bf #1}}
  201. \let\strong=\b
  202.  
  203. \def\t#1{{\tt \rawbackslash #1}\null}
  204. \let\ttfont=\t
  205. \let\kbd=\t
  206. \let\code=\t
  207. \def\samp#1{`{\tt \rawbackslash #1}'\null}
  208. \def\key#1{{\tt \uppercase{#1}}\null}
  209. \def\ctrl#1{$\uparrow${\tt #1}}
  210.  
  211. \let\file=\samp
  212.  
  213. \def\l#1{{\li #1}\null}
  214.  
  215. \def\r#1{{\rm #1}}
  216. \def\s#1{{\sc #1}}
  217. \def\ii#1{{\it #1}}
  218.  
  219. \def\bullet{$\ptexbullet$}
  220. \def\labelitemi{$\ptexbullet$}
  221.  
  222. \def\minus{$-$}
  223.  
  224. % Make altmode in file print out right
  225.  
  226. \catcode `\^^[=\active \def^^[{$\diamondsuit$}
  227.  
  228. \message{indexing,}
  229. % Index generation facilities
  230.  
  231. % Define the texinfo user-accessible indexing commands for backwrds 
  232. % compatability.
  233.  
  234. \def\findex{\fnindex}
  235. \def\kindex{\kyindex}
  236. \def\cindex{\cpindex}
  237. \def\vindex{\vrindex}
  238. \def\tindex{\tpindex}
  239. \def\pindex{\pgindex}
  240. \def\cindex{\cpindex}
  241.  
  242.  
  243. % \newindex {foo} defines an index named foo.
  244. % It automatically defines \fooindex such that
  245. % \fooindex ...rest of line... puts an entry in the index foo.
  246. % It also defines \fooindfile to be the number of the output channel for
  247. % the file that    accumulates this index.  The file's extension is foo.
  248. % The name of an index should be no more than 2 characters long
  249. % for the sake of vms.
  250.  
  251. \def\newindex#1{\csname newindex#1\endcsname}
  252.  
  253. % Yes I know this could be done shorter, but safer??
  254.  
  255. \def\newindexcp{\if@filesw \newwrite\@cpindexfile
  256.   \immediate\openout\@cpindexfile=\jobname.cp
  257.   \def\cpindex{\@bsphack\begingroup
  258.              \def\protect####1{\string####1\space}\@sanitize
  259.              \@wrindex\@cpindexfile}%
  260.   \def\cpsubindex{\@bsphack\begingroup
  261.              \def\protect####1{\string####1\space}\@sanitize
  262.              \@wrsubindex\@cpindexfile}%
  263.   \def\cpindexbold{\@bsphack\begingroup
  264.              \def\protect####1{\string####1\space}\@sanitize
  265.              \@wrindexbold\@cpindexfile}
  266.    \typeout{Writing concepts index file \jobname.cp }%
  267.    \fi}
  268.  
  269. \def\cpindex{\@bsphack\begingroup \@sanitize\@index}
  270. \def\cpsubindex{\@bsphack\begingroup \@sanitize\@index}
  271. \def\cpindexbold{\@bsphack\begingroup \@sanitize\@index}
  272.  
  273. \def\@wrindex#1#2{\let\thepage\relax
  274.    \xdef\@gtempa{\write#1{\string \entry{#2}{\thepage}{#2}}}\endgroup\@gtempa
  275.    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
  276.  
  277. \def\@wrindexbold#1#2{\let\thepage\relax \let\bf\relax
  278.    \xdef\@gtempa{\write#1{\string \entry{#2}{\b{\thepage}}{#2}}}\endgroup\@gtempa
  279.    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
  280.  
  281. \def\@wrsubindex#1#2#3{\let\thepage\relax
  282.     \xdef\@gtempa{\write#1{\string \entry{#2 #3}{\thepage}{#2}{#3}}}\endgroup%
  283.     \@gtempa
  284.    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
  285.  
  286. \def\@index#1{\endgroup\@esphack}
  287.  
  288. \def\pgindex{\@bsphack\begingroup \@sanitize\@index}
  289. \def\newindexpg{\if@filesw \newwrite\@pgindexfile
  290.   \immediate\openout\@pgindexfile=\jobname.pg
  291.   \def\pgindex{\@bsphack\begingroup
  292.              \def\protect####1{\string####1\space}\@sanitize
  293.              \@wrindex\@pgindexfile}\typeout{Writing index file \jobname.pg }\fi}
  294.  
  295. \def\newindexvr{\if@filesw \newwrite\@vrindexfile
  296.   \immediate\openout\@vrindexfile=\jobname.vr
  297.   \def\vrindex{\@bsphack\begingroup
  298.              \def\protect####1{\string####1\space}\@sanitize
  299.              \@wrindex\@vrindexfile}
  300.   \def\vrindexbold{\@bsphack\begingroup
  301.              \def\protect####1{\string####1\space}\@sanitize
  302.              \@wrindexbold\@vrindexfile}
  303.     \typeout{Writing variable index file \jobname.vr }\fi}
  304.  
  305. \def\vrindex{\@bsphack\begingroup \@sanitize\@index}
  306. \def\vrindexbold{\@bsphack\begingroup \@sanitize\@index}
  307.  
  308. \def\newindextp{\if@filesw \newwrite\@tpindexfile
  309.   \immediate\openout\@tpindexfile=\jobname.tp
  310.   \def\tpindex{\@bsphack\begingroup
  311.              \def\protect####1{\string####1\space}\@sanitize
  312.              \@wrindex\@tpindexfile}
  313.     \typeout{Writing datatype index file \jobname.tp }\fi}
  314.  
  315. \def\tpindex{\@bsphack\begingroup \@sanitize\@index}
  316.  
  317. \def\newindexky{\if@filesw \newwrite\@kyindexfile
  318.   \immediate\openout\@kyindexfile=\jobname.ky
  319.   \def\kyindex{\@bsphack\begingroup
  320.              \def\protect####1{\string####1\space}\@sanitize
  321.              \@wrindex\@kyindexfile}\typeout{Writing key index file \jobname.ky }\fi}
  322.  
  323. \def\kyindex{\@bsphack\begingroup \@sanitize\@index}
  324.  
  325. \def\newindexfn{\if@filesw \newwrite\@fnindexfile
  326.   \immediate\openout\@fnindexfile=\jobname.fn
  327.   \def\fnindex{\@bsphack\begingroup
  328.              \def\protect####1{\string####1\space}\@sanitize
  329.              \@wrindex\@fnindexfile}
  330.   \def\fnindexbold{\@bsphack\begingroup
  331.              \def\protect####1{\string####1\space}\@sanitize
  332.              \@wrindexbold\@fnindexfile}
  333.     \typeout{Writing function index file \jobname.fn }\fi}
  334.  
  335. \def\fnindex{\@bsphack\begingroup \@sanitize\@index}
  336.  
  337.  
  338. % \synindex{foo}{bar}    makes index foo feed into index bar.
  339. \def\synindex#1#2{\expandafter\xdef \csname @#1index\endcsname{%
  340.     \noexpand\csname @#2index\endcsname}%
  341. \expandafter \chardef \csname @#1indfile\endcsname=\csname @#2indfile\endcsname}
  342.  
  343.  
  344. % Define the macros used in formatting output of the sorted index material.
  345. % This is what you call to cause a particular index to get printed.
  346. % Write
  347. % \section*{Function Index}
  348. % \printindex{fn}
  349.  
  350. \newskip\secondaryindent
  351. \secondaryindent=0.5cm
  352.  
  353. %\catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  354. %\catcode`\@=\other\catcode`\$=\other\catcode`\_=\other
  355. %\catcode`\~=\other\catcode`\^=\other
  356. %\tex %
  357. %\catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  358. %\catcode`\@=\other\catcode`\$=\other\catcode`\_=\other
  359. %\catcode`\~=\other\catcode`\^=\other
  360.  
  361. \def\printindex#1{
  362. \def\indexbackslash{\rawbackslashxx}
  363. \tolerance=9500 \advance\baselineskip -1pt
  364. \openin 1 \jobname.#1s
  365. \ifeof 1 \else \closein 1 \input \jobname.#1s
  366. \fi
  367. }
  368.  
  369. % These macros are used by the sorted index file itself.
  370. % Change them to control the appearance of the index.
  371.  
  372. \def\Dotsbox{\hbox to 1em{\hss.\hss}} % Used by index macros
  373.  
  374. \def\initial#1{%
  375. {\bigbreak\pline{\large\bf#1\hfill}\kern 2pt\penalty3000}}
  376.  
  377. \def\entry #1#2{
  378. {\parfillskip=0in \parskip=0in \parindent=0in \small
  379. \hangindent=1in \hangafter=1%
  380. \noindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll\relax #2\par
  381. }}
  382.  
  383. \def\primary #1{\pline{\small#1\hfil}}
  384.  
  385. \def\secondary #1#2{
  386. {\parfillskip=0in \parskip=0in \small
  387. \hangindent =1in \hangafter=1
  388. \noindent\hskip\secondaryindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll#2\par
  389. }}
  390.  
  391. %%% Args are the skip and penalty (usually negative)
  392. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  393.  
  394. \message{environments,}
  395.  
  396. % \begin{tex} ... \end{tex}    escapes into raw Tex temporarily.
  397.  
  398. \def\tex{\begingroup
  399. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  400. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  401. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  402. \catcode `\%=14
  403. \catcode`\"=12
  404. \catcode`\|=12
  405. \catcode`\<=12
  406. \catcode`\>=12
  407.  
  408. \let\{=\ptexlbrace
  409. \let\}=\ptexrbrace
  410. \let\.=\ptexdot
  411. \let\*=\ptexstar
  412. \let\bullet=\ptexbullet
  413. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  414. \let\L=\ptexL
  415.  
  416. \let\endtex=\endgroup}
  417.  
  418. % Define \lisp ... \endlisp.
  419. % \lisp does a \begingroup so it can rebind things,
  420. % including the definition of \endlisp (which normally is erroneous).
  421.  
  422. % Amount to narrow the margins by for \lisp.
  423. \newskip\lispnarrowing \lispnarrowing=\parindent
  424.  
  425. % This is the definition that ^M gets inside \lisp
  426. % phr: changed space to \null, to avoid overfull hbox problems.
  427. {\obeyspaces%
  428. \gdef\lisppar{\null\endgraf}}
  429.  
  430. % Cause \obeyspaces to make each Space cause a word-separation
  431. % rather than the default which is that it acts punctuation.
  432. % This is because space in tt font looks funny.
  433. {\obeyspaces %
  434. \gdef\sepspaces{\def {\ }}}
  435.  
  436. \newskip\aboveenvskipamount \aboveenvskipamount= 0pt
  437. \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
  438. \endgraf \ifdim\lastskip<\aboveenvskipamount
  439. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
  440.  
  441. \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
  442. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
  443.  
  444. \newenvironment{example}{\aboveenvbreak
  445.     \hfuzz=12truept % Don't be fussy
  446.     \sepspaces % Make spaces be word-separators rather than space tokens.
  447.     \singlespace % Single space lines
  448.     % The following causes blank lines not to be ignored
  449.     % by adding a space to the end of each line.
  450.     \let\par=\lisppar
  451.     \parskip=0pt \advance \rightskip by \lispnarrowing 
  452.     \advance \leftskip by \lispnarrowing
  453.     \parindent=0pt
  454.     \let\exdent=\internalexdent
  455.     \obeyspaces \obeylines \tt \rawbackslash \bgroup\samepage
  456.     \def\next##1{}\next}{\egroup\afterenvbreak}
  457.  
  458. %same is the same as an enclosed \samepage
  459. \newenvironment{same}{\bgroup\samepage}{\egroup}
  460.  
  461. % This is \begin{display}; same as \begin{lisp} except use roman font.
  462.  
  463. \newenvironment{display}{\aboveenvbreak
  464.     % Make spaces be word-separators rather than space tokens.
  465.     \sepspaces %
  466.     % Single space lines
  467.     \singlespace %
  468.     % The following causes blank lines not to be ignored
  469.     % by adding a space to the end of each line.
  470.     \let\par=\lisppar
  471.     \parskip=0pt \advance \rightskip by \lispnarrowing 
  472.     \advance \leftskip by \lispnarrowing
  473.     \parindent=0pt
  474.     \let\exdent=\internalexdent
  475.     \obeyspaces \obeylines
  476.         \def\next##1{}\next}{\afterenvbreak}
  477.  
  478. % This is \format; same as \lisp except use roman font and don't narrow margins
  479.  
  480. \newenvironment{format}{\aboveenvbreak
  481.     % Make spaces be word-separators rather than space tokens.
  482.     \sepspaces %
  483.     \singlespace %
  484.     % The following causes blank lines not to be ignored
  485.     % by adding a space to the end of each line.
  486.     \let\par=\lisppar
  487.     \parskip=0pt \parindent=0pt
  488.     \obeyspaces \obeylines
  489.     \def\next##1{}\next}{\afterenvbreak}
  490.  
  491. \message{cross reference,}
  492. % Define cross-reference macros
  493.  
  494. % \xref and \pxref generate cross references to specified points.
  495.  
  496. \def\pxref #1{see \xrefX [#1,,,,,,,]}
  497. \def\xref #1{See \xrefX [#1,,,,,,,]}
  498.  
  499. %\def\xrefX [#1,#2,#3,#4,#5,#6]{section \ref{#1} [%
  500. %{\setbox0=\hbox{\losespace#3{}}%
  501. %\ifdim \wd0 =0pt \losespace#1{}\else\unhbox0\fi}],
  502. %page\tie \pageref{#1}}
  503.  
  504. \def\xrefX [#1,#2,#3,#4,#5,#6]{%
  505. \setbox1=\hbox{\i{\losespace#5{}}}%
  506. \setbox0=\hbox{\losespace#3{}}%
  507. \ifdim \wd0 =0pt \setbox0=\hbox{\losespace#1{}}\fi%
  508. \ifdim \wd1 >0pt%
  509. section \unhbox0{} in \unhbox1%
  510. \else%
  511. \ref{#1} [\unhbox0], page\tie \pageref{#1}%
  512. \fi }
  513.  
  514. \message{sectioning,}
  515. % Define chapters, sections, etc.
  516.  
  517. \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
  518.  \refstepcounter{chapter}
  519. \ifx\lastnode\relax\else\label{\lastnode}\fi
  520. \let\lastnode=\relax
  521.  \typeout{\@chapapp\space\thechapter.}
  522.  \addcontentsline{toc}{chapter}{\protect
  523.  \numberline{\thechapter}#1}\else
  524.  \addcontentsline{toc}{chapter}{#1}\fi
  525.  \chaptermark{#1}
  526.  \addtocontents{lof}{\protect\addvspace{10pt}}
  527. \addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn
  528. \@topnewpage[\@makechapterhead{#2}] 
  529.  \else \@makechapterhead{#2}
  530.  \@afterheading \fi} 
  531. \def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
  532.  \else \@makeschapterhead{#1} 
  533.  \@afterheading\fi}
  534.  
  535. \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  536.      \def\@svsec{}\else 
  537.      \refstepcounter{#1}
  538. \ifx\lastnode\relax\else\label{\lastnode}\fi
  539. \let\lastnode=\relax
  540.     \edef\@svsec{\csname the#1\endcsname\hskip 1em }\fi
  541.      \@tempskipa #5\relax
  542.       \ifdim \@tempskipa>\z@ 
  543.         \begingroup #6\relax
  544.           \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
  545.         \endgroup
  546.        \csname #1mark\endcsname{#7}\addcontentsline
  547.          {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  548.                       \protect\numberline{\csname the#1\endcsname}\fi
  549.                     #7}\else
  550.         \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
  551.                       {#7}\addcontentsline
  552.                            {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  553.                              \protect\numberline{\csname the#1\endcsname}\fi
  554.                        #7}}\fi
  555.      \@xsect{#5}}
  556.  
  557. \def\smallbook{
  558. \global\lispnarrowing = 0.3in
  559. \global\baselineskip 12pt
  560. \global\parskip 3pt plus 1pt
  561. \global\hsize = 5in
  562. \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
  563. \global\vsize=7.5in
  564. \global\tolerance=700
  565. \global\hfuzz=1pt
  566.  
  567. \global\pagewidth=\hsize
  568. \global\pageheight=\vsize
  569. \global\font\ninett=cmtt9
  570.  
  571. \global\let\smalllisp=\smalllispx
  572. \global\let\smallexample=\smalllispx
  573. \global\def\Esmallexample{\Esmalllisp}
  574. }
  575.  
  576. %% For a final copy, take out the rectangles
  577. %% that mark overfull boxes (in case you have decided
  578. %% that the text looks ok even though it passes the margin).
  579. \def\finalout{\overfullrule=0pt}
  580.  
  581. \message{and turning on texinfo input format.}
  582.  
  583. {\catcode`\@=0
  584.  
  585. % \rawbackslashxx output one backslash character in current font
  586. {\catcode`\\=\other
  587. @gdef@rawbackslashxx{\}}
  588.  
  589. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  590. {\catcode`\\=\active
  591. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  592. }
  593.  
  594. % \back outputs one backslash in fixed width font.
  595. \gdef\back{\tt\rawbackslashxx\ignorespaces}
  596.  
  597. \def\document{\endgroup
  598.   \@colht\textheight  \@colroom\textheight \vsize\textheight
  599.    \columnwidth\textwidth \@clubpenalty\clubpenalty
  600.    \if@twocolumn \advance\columnwidth -\columnsep 
  601.       \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue 
  602.    \fi
  603.   \hsize\columnwidth \linewidth\hsize
  604.   \begingroup\@floatplacement\@dblfloatplacement
  605.    \makeatletter\let\@writefile\@gobbletwo
  606.    \@input{\jobname.aux}\endgroup 
  607.   \if@filesw \immediate\openout\@mainaux=\jobname.aux
  608.     \immediate\write\@mainaux{\relax}\fi
  609.   \def\do##1{\let ##1\@notprerr}
  610.   \@preamblecmds
  611.   \let\do\noexpand
  612. \@normalsize\everypar{}\nospecials}
  613.  
  614.  
  615. % Here is a list of the characters that have been specially catcoded:
  616. \def\dosomespecials{\do\$\do\&\do\#\do\%\do\~\do\^}
  617.  
  618. {\catcode`\"=\active
  619. \catcode`\>=\active
  620. \catcode`\<=\active
  621. \catcode`\_=\active
  622. \gdef\nospecials{
  623. \catcode`\"=\active
  624. \gdef\activedoublequote{{\tt \char '042}}
  625. \let"=\activedoublequote
  626. \catcode`\>=\active
  627. \gdef\activegtr{{\tt \char '076}}
  628. \let>=\activegtr
  629. \catcode`\<=\active
  630. \gdef\activeless{{\tt \char '074}}
  631. \let<=\activeless
  632. \catcode`\_=\active
  633. \gdef\activeunderscore{{\tt \char '137}}
  634. \let_=\activeunderscore
  635. \@noligs\let\do\@makeother \dosomespecials}
  636. }
  637.