-
Notifications
You must be signed in to change notification settings - Fork 1
/
texinfo.tex
4506 lines (3914 loc) · 146 KB
/
texinfo.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% TeX macros to handle texinfo files
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 1996 Free Software Foundation, Inc.
%This texinfo.tex file is free software; you can redistribute it and/or
%modify it under the terms of the GNU General Public License as
%published by the Free Software Foundation; either version 2, or (at
%your option) any later version.
%This texinfo.tex file is distributed in the hope that it will be
%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%General Public License for more details.
%You should have received a copy of the GNU General Public License
%along with this texinfo.tex file; see the file COPYING. If not, write
%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%Boston, MA 02111-1307, USA.
%In other words, you are welcome to use, share and improve this program.
%You are forbidden to forbid anyone else to use, share and improve
%what you give them. Help stamp out software-hoarding!
% Send bug reports to [email protected].
% Please include a *precise* test case in each bug report.
% Make it possible to create a .fmt file just by loading this file:
% if the underlying format is not loaded, start by loading it now.
% Added by gildea November 1993.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 2.166 $
\message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
\catcode`+=\active \catcode`\_=\active}
% Save some parts of plain tex whose names we will redefine.
\let\ptextilde=\~
\let\ptexlbrace=\{
\let\ptexrbrace=\}
\let\ptexdots=\dots
\let\ptexdot=\.
\let\ptexstar=\*
\let\ptexend=\end
\let\ptexbullet=\bullet
\let\ptexb=\b
\let\ptexc=\c
\let\ptexi=\i
\let\ptext=\t
\let\ptexl=\l
\let\ptexL=\L
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
% Avoid using \@M directly, because that causes trouble
% if the definition is written into an index file.
\global\let\tiepenalty = \@M
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
\let\~ = \tie % And make it available as @~.
\message{Basics,}
\chardef\other=12
% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J
% Set up fixed words for English.
\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
\def\putwordInfo{Info}%
\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
% Ignore a token.
%
\def\gobble#1{}
\hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}
% Margin to add to right of even pages, to left of odd pages.
\newdimen \bindingoffset \bindingoffset=0pt
\newdimen \normaloffset \normaloffset=\hoffset
\newdimen\pagewidth \newdimen\pageheight
\pagewidth=\hsize \pageheight=\vsize
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
% since that produces some useless output on the terminal.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\loggingall{\tracingcommands2 \tracingstats2
\tracingpages1 \tracingoutput1 \tracinglostchars1
\tracingmacros2 \tracingparagraphs1 \tracingrestores1
\showboxbreadth\maxdimen\showboxdepth\maxdimen
}%
%---------------------Begin change-----------------------
%
%%%% For @cropmarks command.
% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
%
\newdimen\cornerlong \newdimen\cornerthick
\newdimen \topandbottommargin
\newdimen \outerhsize \newdimen \outervsize
\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
\outerhsize=7in
%\outervsize=9.5in
% Alternative @smallbook page size is 9.25in
\outervsize=9.25in
\topandbottommargin=.75in
%
%---------------------End change-----------------------
% \onepageout takes a vbox as an argument. Note that \pagecontents
% does insertions itself, but you have to call it yourself.
\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
\def\onepageout#1{\hoffset=\normaloffset
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
{\escapechar=`\\\relax % makes sure backslash is used in output files.
\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
{\let\hsize=\pagewidth \makefootline}}}%
\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
%%%% For @cropmarks command %%%%
% Here is a modification of the main output routine for Near East Publications
% This provides right-angle cropmarks at all four corners.
% The contents of the page are centerlined into the cropmarks,
% and any desired binding offset is added as an \hskip on either
% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
%
\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
{\escapechar=`\\\relax % makes sure backslash is used in output files.
\shipout
\vbox to \outervsize{\hsize=\outerhsize
\vbox{\line{\ewtop\hfill\ewtop}}
\nointerlineskip
\line{\vbox{\moveleft\cornerthick\nstop}
\hfill
\vbox{\moveright\cornerthick\nstop}}
\vskip \topandbottommargin
\centerline{\ifodd\pageno\hskip\bindingoffset\fi
\vbox{
{\let\hsize=\pagewidth \makeheadline}
\pagebody{#1}
{\let\hsize=\pagewidth \makefootline}}
\ifodd\pageno\else\hskip\bindingoffset\fi}
\vskip \topandbottommargin plus1fill minus1fill
\boxmaxdepth\cornerthick
\line{\vbox{\moveleft\cornerthick\nsbot}
\hfill
\vbox{\moveright\cornerthick\nsbot}}
\nointerlineskip
\vbox{\line{\ewbot\hfill\ewbot}}
}}
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi}
%
% Do @cropmarks to get crop marks
\def\cropmarks{\let\onepageout=\croppageout }
\newinsert\margin \dimen\margin=\maxdimen
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
% marginal hacks, [email protected] (Juha Takala)
\ifvoid\margin\else % marginal info is present
\rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
\dimen@=\dp#1 \unvbox#1
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
%
% Here are the rules for the cropmarks. Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
%
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
\def\nstop{\vbox
{\hrule height\cornerthick depth\cornerlong width\cornerthick}}
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
\def\nsbot{\vbox
{\hrule height\cornerlong depth\cornerthick width\cornerthick}}
% Parse an argument, then pass it to #1. The argument is the rest of
% the input line (except we remove a trailing comment). #1 should be a
% macro which expects an ordinary undelimited TeX argument.
%
\def\parsearg#1{%
\let\next = #1%
\begingroup
\obeylines
\futurelet\temp\parseargx
}
% If the next token is an obeyed space (from an @example environment or
% the like), remove it and recurse. Otherwise, we're done.
\def\parseargx{%
% \obeyedspace is defined far below, after the definition of \sepspaces.
\ifx\obeyedspace\temp
\expandafter\parseargdiscardspace
\else
\expandafter\parseargline
\fi
}
% Remove a single space (as the delimiter token to the macro call).
{\obeyspaces %
\gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
{\obeylines %
\gdef\parseargline#1^^M{%
\endgroup % End of the group started in \parsearg.
%
% First remove any @c comment, then any @comment.
% Result of each macro is put in \toks0.
\argremovec #1\c\relax %
\expandafter\argremovecomment \the\toks0 \comment\relax %
%
% Call the caller's macro, saved as \next in \parsearg.
\expandafter\next\expandafter{\the\toks0}%
}%
}
% Since all \c{,omment} does is throw away the argument, we can let TeX
% do that for us. The \relax here is matched by the \relax in the call
% in \parseargline; it could be more or less anything, its purpose is
% just to delimit the argument to the \c.
\def\argremovec#1\c#2\relax{\toks0 = {#1}}
\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
% @end itemize @c foo
% will have two active spaces as part of the argument with the
% `itemize'. Here we remove all active spaces from #1, and assign the
% result to \toks0.
%
% This loses if there are any *other* active characters besides spaces
% in the argument -- _ ^ +, for example -- since they get expanded.
% Fortunately, Texinfo does not define any such commands. (If it ever
% does, the catcode of the characters in questionwill have to be changed
% here.) But this means we cannot call \removeactivespaces as part of
% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
% that \parsearg gets might well have any character at all in it.
%
\def\removeactivespaces#1{%
\begingroup
\ignoreactivespaces
\edef\temp{#1}%
\global\toks0 = \expandafter{\temp}%
\endgroup
}
% Change the active space to expand to nothing.
%
\begingroup
\obeyspaces
\gdef\ignoreactivespaces{\obeyspaces\let =\empty}
\endgroup
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
%% These are used to keep @begin/@end levels from running away
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
\ifENV\errmessage{Still within an environment. Type Return to continue.}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @begin foo is the same as @foo, for now.
\newhelp\EMsimple{Type <Return> to continue.}
\outer\def\begin{\parsearg\beginxxx}
\def\beginxxx #1{%
\expandafter\ifx\csname #1\endcsname\relax
{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
\csname #1\endcsname\fi}
% @end foo executes the definition of \Efoo.
%
\def\end{\parsearg\endxxx}
\def\endxxx #1{%
\removeactivespaces{#1}%
\edef\endthing{\the\toks0}%
%
\expandafter\ifx\csname E\endthing\endcsname\relax
\expandafter\ifx\csname \endthing\endcsname\relax
% There's no \foo, i.e., no ``environment'' foo.
\errhelp = \EMsimple
\errmessage{Undefined command `@end \endthing'}%
\else
\unmatchedenderror\endthing
\fi
\else
% Everything's ok; the right environment has been started.
\csname E\endthing\endcsname
\fi
}
% There is an environment #1, but it hasn't been started. Give an error.
%
\def\unmatchedenderror#1{%
\errhelp = \EMsimple
\errmessage{This `@end #1' doesn't have a matching `@#1'}%
}
% Define the control sequence \E#1 to give an unmatched @end error.
%
\def\defineunmatchedend#1{%
\expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
}
% Single-spacing is done by various environments (specifically, in
% \nonfillstart and \quotations).
\newskip\singlespaceskip \singlespaceskip = 12.5pt
\def\singlespace{%
% Why was this kern here? It messes up equalizing space above and below
% environments. --karl, 6may93
%{\advance \baselineskip by -\singlespaceskip
%\kern \baselineskip}%
\setleading \singlespaceskip
}
%% Simple single-character @ commands
% @@ prints an @
% Kludge this until the fonts are right (grr).
\def\@{{\tt \char '100}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
%% Define @` and @' to be the same as ` and '
%% but suppressing ligatures.
%\def\`{{`}}
%\def\'{{'}}
% Used to generate quoted braces.
\def\mylbrace {{\tt \char '173}}
\def\myrbrace {{\tt \char '175}}
\let\{=\mylbrace
\let\}=\myrbrace
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
% @enddots{} is an end-of-sentence ellipsis.
\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
% @! is an end-of-sentence bang.
\gdef\!{!\spacefactor=3000 }
% @? is an end-of-sentence query.
\gdef\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
% produce a whole line of output instead of starting the paragraph.
\def\w#1{\leavevmode\hbox{#1}}
% @group ... @end group forces ... to be all on one page, by enclosing
% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
% to keep its height that of a normal line. According to the rules for
% \topskip (p.114 of the TeXbook), the glue inserted is
% max (\topskip - \ht (first item), 0). If that height is large,
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
\def\group{\begingroup
\ifnum\catcode13=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
%
% The \vtop we start below produces a box with normal height and large
% depth; thus, TeX puts \baselineskip glue before it, and (when the
% next line of text is done) \lineskip glue after it. (See p.82 of
% the TeXbook.) Thus, space below is not quite equal to space
% above. But it's pretty close.
\def\Egroup{%
\egroup % End the \vtop.
\endgroup % End the \group.
}%
%
\vtop\bgroup
% We have to put a strut on the last line in case the @group is in
% the midst of an example, rather than completely enclosing it.
% Otherwise, the interline space between the last line of the group
% and the first line afterwards is too small. But we can't put the
% strut in \Egroup, since there it would be on a line by itself.
% Hence this just inserts a strut at the beginning of each line.
\everypar = {\strut}%
%
% Since we have a strut on every line, we don't need any of TeX's
% normal interline spacing.
\offinterlineskip
%
% OK, but now we have to do something about blank
% lines in the input in @example-like environments, which normally
% just turn into \lisppar, which will insert no space now that we've
% turned off the interline space. Simplest is to make them be an
% empty paragraph.
\ifx\par\lisppar
\edef\par{\leavevmode \par}%
%
% Reset ^^M's definition to new definition of \par.
\obeylines
\fi
%
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
%
\newhelp\groupinvalidhelp{%
group can only be used in environments such as @example,^^J%
where each line of input produces a line of output.}
% @need space-in-mils
% forces a page break if there is not space-in-mils remaining.
\newdimen\mil \mil=0.001in
\def\need{\parsearg\needx}
% Old definition--didn't work.
%\def\needx #1{\par %
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
%\prevdepth=-1000pt
%}}
\def\needx#1{%
% Go into vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
% Don't add any leading before our big empty box, but allow a page
% break, since the best break might be right here.
\allowbreak
\nointerlineskip
\vtop to #1\mil{\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
}
% @br forces paragraph break
\let\br = \par
% @dots{} output some dots
\def\dots{$\ldots$}
% @page forces the start of a new page
\def\page{\par\vfill\supereject}
% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin
% This records the amount of indent in the innermost environment.
% That's how much \exdent should take out.
\newskip\exdentamount
% This defn is used inside fill environments such as @defun.
\def\exdent{\parsearg\exdentyyy}
\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
% This defn is used inside nofill environments such as @example.
\def\nofillexdent{\parsearg\nofillexdentyyy}
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}
% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
\def\inmargin#1{%
\strut\vadjust{\nobreak\kern-\strutdepth
\vtop to \strutdepth{\baselineskip\strutdepth\vss
\llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
%\hbox{{\rm#1}}\hfil\break}}
% @include file insert text of that file as input.
% Allow normal characters that we make active in the argument (a file name).
\def\include{\begingroup
\catcode`\\=12
\catcode`~=12
\catcode`^=12
\catcode`_=12
\catcode`|=12
\catcode`<=12
\catcode`>=12
\catcode`+=12
\parsearg\includezzz}
% Restore active chars for included file.
\def\includezzz#1{\endgroup\begingroup
% Read the included file in a group so nested @include's work.
\def\thisfile{#1}%
\input\thisfile
\endgroup}
\def\thisfile{}
% @center line outputs that line, centered
\def\center{\parsearg\centerzzz}
\def\centerzzz #1{{\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\centerline{#1}}}
% @sp n outputs n lines of vertical space
\def\sp{\parsearg\spxxx}
\def\spxxx #1{\par \vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
\parsearg \commentxxx}
\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
\let\c=\comment
% Prevent errors for section commands.
% Used in @ignore and in failing conditionals.
\def\ignoresections{%
\let\chapter=\relax
\let\unnumbered=\relax
\let\top=\relax
\let\unnumberedsec=\relax
\let\unnumberedsection=\relax
\let\unnumberedsubsec=\relax
\let\unnumberedsubsection=\relax
\let\unnumberedsubsubsec=\relax
\let\unnumberedsubsubsection=\relax
\let\section=\relax
\let\subsec=\relax
\let\subsubsec=\relax
\let\subsection=\relax
\let\subsubsection=\relax
\let\appendix=\relax
\let\appendixsec=\relax
\let\appendixsection=\relax
\let\appendixsubsec=\relax
\let\appendixsubsection=\relax
\let\appendixsubsubsec=\relax
\let\appendixsubsubsection=\relax
\let\contents=\relax
\let\smallbook=\relax
\let\titlepage=\relax
}
% Used in nested conditionals, where we have to parse the Texinfo source
% and so want to turn off most commands, in case they are used
% incorrectly.
%
\def\ignoremorecommands{%
\let\defcv = \relax
\let\deffn = \relax
\let\deffnx = \relax
\let\defindex = \relax
\let\defivar = \relax
\let\defmac = \relax
\let\defmethod = \relax
\let\defop = \relax
\let\defopt = \relax
\let\defspec = \relax
\let\deftp = \relax
\let\deftypefn = \relax
\let\deftypefun = \relax
\let\deftypevar = \relax
\let\deftypevr = \relax
\let\defun = \relax
\let\defvar = \relax
\let\defvr = \relax
\let\ref = \relax
\let\xref = \relax
\let\printindex = \relax
\let\pxref = \relax
\let\settitle = \relax
\let\setchapternewpage = \relax
\let\setchapterstyle = \relax
\let\everyheading = \relax
\let\evenheading = \relax
\let\oddheading = \relax
\let\everyfooting = \relax
\let\evenfooting = \relax
\let\oddfooting = \relax
\let\headings = \relax
\let\include = \relax
\let\lowersections = \relax
\let\down = \relax
\let\raisesections = \relax
\let\up = \relax
\let\set = \relax
\let\clear = \relax
\let\item = \relax
\let\message = \relax
}
% Ignore @ignore ... @end ignore.
%
\def\ignore{\doignore{ignore}}
% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
%
\def\ifinfo{\doignore{ifinfo}}
\def\ifhtml{\doignore{ifhtml}}
\def\html{\doignore{html}}
\def\menu{\doignore{menu}}
\def\direntry{\doignore{direntry}}
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\def\dircategory{\comment}
% Ignore text until a line `@end #1'.
%
\def\doignore#1{\begingroup
% Don't complain about control sequences we have declared \outer.
\ignoresections
%
% Define a command to swallow text until we reach `@end #1'.
\long\def\doignoretext##1\end #1{\enddoignore}%
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10
%
% And now expand that command.
\doignoretext
}
% What we do to finish off ignored text.
%
\def\enddoignore{\endgroup\ignorespaces}%
\newif\ifwarnedobs\warnedobsfalse
\def\obstexwarn{%
\ifwarnedobs\relax\else
% We need to warn folks that they may have trouble with TeX 3.0.
% This uses \immediate\write16 rather than \message to get newlines.
\immediate\write16{}
\immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
\immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
\immediate\write16{If you are running another version of TeX, relax.}
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
\immediate\write16{ Then upgrade your TeX installation if you can.}
\immediate\write16{If you are stuck with version 3.0, run the}
\immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
\immediate\write16{ to use a workaround.}
\immediate\write16{}
\global\warnedobstrue
\fi
}
% **In TeX 3.0, setting text in \nullfont hangs tex. For a
% workaround (which requires the file ``dummy.tfm'' to be installed),
% uncomment the following line:
%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
% Ignore text, except that we keep track of conditional commands for
% purposes of nesting, up to an `@end #1' command.
%
\def\nestedignore#1{%
\obstexwarn
% We must actually expand the ignored text to look for the @end
% command, so that nested ignore constructs work. Thus, we put the
% text into a \vbox and then do nothing with the result. To minimize
% the change of memory overflow, we follow the approach outlined on
% page 401 of the TeXbook: make the current font be a dummy font.
%
\setbox0 = \vbox\bgroup
% Don't complain about control sequences we have declared \outer.
\ignoresections
%
% Define `@end #1' to end the box, which will in turn undefine the
% @end command again.
\expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
%
% We are going to be parsing Texinfo commands. Most cause no
% trouble when they are used incorrectly, but some commands do
% complicated argument parsing or otherwise get confused, so we
% undefine them.
%
% We can't do anything about stray @-signs, unfortunately;
% they'll produce `undefined control sequence' errors.
\ignoremorecommands
%
% Set the current font to be \nullfont, a TeX primitive, and define
% all the font commands to also use \nullfont. We don't use
% dummy.tfm, as suggested in the TeXbook, because not all sites
% might have that installed. Therefore, math mode will still
% produce output, but that should be an extremely small amount of
% stuff compared to the main input.
%
\nullfont
\let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
\let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
\let\tensf = \nullfont
% Similarly for index fonts (mostly for their use in
% smallexample)
\let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
\let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
\let\indsf = \nullfont
%
% Don't complain when characters are missing from the fonts.
\tracinglostchars = 0
%
% Don't bother to do space factor calculations.
\frenchspacing
%
% Don't report underfull hboxes.
\hbadness = 10000
%
% Do minimal line-breaking.
\pretolerance = 10000
%
% Do not execute instructions in @tex
\def\tex{\doignore{tex}}
}
% @set VAR sets the variable VAR to an empty value.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
%
% Since we want to separate VAR from REST-OF-LINE (which might be
% empty), we can't just use \parsearg; we have to insert a space of our
% own to delimit the rest of the line, and then take it out again if we
% didn't need it.
%
\def\set{\parsearg\setxxx}
\def\setxxx#1{\setyyy#1 \endsetyyy}
\def\setyyy#1 #2\endsetyyy{%
\def\temp{#2}%
\ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
\else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
\fi
}
% Can't use \xdef to pre-expand #2 and save some time, since \temp or
% \next or other control sequences that we've defined might get us into
% an infinite loop. Consider `@set foo @cite{bar}'.
\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
% @clear VAR clears (i.e., unsets) the variable VAR.
%
\def\clear{\parsearg\clearxxx}
\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
% @value{foo} gets the text saved in variable foo.
%
\def\value#1{\expandafter
\ifx\csname SET#1\endcsname\relax
{\{No value for ``#1''\}}
\else \csname SET#1\endcsname \fi}
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
\def\ifset{\parsearg\ifsetxxx}
\def\ifsetxxx #1{%
\expandafter\ifx\csname SET#1\endcsname\relax
\expandafter\ifsetfail
\else
\expandafter\ifsetsucceed
\fi
}
\def\ifsetsucceed{\conditionalsucceed{ifset}}
\def\ifsetfail{\nestedignore{ifset}}
\defineunmatchedend{ifset}
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
\def\ifclear{\parsearg\ifclearxxx}
\def\ifclearxxx #1{%
\expandafter\ifx\csname SET#1\endcsname\relax
\expandafter\ifclearsucceed
\else
\expandafter\ifclearfail
\fi
}
\def\ifclearsucceed{\conditionalsucceed{ifclear}}
\def\ifclearfail{\nestedignore{ifclear}}
\defineunmatchedend{ifclear}
% @iftex always succeeds; we read the text following, through @end
% iftex). But `@end iftex' should be valid only after an @iftex.
%
\def\iftex{\conditionalsucceed{iftex}}
\defineunmatchedend{iftex}
% We can't just want to start a group at @iftex (for example) and end it
% at @end iftex, since then @set commands inside the conditional have no
% effect (they'd get reverted at the end of the group). So we must
% define \Eiftex to redefine itself to be its previous value. (We can't
% just define it to fail again with an ``unmatched end'' error, since
% the @ifset might be nested.)
%
\def\conditionalsucceed#1{%
\edef\temp{%
% Remember the current value of \E#1.
\let\nece{prevE#1} = \nece{E#1}%
%
% At the `@end #1', redefine \E#1 to be its previous value.
\def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
}%
\temp
}
% We need to expand lots of \csname's, but we don't want to expand the
% control sequences after we've constructed them.
%
\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
% @math means output in math mode.
% We don't use $'s directly in the definition of \math because control
% sequences like \math are expanded when the toc file is written. Then,
% we read the toc file back, the $'s will be normal characters (as they
% should be, according to the definition of Texinfo). So we must use a
% control sequence to switch into and out of math mode.
%
% This isn't quite enough for @math to work properly in indices, but it
% seems unlikely it will ever be needed there.
%
\let\implicitmath = $
\def\math#1{\implicitmath #1\implicitmath}
% @bullet and @minus need the same treatment as @math, just above.
\def\bullet{\implicitmath\ptexbullet\implicitmath}
\def\minus{\implicitmath-\implicitmath}
\def\node{\ENVcheck\parsearg\nodezzz}
\def\nodezzz#1{\nodexxx [#1,]}
\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
\let\nwnode=\node
\let\lastnode=\relax
\def\donoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\setref{\lastnode}\fi
\global\let\lastnode=\relax}
\def\unnumbnoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
\global\let\lastnode=\relax}
\def\appendixnoderef{\ifx\lastnode\relax\else
\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
\global\let\lastnode=\relax}
\let\refill=\relax
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
\readauxfile
\opencontents
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
\comment % Ignore the actual filename.
}
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
\message{fonts,}
% Font-change commands.
% Texinfo supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
\let\li = \sf % Sometimes we call it \li, not \sf.
% We don't need math for this one.
\def\ttsl{\tenttsl}
%% Try out Computer Modern fonts at \magstephalf
\let\mainmagstep=\magstephalf
% Set the font macro #1 to the font named #2, adding on the
% specified font prefix (normally `cm').
% #3 is the font's design size, #4 is a scale factor
\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
% before you read in texinfo.tex.
\ifx\fontprefix\undefined
\def\fontprefix{cm}
\fi
% Support font families that don't use the same naming scheme as CM.
\def\rmshape{r}
\def\rmbshape{bx} %where the normal face is bold
\def\bfshape{b}
\def\bxshape{bx}
\def\ttshape{tt}
\def\ttbshape{tt}
\def\ttslshape{sltt}
\def\itshape{ti}
\def\itbshape{bxti}
\def\slshape{sl}
\def\slbshape{bxsl}
\def\sfshape{ss}
\def\sfbshape{ss}
\def\scshape{csc}
\def\scbshape{csc}
\ifx\bigger\relax
\let\mainmagstep=\magstep1
\setfont\textrm\rmshape{12}{1000}
\setfont\texttt\ttshape{12}{1000}
\else
\setfont\textrm\rmshape{10}{\mainmagstep}
\setfont\texttt\ttshape{10}{\mainmagstep}
\fi
% Instead of cmb10, you many want to use cmbx10.
% cmbx10 is a prettier font on its own, but cmb10
% looks better when embedded in a line with cmr10.
\setfont\textbf\bfshape{10}{\mainmagstep}