1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Support Macros Boxes}
15
16\unprotect
17
18\permanent\integerdef\negatelistsigncode\numexpr
19 \negatexlistsigncode
20 \negateylistsigncode
21\relax
22
23
24
25\newdimension\strutht
26\newdimension\strutdp
27\newdimension\struthtdp
28
29\newdimension\givenwidth
30\newdimension\givenheight
31\newdimension\givendepth
32
33\newdimension\lastnaturalboxwd
34\newdimension\lastnaturalboxht
35\newdimension\lastnaturalboxdp
36
37\pushoverloadmode
38 \newuserunit\strutht sh
39 \newuserunit\strutdp sd
40 \newuserunit\struthtdp st
41\popoverloadmode
42
43\registerctxluafile{suppbox}{autosuffix}
44
45
46
47
48
49
50
51
52
53
54
55
56
57\iffalse
58 \def\strutdp {\dp\strutbox}
59 \def\strutht {\ht\strutbox}
60 \def\struthtdp{\htdp\strutbox}
61\fi
62
63\permanent\protected\def\strutwd {\wd\strutbox}
64\permanent\protected\def\strutgap{\dimexpr\strutht\strutdp\relax}
65
66
67
68
69
70
71
72\ifdefined\voidbox \else \newbox\voidbox \fi
73\ifdefined\nextbox \else \newbox\nextbox \fi
74
75
76
77
78
79
80
81
82\newdimension\nextdepth
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\newinteger\c_boxes_register
117
118\permanent\protected\def\smashbox
119 {\afterassignment\syst_boxes_smash_boxes_register\c_boxes_register}
120
121\def\syst_boxes_smash_boxes_register
122 {\wd\c_boxes_register\zeropoint
123 \ht\c_boxes_register\zeropoint
124 \dp\c_boxes_register\zeropoint}
125
126\permanent\protected\def\hsmashbox
127 {\afterassignment\syst_boxes_hsmashed_boxes_register\c_boxes_register}
128
129\def\syst_boxes_hsmashed_boxes_register
130 {\wd\c_boxes_register\zeropoint}
131
132\permanent\protected\def\vsmashbox
133 {\afterassignment\syst_boxes_vsmashed_boxes_register\c_boxes_register}
134
135\def\syst_boxes_vsmashed_boxes_register
136 {\ht\c_boxes_register\zeropoint
137 \dp\c_boxes_register\zeropoint}
138
139\permanent\protected\def\smashedbox
140 {\afterassignment\syst_boxes_smashed_boxes_register\c_boxes_register}
141
142\protected\def\syst_boxes_smashed_boxes_register
143 {\wd\c_boxes_register\zeropoint
144 \ht\c_boxes_register\zeropoint
145 \dp\c_boxes_register\zeropoint
146 \box\c_boxes_register}
147
148\aliased\let\smashboxed\smashedbox
149
150
151
152
153
154
155
156
157
158\permanent\protected\def\hsmash {\bgroup\dowithnextboxcs\syst_boxes_hsmashed_nextbox\hbox}
159\permanent\protected\def\vsmash {\bgroup\dowithnextboxcs\syst_boxes_vsmashed_nextbox\vbox}
160\permanent\protected\def\hsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \hbox}
161\permanent\protected\def\vsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \vbox}
162
163\protected\def\syst_boxes_hsmashed_nextbox
164 {\wd\nextbox\zeropoint
165 \box\nextbox
166 \egroup}
167
168\protected\def\syst_boxes_vsmashed_nextbox
169 {\ht\nextbox\zeropoint
170 \dp\nextbox\zeropoint
171 \box\nextbox
172 \egroup}
173
174\protected\def\syst_boxes_smashed_nextbox
175 {\ht\nextbox\zeropoint
176 \dp\nextbox\zeropoint
177 \wd\nextbox\zeropoint
178 \box\nextbox
179 \egroup}
180
181
182
183
184
185
186
187
188
189
190
191\permanent\protected\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
192\permanent\protected\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
193
194
195
196
197
198
199
200
201
202
203
204
205\protected\def\syst_boxes_math_set_nextbox#1
206 {\setbox\nextbox\hbox\expandafter\bgroup
207 \expandafter\Ustartmathmode\the\mathstyle
208 \mathsurround\zeropoint{#1}
209 \Ustopmathmode
210 \egroup}
211
212
213
214
215
216
217
218
219\permanent\protected\def\smash
220 {\begingroup
221 \futureexpandis[\syst_boxes_smash_yes\syst_boxes_smash_nop}
222
223\def\syst_boxes_smash_nop
224 {\edef\m_boxes_smash_options{hd}
225 \futurelet\nexttoken\syst_boxes_smash_indeed}
226
227\def\syst_boxes_smash_yes[#1]
228 {\edef\m_boxes_smash_options{#1}
229 \futurelet\nexttoken\syst_boxes_smash_indeed}
230
231\def\syst_boxes_smash_indeed
232 {\ifmmode
233 \expandafter\syst_boxes_smash_math
234 \orelse\ifx\nexttoken\bgroup
235 \expandafter\syst_boxes_smash_hbox
236 \else
237 \expandafter\syst_boxes_smash_text
238 \fi}
239
240\def\syst_boxes_smash_math#1
241 {\syst_boxes_math_set_nextbox{#1}
242 \syst_boxes_smash_process}
243
244\def\syst_boxes_smash_hbox
245 {\dowithnextboxcs\syst_boxes_smash_process\hbox}
246
247\def\syst_boxes_smash_text#1
248 {\setbox\nextbox\hbox{#1}
249 \syst_boxes_smash_process}
250
251\def\syst_boxes_smash_process
252 {\expandafter\syst_boxes_smash_process_option\m_boxes_smash_options\relax
253 \box\nextbox
254 \endgroup}
255
256\installcorenamespace {smashoptions}
257
258\defcsname\??smashoptions w\endcsname{\wd\nextbox\zeropoint}
259\defcsname\??smashoptions h\endcsname{\ht\nextbox\zeropoint}
260\defcsname\??smashoptions d\endcsname{\dp\nextbox\zeropoint}
261\defcsname\??smashoptions t\endcsname{\ht\nextbox\zeropoint}
262\defcsname\??smashoptions b\endcsname{\dp\nextbox\zeropoint}
263\defcsname\??smashoptions hd\endcsname{\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
264\defcsname\??smashoptions whd\endcsname{\wd\nextbox\zeropoint\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
265
266\def\syst_boxes_smash_process_option#1
267 {\ifx#1\relax\else
268 \begincsname\??smashoptions#1\endcsname
269 \expandafter\syst_boxes_smash_process_option
270 \fi}
271
272\def\syst_boxes_lower_nextbox_dp
273 {\setbox\nextbox\hpack{\lower\dp\nextbox\box\nextbox}}
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293\permanent\protected\def\phantom {\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed }
294\permanent\protected\def\vphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_v}
295\permanent\protected\def\hphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_h}
296
297\def\syst_boxes_phantom_math #1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make }
298\def\syst_boxes_phantom_math_v#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_v}
299\def\syst_boxes_phantom_math_h#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_h}
300
301\def\syst_boxes_phantom_hbox {\dowithnextboxcs\syst_boxes_phantom_make \hbox}
302\def\syst_boxes_phantom_hbox_v{\dowithnextboxcs\syst_boxes_phantom_make_v\hbox}
303\def\syst_boxes_phantom_hbox_h{\dowithnextboxcs\syst_boxes_phantom_make_h\hbox}
304
305\def\syst_boxes_phantom_text #1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make }
306\def\syst_boxes_phantom_text_v#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_v}
307\def\syst_boxes_phantom_text_h#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_h}
308
309\def\syst_boxes_phantom_indeed
310 {\ifmmode
311 \expandafter\syst_boxes_phantom_math
312 \orelse\ifx\nexttoken\bgroup
313 \expandafter\syst_boxes_phantom_hbox
314 \else
315 \expandafter\syst_boxes_phantom_text
316 \fi}
317
318\def\syst_boxes_phantom_indeed_v
319 {\ifmmode
320 \expandafter\syst_boxes_phantom_math_v
321 \orelse\ifx\nexttoken\bgroup
322 \expandafter\syst_boxes_phantom_hbox_v
323 \else
324 \expandafter\syst_boxes_phantom_text_v
325 \fi}
326
327\def\syst_boxes_phantom_indeed_h
328 {\ifmmode
329 \expandafter\syst_boxes_phantom_math_h
330 \orelse\ifx\nexttoken\bgroup
331 \expandafter\syst_boxes_phantom_hbox_h
332 \else
333 \expandafter\syst_boxes_phantom_text_h
334 \fi}
335
336\def\syst_boxes_phantom_make
337 {\setbox\scratchbox\emptyhbox
338 \ht\scratchbox\ht\nextbox
339 \dp\scratchbox\dp\nextbox
340 \wd\scratchbox\wd\nextbox
341 \box\scratchbox
342 \endgroup}
343
344\def\syst_boxes_phantom_make_v
345 {\setbox\scratchbox\emptyhbox
346 \ht\scratchbox\ht\nextbox
347 \dp\scratchbox\dp\nextbox
348 \box\scratchbox
349 \endgroup}
350
351\def\syst_boxes_phantom_make_h
352 {\setbox\scratchbox\emptyhbox
353 \wd\scratchbox\wd\nextbox
354 \box\scratchbox
355 \endgroup}
356
357
358
359\permanent\protected\def\mathstrut{\mathstack{\vphantom(}}
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\permanent\protected\def\getboxheight#1\of#2\box#3
394 {\def\next{#1\htdp\c_boxes_register}
395 \afterassignment\next\c_boxes_register=#3}
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414\ifdefined\roundingeps \else \newdimension\roundingeps \roundingeps=10sp \fi
415
416\newinteger \noflines
417\newdimension\noflinesheight
418
419\permanent\protected\def\getnoflines#1
420 {\noflinesheight{#1}
421 \ifzeropt\noflinesheight
422 \noflines\zerocount
423 \orelse\ifdim\noflinesheight>\zeropoint
424 \advanceby\noflinesheight\roundingeps
425 \divideby\noflinesheight\openlineheight
426 \noflines\noflinesheight
427 \advanceby\noflines\plusone
428 \else
429 \advanceby\noflinesheight\roundingeps
430 \divideby\noflinesheight\openlineheight
431 \noflines\noflinesheight
432 \advanceby\noflines\minusone
433 \fi}
434
435\permanent\protected\def\getroundednoflines#1
436 {\noflinesheight{#1}
437 \ifzeropt\noflinesheight
438 \noflines\zerocount
439 \orelse\ifdim\noflinesheight>\zeropoint
440 \advanceby\noflinesheight\roundingeps
441 \divideby\noflinesheight\openlineheight
442 \noflines\noflinesheight
443 \else
444 \advanceby\noflinesheight\roundingeps
445 \divideby\noflinesheight\openlineheight
446 \noflines\noflinesheight
447 \fi}
448
449\permanent\protected\def\getrawnoflines#1
450 {\noflinesheight{#1}
451 \ifzeropt\noflinesheight
452 \noflines\zerocount
453 \orelse\ifdim\noflinesheight>\zeropoint
454 \advanceby\noflinesheight\roundingeps
455 \advanceby\noflinesheight.5\openlineheight
456 \divideby\noflinesheight\openlineheight
457 \noflines\noflinesheight
458 \else
459 \advanceby\noflinesheight\roundingeps
460 \advanceby\noflinesheight.5\openlineheight
461 \divideby\noflinesheight\openlineheight
462 \noflines\noflinesheight
463 \fi}
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\def\syst_boxes_determine_noflines
511 {\expandafter\egroup\expandafter\noflines\noflinesinbox\nextbox\relax}
512
513\permanent\protected\def\determinenoflines
514 {\bgroup
515 \forgetall
516 \enforced\let\crlf\endgraf
517 \enforced\let\\\endgraf
518 \dowithnextboxcs\syst_boxes_determine_noflines\vbox}
519
520\def\determinednoflines#1
521 {\localcontrolled{\determinenoflines{#1}}\noflines}
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544\permanent\protected\def\doifelsetext#1
545 {\begingroup
546 \setbox\scratchbox\hbox
547 {\settrialtypesetting
548 \ignorespaces#1\removeunwantedspaces}
549 \ifzeropt\wd\scratchbox
550 \endgroup\expandafter\secondoftwoarguments
551 \else
552 \endgroup\expandafter\firstoftwoarguments
553 \fi}
554
555\permanent\protected\def\doiftext#1
556 {\begingroup
557 \setbox\scratchbox\hbox
558 {\settrialtypesetting
559 \ignorespaces#1\removeunwantedspaces}
560 \ifzeropt\wd\scratchbox
561 \endgroup\expandafter\gobbleoneargument
562 \else
563 \endgroup\expandafter\firstofoneargument
564 \fi}
565
566\permanent\protected\def\validtext#1
567 {\ifparameter#1\or
568 \begingroup
569 \setbox\scratchbox\hbox
570 {\settrialtypesetting
571 \ignorespaces#1\removeunwantedspaces}
572 \normalexpanded{\endgroup\noexpand\expandafter\ifzeropt\wd\scratchbox\if_false\else\if_true\fi}
573 \else
574 \expandafter\if_false
575 \fi}
576
577
578
579
580
581
582
583
584\aliased\let\doiftextelse\doifelsetext
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\let\syst_boxes_with_next_box\relax
620
621\permanent\protected\def\dowithnextbox#1
622 {\def\syst_boxes_with_next_box{#1}
623 \afterassignment\syst_boxes_with_next_box_indeed
624 \setbox\nextbox}
625
626\def\syst_boxes_with_next_box_indeed
627 {\aftergroup\syst_boxes_with_next_box}
628
629\permanent\protected\def\dowithnextboxcs#1
630 {\let\syst_boxes_with_next_box#1
631 \afterassignment\syst_boxes_with_next_box_indeed
632 \setbox\nextbox}
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\permanent\def\nextboxht {\ht\nextbox}
675\permanent\def\nextboxwd {\wd\nextbox}
676\permanent\def\nextboxdp {\dp\nextbox}
677\permanent\def\nextboxhtdp{\htdp\nextbox}
678
679\permanent\protected\def\flushnextbox{\box\nextbox}
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\permanent\protected\def\dowithnextboxcontent#1#2
709 {\afterassigned{#1\aftergrouped{#2}}
710 \setbox\nextbox}
711
712\permanent\protected\def\dowithnextboxcontentcs#1#2
713 {\afterassigned{#1\aftergroup#2}
714 \setbox\nextbox}
715
716
717
718
719
720
721
722\def\syst_boxes_do_rlap{\hpack to \zeropoint{\box\nextbox\hss}\endgroup}
723\def\syst_boxes_do_llap{\hpack to \zeropoint{\hss\box\nextbox}\endgroup}
724\def\syst_boxes_do_clap{\hpack to \zeropoint{\hss\box\nextbox\hss}\endgroup}
725\def\syst_boxes_do_tlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
726\def\syst_boxes_do_blap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
727
728\protected\def\syst_boxes_rlap{\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox}
729\protected\def\syst_boxes_llap{\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox}
730\protected\def\syst_boxes_clap{\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox}
731
732
733
734
735
736
737
738
739
740\def\syst_boxes_math_xlap#1#2
741 {\normalexpanded{#1\bgroup\normalstartimath\givenmathstyle\the\mathstyle}
742
743 \mathsurround\zeropoint#2
744 \normalstopimath\egroup}
745
746\def\syst_boxes_math_clap{\syst_boxes_math_xlap\syst_boxes_clap}
747\def\syst_boxes_math_llap{\syst_boxes_math_xlap\syst_boxes_llap}
748\def\syst_boxes_math_rlap{\syst_boxes_math_xlap\syst_boxes_rlap}
749
750\permanent\protected\def\rlap{\mathortext\syst_boxes_math_rlap\syst_boxes_rlap}
751\permanent\protected\def\llap{\mathortext\syst_boxes_math_llap\syst_boxes_llap}
752\permanent\protected\def\clap{\mathortext\syst_boxes_math_clap\syst_boxes_clap}
753
754\permanent\protected\def\tlap{\begingroup\dowithnextboxcs\syst_boxes_do_tlap\vbox}
755\permanent\protected\def\blap{\begingroup\dowithnextboxcs\syst_boxes_do_blap\vbox}
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\newif \ifsomeshapeleft
877\newif \ifreshapingbox
878\newif \ifreshapingfailed
879
880\newbox \shapebox
881\newinteger \shapepenalty
882\newdimension\shapekern
883\newgluespec \shapeskip
884\newbox \newshapebox
885\newbox \oldshapebox
886\newbox \tmpshapebox
887\newinteger \shapecounter
888\newevery \everyshapebox \relax
889
890\permanent\dimensiondef\shapesignal.12345678pt
891
892\permanent\protected\def\reshapebox#1
893 {\doreshapebox
894 {#1}
895 {\penalty\shapepenalty}
896 {\kern \shapekern }
897 {\vskip \shapeskip }}
898
899\permanent\protected\def\doreshapebox#1#2#3#4
900 {\global\reshapingfailedfalse
901 \ifzeropt\ht\oldshapebox
902 \setbox\newshapebox\emptyvbox
903 \else
904 \setbox\newshapebox\vbox
905 {\unvcopy\oldshapebox
906 \setbox\newshapebox\emptybox
907 \shapecounter\zerocount
908 \doloop{\dodoreshapebox{#1}{#2}{#3}{#4}}}
909 \setbox\newshapebox\box\tmpshapebox
910 \fi}
911
912
913
914\permanent\protected\def\insertshapesignal
915 {\hpack to \shapesignal{\strut\hss}
916 \prevdepth\strutdp}
917
918\permanent\protected\def\restoreshapebox
919 {\global\setbox\tmpshapebox\vbox{\vskip\lineheight\unvcopy\oldshapebox}}
920
921\permanent\def\dodoreshapebox#1#2#3#4
922 {\ifnum\lastnodetype=\gluenodecode
923 \shapeskip\lastskip
924 \global\setbox\tmpshapebox\vbox{#4\unvbox\tmpshapebox}
925 \unskip
926 \orelse\ifnum\lastnodetype=\kernnodecode
927 \shapekern\lastkern
928 \global\setbox\tmpshapebox\vbox{#3\unvbox\tmpshapebox}
929 \unkern
930 \orelse\ifnum\lastnodetype=\penaltynodecode
931 \shapepenalty\lastpenalty
932 \global\setbox\tmpshapebox\vbox{#2\unvbox\tmpshapebox}
933 \unpenalty
934 \orelse\ifnum\lastnodetype<\zeropoint
935 \exitloop
936 \else
937 \setbox\shapebox\lastbox
938 \ifvoid\shapebox
939 \orelse\ifdim\wd\shapebox=\shapesignal\relax
940 \exitloop
941 \else
942 \shapecounter\zerocount
943 \global\setbox\tmpshapebox\vbox{#1\unvbox\tmpshapebox}
944 \fi
945 \fi
946 \ifnum\shapecounter>100
947 \global\reshapingfailedtrue
948 \message{!!forced exit from shapebox \the\lastnodetype !!}
949 \restoreshapebox
950 \exitloop
951 \else
952 \advanceby\shapecounter \plusone
953 \fi}
954
955\permanent\protected\def\beginofshapebox
956 {\setbox\oldshapebox\vbox
957 \bgroup
958 \reshapingboxtrue
959 \expand\everyshapebox
960 \insertshapesignal}
961
962\permanent\protected\def\endofshapebox
963 {\endgraf
964 \egroup}
965
966\aliased\let\beginshapebox\beginofshapebox
967\aliased\let\endshapebox \endofshapebox
968
969\permanent\protected\def\flushshapebox
970 {\bgroup
971 \ifzeropt\ht\newshapebox
972 \else
973
974
975 \ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi
976
977 \ifdim\prevdepth=\thousandpoint
978 \prevdepth\zeropoint
979 \fi
980 \ifdim\prevdepth<\zeropoint\relax
981
982 \donetrue
983 \orelse\ifinner
984
985 \donefalse
986 \orelse\ifdim\pagegoal=\maxdimen
987 \donetrue
988 \else
989
990 \donetrue
991 {\forgeteverypar\verticalstrut}\nobreak
992 \kern\struttotal
993 \kern\parskip
994
995 \fi
996 \scratchdimen\dp\newshapebox
997 \unvbox\newshapebox
998
999 \kern\scratchdimen
1000
1001 \ifdone
1002 \kern\strutdp
1003 \prevdepth\strutdp
1004 \fi
1005 \fi
1006 \egroup}
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020\permanent\protected\def\innerflushshapebox
1021 {\ifzeropt\ht\newshapebox \else
1022 \unvcopy\newshapebox\relax
1023
1024 \fi}
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043\permanent\protected\def\shapedhbox
1044 {\normalexpanded{\dowithnextbox
1045 {\ht\nextbox\the\ht\shapebox
1046 \dp\nextbox\the\dp\shapebox
1047 \box\nextbox}}
1048 \hbox}
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065\permanent\protected\def\doshowhyphenatednextbox
1066 {\clf_showhyphenatedinlist\nextbox}
1067
1068\permanent\protected\def\showhyphens
1069 {\dowithnextboxcs\doshowhyphenatednextbox\hpack}
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079\def\syst_boxes_hyphenatednextbox {\clf_hyphenatedlist\nextbox false\relax\unhbox\nextbox}
1080\def\syst_boxes_hyphenatednextboxcolor{\clf_hyphenatedlist\nextbox true \relax\unhbox\nextbox}
1081
1082\permanent\protected\def\hyphenatedword {\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox}
1083\permanent\protected\def\hyphenatedpar {\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox}
1084\permanent\protected\def\hyphenatedfile #1{\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox{\readfile{#1}\donothing\donothing}}
1085\permanent\protected\def\hyphenatedcoloredword{\dowithnextboxcs\syst_boxes_hyphenatednextboxcolor\hbox}
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116\mutable\lettonothing\nextprocessedtoken
1117
1118\mutable\let\before \relax
1119
1120\mutable\let\after \relax
1121\mutable\let\white \relax
1122
1123\permanent\protected\def\processtokens#1#2#3#4#5
1124 {\begingroup
1125 \enforced\permanent\def\space{ }
1126 \enforced\let\\\space
1127 \enforced\def\before {#1}
1128 \enforced\def\between{#2}
1129 \enforced\def\after {#3}
1130 \enforced\def\white {#4}
1131 \enforced\let\m_syst_boxes_before\before
1132 \syst_boxes_processtokens#5\s!e_o_t_token
1133 \endgroup}
1134
1135\def\syst_boxes_processtokens
1136 {\afterassignment\syst_boxes_do_processtokens\let\nextprocessedtoken= }
1137
1138\def\syst_boxes_redo_processedtoken
1139 {\dowithnextbox
1140 {\before{\copy\nextbox}
1141 \enforced\let\before\between
1142 \syst_boxes_processtokens}
1143 \hbox\bgroup}
1144
1145\def\syst_boxes_do_processtokens
1146 {\ifx\nextprocessedtoken\s!e_o_t_token
1147 \after
1148 \orelse\ifx\nextprocessedtoken\bgroup
1149 \expandafter\syst_boxes_redo_processedtoken
1150 \else
1151 \expandafter\if\space\nextprocessedtoken
1152 \after\white
1153 \enforced\let\before\m_syst_boxes_before
1154 \else
1155 \before\nextprocessedtoken
1156 \enforced\let\before\between
1157 \fi
1158 \expandafter\syst_boxes_processtokens
1159 \fi}
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179\def\syst_boxes_boundtext#1
1180 {\setbox\scratchboxone\hbox{#1}
1181 \advanceby\scratchdimen \wd\scratchboxone
1182 \ifdim\scratchdimen>\zeropoint\relax#1\fi}
1183
1184\permanent\protected\def\doboundtext#1#2#3
1185 {\hbox
1186 {\setbox\scratchbox\hbox{#1}
1187 \scratchdimen{#2}
1188 \ifdim\wd\scratchbox>\scratchdimen
1189 \setbox\scratchbox\hbox{#3}
1190 \advanceby\scratchdimen \wd\scratchbox
1191 \handletokens#1\with\syst_boxes_boundtext
1192 \fi
1193 \box\scratchbox}}
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210\ifdefined\fakecompoundhyphen\else \let\fakecompoundhyphen\relax \fi
1211\ifdefined\veryraggedright \else \def\veryraggedright{\raggedright} \fi
1212
1213
1214
1215\lettonothing\m_syst_boxes_left
1216\lettonothing\m_syst_boxes_right
1217
1218\permanent\protected\def\limitatetext#1#2#3
1219 {
1220 \splitatcomma{#2}\m_syst_boxes_left\m_syst_boxes_right
1221 \limitated
1222 \ifchkdimension\m_syst_boxes_left\or
1223 left \lastchkdimension
1224 \fi
1225 \ifchkdimension\m_syst_boxes_right\or
1226 right \lastchkdimension
1227 \fi
1228 strip true
1229 sentinel {#3}
1230 text {#1}
1231 \relax}
1232
1233
1234
1235
1236
1237
1238
1239\permanent\protected\def\limitatefirstline#1#2#3
1240 {\hbox\bgroup\strut
1241 \setbox\scratchbox\hbox{\begstrut#1\endstrut}
1242 \ifdim\wd\scratchbox>{#2}
1243 \setbox\scratchbox\hbox{#3}
1244 \hsize{#2}
1245 \advanceby\hsize\wd\scratchbox
1246 \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}
1247 \setbox\scratchbox\vsplit\scratchbox to \lineheight
1248 \vbox
1249 {\unvbox\scratchbox
1250 \global\setbox\plusone\lastbox
1251 \global\setbox\plusone\hbox{\strut\unhbox\plusone}
1252 \hbox
1253 {\unless\ifdefined\clip
1254 \box\plusone
1255 \orelse\ifdim\wd\plusone>\hsize
1256 \lower\strutdepth\hpack{\clip[\c!width=\hsize,\c!height=\lineheight]{\hpack{\raise\strutdepth\box\plusone}}}
1257 \else
1258 \box\plusone
1259 \fi
1260 \removeunwantedspaces#3}}
1261 \else
1262 #1
1263 \fi
1264 \egroup}
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282\permanent\protected\def\processisolatedchars#1#2
1283 {\dontleavehmode
1284 \begingroup
1285 \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}
1286 \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}
1287 \clf_applytobox
1288 method {char}
1289 box \scratchbox
1290 command {\csstring#2}
1291 nested true
1292 \relax
1293 \endgroup}
1294
1295\permanent\protected\def\processisolatedwords#1#2
1296 {\dontleavehmode
1297 \begingroup
1298 \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}
1299 \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}
1300 \clf_applytobox
1301 method {word}
1302 box \scratchbox
1303 command {\csstring#2}
1304 nested true
1305 \relax
1306 \endgroup}
1307
1308
1309
1310\permanent\protected\def\applytocharacters#1
1311 {\dontleavehmode
1312 \dowithnextbox{\clf_applytobox
1313 method {char}
1314 box \nextbox
1315 command {\csstring#1}
1316 nested true
1317 \relax}
1318 \hbox}
1319
1320\permanent\protected\def\applytowords#1
1321 {\dontleavehmode
1322 \dowithnextbox{\clf_applytobox
1323 method {word}
1324 box \nextbox
1325 command {\csstring#1}
1326 nested true
1327 \relax}
1328 \hbox}
1329
1330
1331
1332\permanent\protected\def\processwords#1
1333 {\processisolatedwords{#1}\processword}
1334
1335\mutable\let\processword\relax
1336
1337\permanent\protected\def\applytosplitstringchar#1#2
1338 {\dontleavehmode\clf_processsplit
1339 data {#2}
1340 command {\csstring#1}
1341 method {char}
1342 \relax}
1343
1344\permanent\protected\def\applytosplitstringword#1#2
1345 {\dontleavehmode\clf_processsplit
1346 data {#2}
1347 command {\csstring#1}
1348 method {word}
1349 \relax}
1350
1351\permanent\protected\def\applytosplitstringline#1#2
1352 {\dontleavehmode\clf_processsplit
1353 data {#2}
1354 command {\csstring#1}
1355 method {line}
1356 \relax}
1357
1358\permanent\protected\def\applytosplitstringcharspaced#1#2
1359 {\dontleavehmode\clf_processsplit
1360 data {#2}
1361 command {\csstring#1}
1362 method {char}
1363 spaced true
1364 \relax}
1365
1366\permanent\protected\def\applytosplitstringwordspaced#1#2
1367 {\dontleavehmode\clf_processsplit
1368 data {#2}
1369 command {\csstring#1}
1370 method {word}
1371 spaced true
1372 \relax}
1373
1374\permanent\protected\def\applytosplitstringlinespaced#1#2
1375 {\dontleavehmode\clf_processsplit
1376 data {#2}
1377 command {\csstring#1}
1378 method {line}
1379 spaced true
1380 \relax}
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407\permanent\protected\def\sbox
1408 {\vpack\bgroup
1409 \dowithnextboxcs\syst_boxes_sbox_finish\vbox}
1410
1411\def\syst_boxes_sbox_finish
1412 {\boxyoffset\nextbox\strutdp
1413 \dp\nextbox\strutdp
1414 \ht\nextbox\strutht
1415 \box\nextbox
1416 \egroup}
1417
1418
1419
1420
1421
1422
1423
1424\permanent\protected\def\inlinedbox
1425 {\bgroup
1426 \dowithnextboxcs\syst_boxes_inlined_finish\hbox}
1427
1428\def\syst_boxes_inlined_finish
1429 {\boxyoffset\nextbox{((\htdp\nextbox\lineheight)\plustwo\strutdp)}
1430 \ht\nextbox\strutht
1431 \dp\nextbox\strutdp
1432 \box\nextbox
1433 \egroup}
1434
1435
1436
1437
1438
1439
1440\permanent\protected\def\struttedbox
1441 {\hpack\bgroup
1442 \dowithnextboxcs\syst_boxes_struttedbox_finish\hbox}
1443
1444\def\syst_boxes_struttedbox_finish
1445 {\dp\nextbox\strutdepth
1446 \ht\nextbox\strutheight
1447 \box\nextbox
1448 \egroup}
1449
1450
1451
1452
1453
1454
1455
1456\permanent\protected\def\topskippedbox
1457 {\hpack\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
1458
1459\def\syst_boxes_topskippedbox_finish
1460 {\edef\m_boxes_tmp{\ifdim\strutdepth=\dp\nextbox\dp\nextbox\the\dp\nextbox\fi}
1461 \lower\topskip\hpack{\raise\strutheight\box\nextbox}
1462 \m_boxes_tmp
1463 \egroup}
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508\permanent\protected\def\centeredbox#1#
1509 {\bgroup
1510 \dontcomplain
1511 \forgetall
1512 \scangivendimensions#1\relax
1513 \advanceby\vsize\givenheight
1514 \advanceby\hsize\givenwidth
1515 \dowithnextboxcs\syst_boxes_centered_finish
1516 \hbox}
1517
1518\def\syst_boxes_centered_finish
1519 {\boxxoffset\nextbox{(\hsize\wd\nextbox\givenwidth)2}
1520 \boxyoffset\nextbox{(\vsize\ht\nextbox\dp\nextbox\givenheight)2}
1521 \wd\nextbox{\hsize\givenwidth }
1522 \ht\nextbox{\vsize\givenheight}
1523 \dp\nextbox\zeropoint
1524 \box\nextbox
1525 \egroup}
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536\permanent\protected\def\centerednextbox#1#
1537 {\bgroup
1538 \dowithnextbox
1539 {\hsize\wd\nextbox
1540 \vsize\ht\nextbox
1541 \centeredbox#1{\box\nextbox}
1542 \egroup}
1543 \hbox}
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557\permanent\protected\def\centerbox#1#
1558 {\bgroup
1559 \dowithnextbox
1560 {\setlocalhsize
1561 \setbox\scratchbox\hpack{\vrule\s!width \zeropoint#1}
1562 \ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi
1563 \setbox\scratchbox\vpack{\hrule\s!height\zeropoint#1}
1564 \ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi
1565 \vpack to \vsize{\vss\hpack to \hsize{\hss\box\nextbox\hss}\vss}
1566 \egroup}
1567 \hbox}
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583\newif\ifalignrigidcolumns
1584\newif\ifstretchrigidcolumns
1585\newif\iftightrigidcolumns
1586
1587\mutable\let\rigidcolumnlines\!!zerocount
1588
1589\newbox \rigidcolumnbox
1590\newdimension\rigidhsize
1591\newinteger \rigidcolumns
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605\def\setrigidcolumnhsize#1#2#3
1606 {\global\rigidhsize\hsize
1607 \global\rigidcolumns{#3}
1608 \hsize{(#1\numexpr\rigidcolumns1\relax\dimexpr#2\relax)\rigidcolumns}}
1609
1610\permanent\protected\def\rigidcolumnbalance#1
1611 {\ifnum\rigidcolumns=1
1612 \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
1613 \else
1614 \vbox
1615 {\forgetall
1616 \nopenalties
1617 \dontcomplain
1618 \setbox\rigidcolumnbox\vbox
1619 {\line{}\goodbreak\unvbox#1\removebottomthings}
1620 \splittopskip\openstrutheight
1621 \setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
1622 \ifcase\rigidcolumnlines\relax
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633 \scratchdimen\ht\rigidcolumnbox
1634 \divideby\scratchdimen \rigidcolumns
1635 \getnoflines\scratchdimen
1636
1637 \else
1638 \noflines\rigidcolumnlines
1639 \fi
1640 \scratchdimen\noflines\lineheight
1641
1642
1643
1644 \setbox0=\box\rigidcolumnbox
1645 \ifvoid0\else
1646 \doloop
1647 {\setbox\rigidcolumnbox=\copy0
1648 \setbox\scratchbox\hpack to \rigidhsize
1649 {\dorecurse\rigidcolumns
1650 {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
1651 \dp\scratchbox\openstrutdepth
1652 \setbox\scratchbox\vtop
1653 \ifalignrigidcolumns to
1654 \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
1655 \fi
1656 {\unvbox\scratchbox}
1657 \wd\scratchbox\hsize
1658 \box\scratchbox
1659 \hfill}
1660 \hfillneg}
1661 \ifvoid\rigidcolumnbox\exitloop\else\advanceby\scratchdimen\lineheight\fi}
1662 \iftightrigidcolumns
1663 \setbox\scratchbox\hpack{\raise\dp\scratchbox\box\scratchbox}
1664 \else
1665 \advanceby\scratchdimen \openstrutdepth
1666 \setbox\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}
1667 \dp\scratchbox\openstrutdepth
1668 \ht\scratchbox\scratchdimen
1669 \fi
1670 \box\scratchbox
1671 \fi}
1672 \fi}
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697\newdimension\vboxtohboxslack
1698\newdimension\hboxestohboxslack
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735\newbox\d_syst_boxes_separator
1736
1737\permanent\protected\def\startvboxtohboxseparator
1738 {\setbox\d_syst_boxes_separator\hbox attr \vboxtohboxseparatorattribute\plusone\bgroup}
1739
1740\permanent\protected\def\stopvboxtohboxseparator
1741 {\egroup}
1742
1743\permanent\protected\def\startvboxtohbox
1744 {\begingroup
1745 \setbox\scratchbox\hbox\bgroup}
1746
1747\permanent\protected\def\stopvboxtohbox
1748 {\ifvoid\d_syst_boxes_separator
1749 \hskip\zeropoint\ifcase\vboxtohboxslack\else\s!minus\vboxtohboxslack\fi
1750 \else
1751 \box\d_syst_boxes_separator
1752 \fi
1753 \egroup
1754 \clf_hboxtovbox\scratchbox
1755 \box\scratchbox
1756 \endgroup}
1757
1758
1759
1760\permanent\protected\def\convertvboxtohbox
1761 {\makehboxofhboxes
1762 \setbox\scratchboxone\hpack{\unhbox\scratchboxone\removehboxes}
1763 \noindent\unhbox\scratchboxone\par}
1764
1765\permanent\protected\def\makehboxofhboxes
1766 {\setbox\scratchboxone\emptyhbox
1767 \loop
1768 \setbox\scratchboxtwo\lastbox
1769 \ifhbox\scratchboxtwo
1770 \setbox\scratchboxone\hpack{\box\scratchboxtwo\unhbox\scratchboxone}
1771 \repeat}
1772
1773\permanent\protected\def\removehboxes
1774 {\setbox\scratchboxone\lastbox
1775 \ifhbox\scratchboxone
1776 {\removehboxes}\unhbox\scratchboxone
1777 \fi}
1778
1779
1780
1781\permanent\protected\def\starthboxestohbox
1782 {\bgroup
1783 \setbox\scratchbox\vbox\bgroup}
1784
1785\permanent\protected\def\stophboxestohbox
1786 {\egroup
1787 \clf_vboxlisttohbox\scratchbox\nextbox{\hboxestohboxslack}
1788 \dontleavehmode
1789 \unhbox\nextbox
1790 \removeunwantedspaces
1791 \par
1792 \egroup}
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803\newbox \unhhedbox
1804\newbox \hhbox
1805\newdimension\lasthhboxwidth
1806\newgluespec \hhboxindent
1807
1808\permanent\protected\def\unhhbox#1\with#2
1809 {\bgroup
1810 \nopenalties
1811 \dontcomplain
1812 \forgetall
1813 \setbox\unhhedbox\vbox{\hskip\hhboxindent\strut\unhbox#1}
1814 \doloop
1815 {\setbox\hhbox\vsplit\unhhedbox to \lineheight
1816 \ifvoid\unhhedbox
1817 \setbox\hhbox\hbox{\strut\hboxofvbox\hhbox}
1818 \fi
1819 \ht\hhbox\strutht
1820 \dp\hhbox\strutdp
1821 \ifzeropt\hhboxindent\else
1822 \setbox\hhbox\hpack{\kern\hhboxindent\box\hhbox}
1823 \hhboxindent\zeropoint
1824 \fi
1825 \global\lasthhboxwidth\wd\hhbox
1826 #2\relax
1827 \ifvoid\unhhedbox
1828 \exitloop
1829 \else
1830 \hskip\zeropoint \s!plus \zeropoint
1831 \fi}
1832 \egroup}
1833
1834\def\syst_boxes_hboxofvbox
1835 {\setbox0\vpack{\unvbox\scratchcounter\global\setbox1\lastbox}
1836 \unhbox1
1837 \egroup}
1838
1839\permanent\protected\def\hboxofvbox
1840 {\bgroup
1841 \afterassignment\syst_boxes_hboxofvbox
1842 \scratchcounter=}
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882\permanent\protected\def\doifcontent#1#2#3
1883 {\dowithnextbox
1884 {\ifhbox\nextbox
1885 \ifdim\wd\nextbox>\zeropoint
1886 #1\unhbox\nextbox#2\relax
1887 \else
1888 #3\relax
1889 \fi
1890 \else
1891 \ifdim\ht\nextbox>\zeropoint
1892 #1\unvbox\nextbox#2\relax
1893 \else
1894 #3\relax
1895 \fi
1896 \fi}}
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923\newbox\processbox
1924
1925\let\syst_boxes_process_indeed\relax
1926
1927\permanent\protected\def\processboxes#1
1928 {\bgroup
1929 \def\syst_boxes_process_indeed{#1}
1930 \setbox\processbox\emptybox
1931 \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
1932
1933\def\syst_boxes_process_yes
1934 {\dowithnextboxcs\syst_boxes_process_content\hbox}
1935
1936\def\syst_boxes_process_content
1937 {\removeunwantedspaces
1938 \syst_boxes_process_indeed
1939 \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
1940
1941\protected\def\syst_boxes_process_nop
1942 {\removeunwantedspaces
1943 \box\processbox
1944 \egroup}
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965\permanent\def\boxisempty#1
1966 {\ifdim\wd#1=\zeropoint
1967 \ifdim\ht#1=\zeropoint
1968 \ifdim\dp#1=\zeropoint
1969 \zerocount
1970 \else
1971 \plusone
1972 \fi
1973 \else
1974 \plusone
1975 \fi
1976 \else
1977 \plusone
1978 \fi}
1979
1980\def\syst_boxes_overlay_process
1981 {\ifcase\boxisempty\nextbox\else
1982 \syst_boxes_overlay_process_indeed
1983 \fi}
1984
1985\def\syst_boxes_overlay_process_indeed
1986 {
1987 \scratchdepth\dp\ifdim\dp\nextbox>\dp\processbox\nextbox\else\processbox\fi
1988 \ifdim\ht\nextbox>\ht\processbox
1989 \setbox\processbox\vpack to \ht\nextbox {\dp\processbox\zeropoint\vss\box\processbox\vss}
1990 \else
1991 \setbox\nextbox \vpack to \ht\processbox{\dp\nextbox \zeropoint\vss\box\nextbox \vss}
1992 \fi
1993 \dp\nextbox \scratchdepth
1994 \dp\processbox\scratchdepth
1995 \scratchwidth\wd\ifdim\wd\nextbox>\wd\processbox\nextbox\else\processbox\fi
1996 \setbox\processbox\hpack to \scratchwidth
1997 {\hpack to \scratchwidth{\hss\box\processbox\hss}
1998 \kern\scratchwidth
1999 \hpack to \scratchwidth{\hss\box\nextbox \hss}}}
2000
2001\permanent\protected\def\startoverlay
2002 {\vbox\bgroup
2003 \enforced\aliased\let\stopoverlay\egroup
2004 \processboxes\syst_boxes_overlay_process}
2005
2006\permanent\protected\lettonothing\stopoverlay
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019\permanent\protected\def\fakebox
2020 {\bgroup
2021 \afterassignment\syst_boxes_fakebox_finish\scratchcounter}
2022
2023\def\syst_boxes_fakebox_finish
2024 {\setbox\scratchbox\ifhbox\scratchcounter\emptyhbox\else\emptyvbox\fi
2025 \wd\scratchbox\wd\scratchcounter
2026 \ht\scratchbox\ht\scratchcounter
2027 \dp\scratchbox\dp\scratchcounter
2028 \box\scratchbox
2029 \egroup}
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046\def\syst_boxes_lrc_process#1
2047 {\bgroup
2048 \forgetall
2049 \enforced\let\\\endgraf
2050 #1
2051 \let\nexttoken}
2052
2053\permanent\protected\def\lbox#1#{\vbox#1\syst_boxes_lrc_process\raggedleft }
2054\permanent\protected\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
2055\permanent\protected\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
2056
2057\permanent\protected\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
2058\permanent\protected\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
2059\permanent\protected\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081\permanent\protected\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
2082\permanent\protected\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
2083
2084\def\syst_boxes_tbox_finish
2085 {\scratchheight\strutht
2086 \scratchdepth{\htdp\nextbox\scratchheight}
2087 \ht\nextbox\scratchheight
2088 \dp\nextbox\scratchdepth
2089 \boxyoffset\nextbox\scratchdepth
2090 \box\nextbox
2091 \egroup}
2092
2093\def\syst_boxes_bbox_finish
2094 {\scratchdepth\strutdp
2095 \scratchheight{\htdp\nextbox\scratchdepth}
2096 \dp\nextbox\scratchdepth
2097 \ht\nextbox\scratchheight
2098 \boxyoffset\nextbox\scratchdepth
2099 \box\nextbox
2100 \egroup}
2101
2102
2103
2104
2105
2106
2107\def\syst_boxes_lhbox{\hpack to \hsize{\box\nextbox\hss }}
2108\def\syst_boxes_mhbox{\hpack to \hsize{\hss\box\nextbox\hss}}
2109\def\syst_boxes_rhbox{\hpack to \hsize{\hss\box\nextbox }}
2110
2111\permanent\protected\def\lhbox{\dowithnextboxcs\syst_boxes_lhbox\hbox}
2112\permanent\protected\def\mhbox{\dowithnextboxcs\syst_boxes_mhbox\hbox}
2113\permanent\protected\def\rhbox{\dowithnextboxcs\syst_boxes_rhbox\hbox}
2114
2115\aliased\let\lefthbox \lhbox
2116\aliased\let\midhbox \mhbox
2117\aliased\let\righthbox\rhbox
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132\newdimension\sizeofbox
2133
2134\permanent\protected\def\boxofsize#1
2135 {\bgroup
2136 \sizeofbox\zeropoint
2137 \scratchdimen\zeropoint
2138 \def\docommand
2139 {\advanceby\sizeofbox\scratchdimen
2140 \futurelet\nexttoken\dodocommand}
2141 \def\dodocommand
2142 {\ifx\nexttoken\bgroup
2143 \normalexpanded{\egroup#1 to \the\sizeofbox}
2144 \else
2145 \expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen
2146 \fi}
2147 \docommand}
2148
2149
2150
2151
2152
2153
2154
2155
2156\permanent\protected\def\limitatelines#1#2
2157 {\dowithnextbox
2158 {\scratchdimen#1\hsize
2159 \ifdim\wd\nextbox>\scratchdimen
2160 \setbox\nextbox\hbox
2161 {\advanceby\scratchdimen .1\hsize
2162 \limitatetext{\unhbox\nextbox}{\scratchdimen}{\nobreak#2}}
2163 \fi
2164 \unhbox\nextbox}
2165 \hbox}
2166
2167\permanent\protected\def\fittoptobaselinegrid
2168 {\dowithnextbox
2169 {\bgroup
2170 \par
2171 \scratchdimen\ht\nextbox
2172 \ht\nextbox\strutht
2173 \dp\nextbox\strutdp
2174 \hpack{\box\nextbox}
2175 \prevdepth\strutdp
2176 \doloop
2177 {\advanceby\scratchdimen \lineheight
2178 \ifdim\scratchdimen<\zeropoint
2179 \exitloop
2180 \else
2181 \nobreak
2182 \hpack{\strut}
2183 \fi}
2184 \egroup}
2185 \vbox}
2186
2187
2188
2189\newif\iftraceboxplacement
2190
2191\newbox\fakedboxcursor
2192
2193\setbox\fakedboxcursor\hpack
2194 {\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
2195
2196\permanent\protected\def\boxcursor
2197 {\iftraceboxplacement
2198 \bgroup
2199 \scratchdimen2\onepoint
2200 \setbox\scratchbox\hpack to \zeropoint
2201 {\hss
2202 \vrule
2203 \s!width \scratchdimen
2204 \s!height\scratchdimen
2205 \s!depth \scratchdimen
2206 \hss}
2207 \smashedbox\scratchbox
2208 \egroup
2209 \else
2210 \copy\fakedboxcursor
2211 \fi}
2212
2213\permanent\protected\def\placedbox
2214 {\iftraceboxplacement\ruledhbox\else\hbox\fi}
2215
2216\newdimension\boxoffset
2217\newdimension\boxhdisplacement
2218\newdimension\boxvdisplacement
2219
2220\permanent\protected\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
2221\permanent\protected\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
2222\permanent\protected\def\topbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_topbox_finish \placedbox}
2223\permanent\protected\def\bottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_bottombox_finish \placedbox}
2224\permanent\protected\def\lefttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_lefttopbox_finish \placedbox}
2225\permanent\protected\def\righttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_righttopbox_finish \placedbox}
2226\permanent\protected\def\leftbottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbottombox_finish \placedbox}
2227\permanent\protected\def\rightbottombox{\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbottombox_finish\placedbox}
2228
2229\aliased\let\topleftbox \lefttopbox
2230\aliased\let\toprightbox \righttopbox
2231\aliased\let\bottomleftbox \leftbottombox
2232\aliased\let\bottomrightbox\rightbottombox
2233
2234\def\syst_boxes_rightbox_finish
2235 {\global\boxhdisplacement\boxoffset
2236 \global\boxvdisplacement{(\ht\nextbox\dp\nextbox)2}
2237 \boxcursor
2238 \boxxmove\nextbox \boxhdisplacement
2239 \boxymove\nextbox\boxvdisplacement
2240 \box\nextbox
2241 \egroup}
2242
2243\def\syst_boxes_leftbox_finish
2244 {\global\boxhdisplacement{\wd\nextbox\boxoffset}
2245 \global\boxvdisplacement{(\ht\nextbox\dp\nextbox)2}
2246 \boxcursor
2247 \boxxmove\nextbox \boxhdisplacement
2248 \boxymove\nextbox\boxvdisplacement
2249 \box\nextbox
2250 \egroup}
2251
2252\def\syst_boxes_topbox_finish
2253 {\global\boxhdisplacement.5\wd\nextbox
2254 \global\boxvdisplacement{\dp\nextbox\boxoffset}
2255 \boxcursor
2256 \boxxmove\nextbox \boxhdisplacement
2257 \boxymove\nextbox\boxvdisplacement
2258 \box\nextbox
2259 \egroup}
2260
2261\def\syst_boxes_bottombox_finish
2262 {\global\boxhdisplacement{\wd\nextbox2}
2263 \global\boxvdisplacement{\ht\nextbox\boxoffset}
2264 \boxcursor
2265 \boxxmove\nextbox \boxhdisplacement
2266 \boxymove\nextbox\boxvdisplacement
2267 \box\nextbox
2268 \egroup}
2269
2270\def\syst_boxes_lefttopbox_finish
2271 {\global\boxhdisplacement{\wd\nextbox\boxoffset}
2272 \global\boxvdisplacement{\dp\nextbox\boxoffset}
2273 \boxcursor
2274 \boxxmove\nextbox \boxhdisplacement
2275 \boxymove\nextbox\boxvdisplacement
2276 \box\nextbox
2277 \egroup}
2278
2279\def\syst_boxes_righttopbox_finish
2280 {\global\boxhdisplacement\boxoffset
2281 \global\boxvdisplacement{\dp\nextbox\boxoffset}
2282 \boxcursor
2283 \boxxmove\nextbox \boxhdisplacement
2284 \boxymove\nextbox\boxvdisplacement
2285 \box\nextbox
2286 \egroup}
2287
2288\def\syst_boxes_leftbottombox_finish
2289 {\global\boxhdisplacement{\wd\nextbox\boxoffset}
2290 \global\boxvdisplacement{\ht\nextbox\boxoffset}
2291 \boxcursor
2292 \boxxmove\nextbox \boxhdisplacement
2293 \boxymove\nextbox\boxvdisplacement
2294 \box\nextbox
2295 \egroup}
2296
2297\def\syst_boxes_rightbottombox_finish
2298 {\global\boxhdisplacement\boxoffset
2299 \global\boxvdisplacement{\ht\nextbox\boxoffset}
2300 \boxcursor
2301 \boxxmove\nextbox \boxhdisplacement
2302 \boxymove\nextbox\boxvdisplacement
2303 \box\nextbox
2304 \egroup}
2305
2306\permanent\protected\def\middlebox {\hpack\bgroup\dowithnextboxcs\syst_boxes_middlebox_finish \placedbox}
2307\permanent\protected\def\baselinemiddlebox{\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinemiddlebox_finish\placedbox}
2308\permanent\protected\def\baselineleftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselineleftbox_finish \placedbox}
2309\permanent\protected\def\baselinerightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinerightbox_finish \placedbox}
2310
2311\def\syst_boxes_middlebox_finish
2312 {\global\boxhdisplacement{\wd\nextbox2}
2313 \global\boxvdisplacement{(\ht\nextbox\dp\nextbox)2}
2314 \boxcursor
2315 \boxxmove\nextbox \boxhdisplacement
2316 \boxymove\nextbox\boxvdisplacement
2317 \box\nextbox
2318 \egroup}
2319
2320\def\syst_boxes_baselinemiddlebox_finish
2321 {\global\boxhdisplacement{.5\wd\nextbox\boxoffset}
2322 \global\boxvdisplacement\boxoffset
2323 \boxcursor
2324 \boxxmove\nextbox \boxhdisplacement
2325 \boxymove\nextbox\boxvdisplacement
2326 \box\nextbox
2327 \egroup}
2328
2329\def\syst_boxes_baselineleftbox_finish
2330 {\global\boxhdisplacement{\wd\nextbox\boxoffset}
2331 \global\boxvdisplacement\boxoffset
2332 \boxcursor
2333 \boxxmove\nextbox \boxhdisplacement
2334 \boxymove\nextbox\boxvdisplacement
2335 \box\nextbox
2336 \egroup}
2337
2338\def\syst_boxes_baselinerightbox_finish
2339 {\global\boxhdisplacement\boxoffset
2340 \global\boxvdisplacement\boxoffset
2341 \boxcursor
2342 \boxxmove\nextbox \boxhdisplacement
2343 \boxymove\nextbox\boxvdisplacement
2344 \box\nextbox
2345 \egroup}
2346
2347
2348
2349
2350
2351
2352\permanent\protected\def\lrtbbox#1#2#3#4
2353 {\bgroup
2354 \dowithnextboxcontent
2355 {\advanceby\hsize#1\advanceby\hsize#2\relax
2356 \advanceby\vsize#3\advanceby\vsize#4\relax}
2357 {\forgetall\vpack to \vsize{\vskip#3\hpack to \hsize{\hskip#1\box\nextbox\hss}\vss}\egroup}
2358 \vbox}
2359
2360
2361
2362
2363
2364
2365\permanent\protected\def\toplinebox
2366 {\dowithnextboxcs\syst_boxes_toplinebox_finish\tbox}
2367
2368\def\syst_boxes_toplinebox_finish
2369 {\ifdim\dp\nextbox>\strutdepth
2370 \scratchdimen\dp\nextbox
2371 \advanceby\scratchdimen\strutdepth
2372 \getnoflines\scratchdimen
2373 \struttedbox{\box\nextbox}
2374 \dorecurse\noflines\verticalstrut
2375 \else
2376 \box\nextbox
2377 \fi}
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401\installcorenamespace {stackbox}
2402\installcorenamespace {stacklst}
2403
2404\permanent\protected\def\setstackbox#1#2
2405 {\ifcsname\??stackbox#1:#2\endcsname\else
2406 \expandafter\newbox\csname\??stackbox#1:#2\endcsname
2407 \fi
2408 \global\setbox\csname\??stackbox#1:#2\endcsname\vbox}
2409
2410\permanent\protected\def\initializeboxstack#1
2411 {\def\docommand##1{\setstackbox{#1}{##1}{}}
2412 \ifcsname\??stacklst#1\endcsname
2413 \expandafter\processcommacommand\expandafter[\lastnamedcs]\docommand
2414 \fi
2415 \gletcsname\??stacklst#1\endcsname\empty}
2416
2417\permanent\protected\def\savebox#1#2
2418 {
2419 \ifcsname\??stacklst#1\endcsname
2420 \xdefcsname\??stacklst#1\expandafter\endcsname\expandafter{\lastnamedcs,#2}
2421 \else
2422 \xdefcsname\??stacklst#1\endcsname{#2}
2423 \fi
2424 \setstackbox{#1}{#2}}
2425
2426\permanent\protected\def\flushbox#1#2
2427 {\ifcsname\??stackbox#1:#2\endcsname
2428 \box\lastnamedcs
2429 \else
2430 \emptybox
2431 \fi}
2432
2433\permanent\protected\def\restorebox#1#2
2434 {\ifcsname\??stackbox#1:#2\endcsname
2435 \copy\lastnamedcs
2436 \else
2437 \emptybox
2438 \fi}
2439
2440\permanent\protected\def\foundbox#1#2
2441 {\vpack
2442 {\ifcsname\??stackbox#1:#2\endcsname
2443 \copy\lastnamedcs
2444 \fi}}
2445
2446\permanent\protected\def\doifelsebox#1#2
2447 {\unless\ifcsname\??stackbox#1:#2\endcsname
2448 \expandafter\secondoftwoarguments
2449 \orelse\ifvoid\lastnamedcs
2450 \expandafter\secondoftwoarguments
2451 \else
2452 \expandafter\firstoftwoarguments
2453 \fi}
2454
2455\aliased\let\doifboxelse\doifelsebox
2456
2457
2458
2459\installcorenamespace {boxstack}
2460
2461\newinteger\c_syst_boxes_stack
2462
2463\mutable\let\b_syst_boxes_stack\relax
2464
2465\protected\def\syst_boxes_stack_allocate
2466 {\newbox\b_syst_boxes_stack
2467 \letcsname\??boxstack\the\c_syst_boxes_stack\endcsname\b_syst_boxes_stack}
2468
2469\protected\def\syst_boxes_push#1#2
2470 {\global\advanceby\c_syst_boxes_stack\plusone
2471 \expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\the\c_syst_boxes_stack\endcsname
2472 \ifrelax\b_syst_boxes_stack
2473 \syst_boxes_stack_allocate
2474 \fi
2475 #1\setbox\b_syst_boxes_stack\box#2\relax}
2476
2477\protected\def\syst_boxes_pop#1#2
2478 {#1\setbox#2\box\csname\??boxstack\the\c_syst_boxes_stack\endcsname
2479 \global\advanceby\c_syst_boxes_stack\minusone}
2480
2481\permanent\protected\def\localpushbox {\syst_boxes_push\relax}
2482\permanent\protected\def\localpopbox {\syst_boxes_pop \relax}
2483
2484\permanent\protected\def\globalpushbox{\syst_boxes_push\global}
2485\permanent\protected\def\globalpopbox {\syst_boxes_pop \global}
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523\permanent\protected\def\removedepth
2524 {\ifvmode
2525 \ifdim\prevdepth>\zeropoint
2526 \kern\prevdepth
2527 \fi
2528 \fi}
2529
2530\permanent\protected\def\obeydepth
2531 {\par
2532 \ifvmode\ifdim\prevdepth<\zeropoint\orelse\ifdim\prevdepth<\strutdp
2533 \kern{\strutdp\prevdepth}
2534 \prevdepth\strutdp
2535 \fi\fi}
2536
2537\permanent\protected\def\undepthed
2538 {\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\hbox}
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548\permanent\protected\def\removebottomthings
2549 {\localcontrolledloop\plusone\plusfive\plusone{\unskip\unkern\unpenalty}}
2550
2551\permanent\protected\def\removelastskip
2552 {\ifvmode\ifzeropt\lastskip\else\vskip\lastskip\fi\fi}
2553
2554
2555
2556
2557
2558
2559
2560\permanent\protected\def\makestrutofbox
2561 {\afterassignment\syst_boxes_makestrutofbox\c_boxes_register}
2562
2563\def\syst_boxes_makestrutofbox
2564 {\ht\c_boxes_register\strutht
2565 \dp\c_boxes_register\strutdp
2566 \wd\c_boxes_register\zeropoint}
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579\permanent\protected\def\raisebox#1{\bgroup\afterassignment\syst_boxes_raise_indeed\scratchdimen#1}
2580\permanent\protected\def\lowerbox#1{\bgroup\afterassignment\syst_boxes_lower_indeed\scratchdimen#1}
2581
2582\def\syst_boxes_raise_indeed{\dowithnextboxcs\syst_boxes_raise_finish}
2583\def\syst_boxes_lower_indeed{\dowithnextboxcs\syst_boxes_lower_finish}
2584
2585\def\syst_boxes_raise_finish
2586 {\boxyoffset\nextbox\scratchdimen
2587 \ht\nextbox\strutht
2588 \dp\nextbox\strutdp
2589 \box\nextbox
2590 \egroup}
2591
2592\def\syst_boxes_lower_finish
2593 {\boxyoffset\nextbox\scratchdimen
2594 \ht\nextbox\strutht
2595 \dp\nextbox\strutdp
2596 \box\nextbox
2597 \egroup}
2598
2599
2600
2601\permanent\protected\def\halfwaybox
2602 {\hpack\bgroup
2603 \dowithnextboxcs\syst_boxes_halfwaybox_finish\hbox}
2604
2605\def\syst_boxes_halfwaybox_finish
2606 {\dp\nextbox\zeropoint
2607 \lower.5\ht\nextbox\box\nextbox
2608 \egroup}
2609
2610\permanent\protected\def\depthonlybox
2611 {\tpack\bgroup
2612 \dowithnextboxcs\syst_boxes_depthonlybox_finish\vbox}
2613
2614\def\syst_boxes_depthonlybox_finish
2615 {\hsize\wd\nextbox
2616 \kern\zeropoint\box\nextbox
2617 \egroup}
2618
2619
2620
2621\permanent\def\setdimentoatleast#1#2{\ifdim#1>\zeropoint\else#1=#2\fi}
2622\permanent\def\setdimentoatmost #1#2{\ifdim#1>#2\relax \else#1=#2\fi}
2623
2624
2625
2626\aliased\let\naturalvcenter\normalvtop
2627
2628
2629
2630
2631
2632
2633
2634
2635\permanent\protected\def\frozenhbox
2636 {\hpack\bgroup
2637 \dowithnextboxcs\syst_boxes_frozenhbox_finish\hbox}
2638
2639\def\syst_boxes_frozenhbox_finish
2640 {\hpack{\hpack{\box\nextbox}}
2641 \egroup}
2642
2643
2644
2645
2646
2647
2648\installcorenamespace {boxx}
2649\installcorenamespace {boxy}
2650
2651\permanent\protected\def\setboxllx #1#2{\edefcsname\??box_x\number#1\endcsname{\todimension{#2}}}
2652\permanent\protected\def\setboxlly #1#2{\edefcsname\??box_y\number#1\endcsname{\todimension{#2}}}
2653
2654\permanent\protected\def\gsetboxllx#1#2{\xdefcsname\??box_x\number#1\endcsname{\todimension{#2}}}
2655\permanent\protected\def\gsetboxlly#1#2{\xdefcsname\??box_y\number#1\endcsname{\todimension{#2}}}
2656
2657\permanent\def\getboxllx#1{\ifcsname\??box_x\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
2658\permanent\def\getboxlly#1{\ifcsname\??box_y\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
2659
2660\permanent\def\directgetboxllx#1{\csname\??box_x\number#1\endcsname}
2661\permanent\def\directgetboxlly#1{\csname\??box_y\number#1\endcsname}
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676\permanent\protected\def\shownextbox
2677 {\dowithnextbox
2678 {\bgroup
2679 \showboxbreadth\maxcount
2680 \showboxdepth \maxcount
2681 \scratchcounter\interactionmode
2682 \batchmode
2683 \showbox\nextbox
2684 \box\nextbox
2685 \interactionmode\scratchcounter
2686 \egroup}}
2687
2688\permanent\protected\def\spreadhbox#1
2689 {\bgroup
2690 \ifhbox#1\relax
2691 \setbox\scratchboxtwo\emptybox
2692 \unhbox#1
2693 \doloop
2694 {\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip
2695 \setbox\scratchboxone\lastbox
2696 \ifvoid\scratchboxone
2697 \exitloop
2698 \else
2699 \setbox\scratchboxtwo\hbox
2700 {\ifhbox\scratchboxone \spreadhbox\scratchboxone\else\box\scratchboxone\fi
2701 \ifvoid\scratchboxtwo \else\hss\unhbox\scratchboxtwo\fi}
2702 \fi}
2703 \ifvoid\scratchboxtwo\else\unhbox\scratchboxtwo\fi
2704 \else
2705 \box#1
2706 \fi
2707 \egroup}
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718\permanent\protected\def\minimalhbox#1#
2719 {\dowithnextbox
2720 {\bgroup
2721 \setbox\scratchbox\hpack#1{\hss}
2722 \ifdim\wd\nextbox<\wd\scratchbox\wd\nextbox\wd\scratchbox\fi
2723 \box\nextbox
2724 \egroup}
2725 \hbox}
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742\def\syst_boxes_contenttostring
2743 {\normalexpanded{\endgroup\endlocalcontrol\boxtostring\nextbox}}
2744
2745\permanent\def\contenttostring
2746 {\beginlocalcontrol\begingroup
2747 \dowithnextboxcs\syst_boxes_contenttostring\hbox}
2748
2749\newtoks \everypreroll
2750\newif \ifprerolling
2751
2752\appendtoks
2753 \prerollingtrue
2754\to \everypreroll
2755
2756\let\prerolltostring\firstofoneargument
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769\newbox\b_syst_boxes
2770
2771\appendtoks
2772 \permanent\def\prerolltostring#1
2773 {\beginlocalcontrol
2774 \setbox\b_syst_boxes\hbox{\expand\everypreroll#1}
2775 \normalexpanded
2776 {\setbox\b_syst_boxes\emptybox
2777 \endlocalcontrol
2778 \boxtostring\b_syst_boxes}}
2779\to \everydump
2780
2781
2782
2783\permanent\protected\def\nodestostring#1#2
2784 {\edef#2{\contenttostring{#1}}}
2785
2786
2787
2788\aliased\let\hyphenatedhbox\hbox
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814\permanent\protected\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
2815
2816\aliased\let\doifrighttoleftinboxelse\doifelserighttoleftinbox
2817
2818
2819
2820\definesystemattribute [runningtext] [public]
2821
2822\permanent\protected\def\runninghbox{\hbox attr \runningtextattribute \fontid\font}
2823
2824
2825
2826\permanent\protected\def\beginhbox{\hbox\bgroup} \aliased\let\endhbox\egroup
2827\permanent\protected\def\beginvbox{\vbox\bgroup} \aliased\let\endvbox\egroup
2828\permanent\protected\def\beginvtop{\vtop\bgroup} \aliased\let\endvtop\egroup
2829
2830\permanent\protected\def\sethboxregister#1{\setbox#1\hbox}
2831\permanent\protected\def\setvboxregister#1{\setbox#1\vbox}
2832\permanent\protected\def\setvtopregister#1{\setbox#1\vtop}
2833
2834\permanent\protected\def\flushboxregister#1{\box\numexpr#1\relax}
2835
2836\permanent\protected\def\starthboxregister#1{\setbox#1\hbox\bgroup} \aliased\let\stophboxregister\egroup
2837\permanent\protected\def\startvboxregister#1{\setbox#1\vbox\bgroup} \aliased\let\stopvboxregister\egroup
2838\permanent\protected\def\startvtopregister#1{\setbox#1\vtop\bgroup} \aliased\let\stopvtopregister\egroup
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877 \aliased\let\shiftbox \boxshift
2878
2879\permanent\protected\def\vpackbox {\clf_vpackbox}
2880\permanent\protected\def\hpackbox {\clf_hpackbox}
2881\permanent\protected\def\vpackedbox{\clf_vpackedbox}
2882\permanent\protected\def\hpackedbox{\clf_hpackedbox}
2883
2884
2885
2886
2887\permanent\protected\def\linebox
2888 {\hpack\bgroup\dowithnextbox
2889 {\scratchdimen{(\htdp\nextbox\lineheight)2\strutdp}
2890 \setbox\nextbox\hpack{\lower\scratchdimen\box\nextbox}
2891 \ht\nextbox\strutht
2892 \dp\nextbox\strutdp
2893 \box\nextbox
2894 \egroup}
2895 \hbox}
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973\untraced\permanent\protected\def\showboxhere{\showbox nolevels content online all }
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027\newconditional\boxstretchfixed
3028\newdimension \boxstretchdelta
3029
3030\permanent\protected\def\boxfixstretch
3031 {\begingroup
3032 \afterassignment\syst_boxes_fixstretch_a\scratchdimen}
3033
3034\permanent\protected\def\syst_boxes_fixstretch_a
3035 {\afterassignment\syst_boxes_fixstretch_b\scratchcounter}
3036
3037\permanent\protected\def\syst_boxes_fixstretch_b
3038 {\scratchdimenone \ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter
3039 \scratchdimentwo \boxrepack\scratchcounter
3040 \scratchdimenthree\boxstretch\scratchcounter
3041 \scratchdistance {\scratchdimenone\scratchdimentwo}
3042
3043 \unless\ifdim\scratchdistance>\scratchdimenthree
3044
3045 \global\boxstretchfixed\conditionalfalse
3046 \global\boxstretchdelta\zeropoint
3047 \orelse\ifdim\scratchdistance>\scratchdimen
3048
3049 \boxlimitate\scratchcounter\zerocount
3050 \global\boxstretchfixed\conditionaltrue
3051 \global\boxstretchdelta{\ifvbox\scratchcounter\ht\else\wd\fi\scratchcounter\boxrepack\scratchcounter}
3052 \else
3053
3054 \global\boxstretchfixed\conditionalfalse
3055 \global\boxstretchdelta\zeropoint
3056 \fi
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073 \endgroup}
3074
3075\protect \endinput
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191 |