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\registerctxluafile{suppbox}{autosuffix,optimize}
19
20
21
22\newdimen\givenwidth
23\newdimen\givenheight
24\newdimen\givendepth
25
26
27
28
29
30
31
32
33
34
35
36
37
38 \def\strutdp {\dp\strutbox}
39 \def\strutht {\ht\strutbox}
40\permanent\protected\def\strutwd {\wd\strutbox}
41\permanent\protected\def\struthtdp{\dimexpr\strutht\strutdp\relax}
42\permanent\protected\def\strutgap {\dimexpr\strutht\strutdp\relax}
43
44
45
46
47
48
49
50\ifdefined\voidbox \else \newbox\voidbox \fi
51\ifdefined\nextbox \else \newbox\nextbox \fi
52
53
54
55
56
57
58
59
60\newdimen\nextdepth
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\newcount\c_boxes_register
95
96\permanent\protected\def\smashbox
97 {\afterassignment\syst_boxes_smash_boxes_register\c_boxes_register}
98
99\def\syst_boxes_smash_boxes_register
100 {\wd\c_boxes_register\zeropoint
101 \ht\c_boxes_register\zeropoint
102 \dp\c_boxes_register\zeropoint}
103
104\permanent\protected\def\hsmashbox
105 {\afterassignment\syst_boxes_hsmashed_boxes_register\c_boxes_register}
106
107\def\syst_boxes_hsmashed_boxes_register
108 {\wd\c_boxes_register\zeropoint}
109
110\permanent\protected\def\vsmashbox
111 {\afterassignment\syst_boxes_vsmashed_boxes_register\c_boxes_register}
112
113\def\syst_boxes_vsmashed_boxes_register
114 {\ht\c_boxes_register\zeropoint
115 \dp\c_boxes_register\zeropoint}
116
117\permanent\protected\def\smashedbox
118 {\afterassignment\syst_boxes_smashed_boxes_register\c_boxes_register}
119
120\protected\def\syst_boxes_smashed_boxes_register
121 {\wd\c_boxes_register\zeropoint
122 \ht\c_boxes_register\zeropoint
123 \dp\c_boxes_register\zeropoint
124 \box\c_boxes_register}
125
126\aliased\let\smashboxed\smashedbox
127
128
129
130
131
132
133
134
135
136\permanent\protected\def\hsmash {\bgroup\dowithnextboxcs\syst_boxes_hsmashed_nextbox\hbox}
137\permanent\protected\def\vsmash {\bgroup\dowithnextboxcs\syst_boxes_vsmashed_nextbox\vbox}
138\permanent\protected\def\hsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \hbox}
139\permanent\protected\def\vsmashed{\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox \vbox}
140
141\protected\def\syst_boxes_hsmashed_nextbox
142 {\wd\nextbox\zeropoint
143 \box\nextbox
144 \egroup}
145
146\protected\def\syst_boxes_vsmashed_nextbox
147 {\ht\nextbox\zeropoint
148 \dp\nextbox\zeropoint
149 \box\nextbox
150 \egroup}
151
152\protected\def\syst_boxes_smashed_nextbox
153 {\ht\nextbox\zeropoint
154 \dp\nextbox\zeropoint
155 \wd\nextbox\zeropoint
156 \box\nextbox
157 \egroup}
158
159
160
161
162
163
164
165
166
167
168
169\permanent\protected\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
170\permanent\protected\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
171
172
173
174
175\newcount\c_boxes_math_style
176
177\protected\def\syst_boxes_math_set_nextbox#1
178 {\c_boxes_math_style\normalmathstyle
179 \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
180
181
182
183
184
185
186
187
188\permanent\protected\def\smash
189 {\begingroup
190 \futureexpandis[\syst_boxes_smash_yes\syst_boxes_smash_nop}
191
192\def\syst_boxes_smash_nop
193 {\edef\m_boxes_smash_options{hd}
194 \futurelet\nexttoken\syst_boxes_smash_indeed}
195
196\def\syst_boxes_smash_yes[#1]
197 {\edef\m_boxes_smash_options{#1}
198 \futurelet\nexttoken\syst_boxes_smash_indeed}
199
200\def\syst_boxes_smash_indeed
201 {\ifmmode
202 \expandafter\syst_boxes_smash_math
203 \orelse\ifx\nexttoken\bgroup
204 \expandafter\syst_boxes_smash_hbox
205 \else
206 \expandafter\syst_boxes_smash_text
207 \fi}
208
209\def\syst_boxes_smash_math#1
210 {\syst_boxes_math_set_nextbox{#1}
211 \syst_boxes_smash_process}
212
213\def\syst_boxes_smash_hbox
214 {\dowithnextboxcs\syst_boxes_smash_process\hbox}
215
216\def\syst_boxes_smash_text#1
217 {\setbox\nextbox\hbox{#1}
218 \syst_boxes_smash_process}
219
220\def\syst_boxes_smash_process
221 {\expandafter\syst_boxes_smash_process_option\m_boxes_smash_options\relax
222 \box\nextbox
223 \endgroup}
224
225\installcorenamespace {smashoptions}
226
227\defcsname\??smashoptions w\endcsname{\wd\nextbox\zeropoint}
228\defcsname\??smashoptions h\endcsname{\ht\nextbox\zeropoint}
229\defcsname\??smashoptions d\endcsname{\dp\nextbox\zeropoint}
230\defcsname\??smashoptions t\endcsname{\ht\nextbox\zeropoint}
231\defcsname\??smashoptions b\endcsname{\dp\nextbox\zeropoint}
232\defcsname\??smashoptions hd\endcsname{\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
233\defcsname\??smashoptions whd\endcsname{\wd\nextbox\zeropoint\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
234
235\def\syst_boxes_smash_process_option#1
236 {\ifx#1\relax\else
237 \begincsname\??smashoptions#1\endcsname
238 \expandafter\syst_boxes_smash_process_option
239 \fi}
240
241\def\syst_boxes_lower_nextbox_dp
242 {\setbox\nextbox\hpack{\lower\dp\nextbox\box\nextbox}}
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262\permanent\protected\def\phantom {\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed }
263\permanent\protected\def\vphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_v}
264\permanent\protected\def\hphantom{\begingroup\futurelet\nexttoken\syst_boxes_phantom_indeed_h}
265
266\def\syst_boxes_phantom_math #1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make }
267\def\syst_boxes_phantom_math_v#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_v}
268\def\syst_boxes_phantom_math_h#1{\syst_boxes_math_set_nextbox{#1}\syst_boxes_phantom_make_h}
269
270\def\syst_boxes_phantom_hbox {\dowithnextboxcs\syst_boxes_phantom_make \hbox}
271\def\syst_boxes_phantom_hbox_v{\dowithnextboxcs\syst_boxes_phantom_make_v\hbox}
272\def\syst_boxes_phantom_hbox_h{\dowithnextboxcs\syst_boxes_phantom_make_h\hbox}
273
274\def\syst_boxes_phantom_text #1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make }
275\def\syst_boxes_phantom_text_v#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_v}
276\def\syst_boxes_phantom_text_h#1{\setbox\nextbox\hbox{#1}\syst_boxes_phantom_make_h}
277
278\def\syst_boxes_phantom_indeed
279 {\ifmmode
280 \expandafter\syst_boxes_phantom_math
281 \orelse\ifx\nexttoken\bgroup
282 \expandafter\syst_boxes_phantom_hbox
283 \else
284 \expandafter\syst_boxes_phantom_text
285 \fi}
286
287\def\syst_boxes_phantom_indeed_v
288 {\ifmmode
289 \expandafter\syst_boxes_phantom_math_v
290 \orelse\ifx\nexttoken\bgroup
291 \expandafter\syst_boxes_phantom_hbox_v
292 \else
293 \expandafter\syst_boxes_phantom_text_v
294 \fi}
295
296\def\syst_boxes_phantom_indeed_h
297 {\ifmmode
298 \expandafter\syst_boxes_phantom_math_h
299 \orelse\ifx\nexttoken\bgroup
300 \expandafter\syst_boxes_phantom_hbox_h
301 \else
302 \expandafter\syst_boxes_phantom_text_h
303 \fi}
304
305\def\syst_boxes_phantom_make
306 {\setbox\scratchbox\emptyhbox
307 \ht\scratchbox\ht\nextbox
308 \dp\scratchbox\dp\nextbox
309 \wd\scratchbox\wd\nextbox
310 \box\scratchbox
311 \endgroup}
312
313\def\syst_boxes_phantom_make_v
314 {\setbox\scratchbox\emptyhbox
315 \ht\scratchbox\ht\nextbox
316 \dp\scratchbox\dp\nextbox
317 \box\scratchbox
318 \endgroup}
319
320\def\syst_boxes_phantom_make_h
321 {\setbox\scratchbox\emptyhbox
322 \wd\scratchbox\wd\nextbox
323 \box\scratchbox
324 \endgroup}
325
326
327
328\permanent\protected\def\mathstrut{\vphantom(}
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\permanent\protected\def\getboxheight#1\of#2\box#3
363 {\def\next{#1\htdp\c_boxes_register}
364 \afterassignment\next\c_boxes_register=#3}
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383\ifdefined\roundingeps \else \newdimen\roundingeps \roundingeps=10sp \fi
384
385\newcount\noflines
386\newdimen\noflinesheight
387
388\permanent\protected\def\getnoflines#1
389 {\noflinesheight#1\relax
390 \ifzeropt\noflinesheight
391 \noflines\zerocount
392 \orelse\ifdim\noflinesheight>\zeropoint
393 \advance\noflinesheight\roundingeps
394 \divide\noflinesheight\openlineheight
395 \noflines\noflinesheight
396 \advance\noflines\plusone
397 \else
398 \advance\noflinesheight\roundingeps
399 \divide\noflinesheight\openlineheight
400 \noflines\noflinesheight
401 \advance\noflines\minusone
402 \fi}
403
404\permanent\protected\def\getroundednoflines#1
405 {\noflinesheight#1\relax
406 \ifzeropt\noflinesheight
407 \noflines\zerocount
408 \orelse\ifdim\noflinesheight>\zeropoint
409 \advance\noflinesheight\roundingeps
410 \divide\noflinesheight\openlineheight
411 \noflines\noflinesheight
412 \else
413 \advance\noflinesheight\roundingeps
414 \divide\noflinesheight\openlineheight
415 \noflines\noflinesheight
416 \fi}
417
418\permanent\protected\def\getrawnoflines#1
419 {\noflinesheight#1\relax
420 \ifzeropt\noflinesheight
421 \noflines\zerocount
422 \orelse\ifdim\noflinesheight>\zeropoint
423 \advance\noflinesheight\roundingeps
424 \advance\noflinesheight.5\openlineheight
425 \divide\noflinesheight\openlineheight
426 \noflines\noflinesheight
427 \else
428 \advance\noflinesheight\roundingeps
429 \advance\noflinesheight.5\openlineheight
430 \divide\noflinesheight\openlineheight
431 \noflines\noflinesheight
432 \fi}
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\def\syst_boxes_determine_noflines
480 {\expandafter\egroup\expandafter\noflines\noflinesinbox\nextbox\relax}
481
482\permanent\protected\def\determinenoflines
483 {\bgroup
484 \forgetall
485 \enforced\let\crlf\endgraf
486 \enforced\let\\\endgraf
487 \dowithnextboxcs\syst_boxes_determine_noflines\vbox}
488
489\def\determinednoflines#1
490 {\localcontrolled{\determinenoflines{#1}}\noflines}
491
492
493
494
495
496
497
498
499
500
501
502
503\permanent\protected\def\doifelsetext#1
504 {\begingroup
505 \setbox\scratchbox\hbox
506 {\settrialtypesetting
507 \ignorespaces#1\removeunwantedspaces}
508 \ifzeropt\wd\scratchbox
509 \endgroup\expandafter\secondoftwoarguments
510 \else
511 \endgroup\expandafter\firstoftwoarguments
512 \fi}
513
514\permanent\protected\def\doiftext#1
515 {\begingroup
516 \setbox\scratchbox\hbox
517 {\settrialtypesetting
518 \ignorespaces#1\removeunwantedspaces}
519 \ifzeropt\wd\scratchbox
520 \endgroup\expandafter\gobbleoneargument
521 \else
522 \endgroup\expandafter\firstofoneargument
523 \fi}
524
525
526
527
528
529\aliased\let\doiftextelse\doifelsetext
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\let\syst_boxes_with_next_box\relax
565
566\permanent\protected\def\dowithnextbox#1
567 {\def\syst_boxes_with_next_box{#1}
568 \afterassignment\syst_boxes_with_next_box_indeed
569 \setbox\nextbox}
570
571\def\syst_boxes_with_next_box_indeed
572 {\aftergroup\syst_boxes_with_next_box}
573
574\permanent\protected\def\dowithnextboxcs#1
575 {\let\syst_boxes_with_next_box#1
576 \afterassignment\syst_boxes_with_next_box_indeed
577 \setbox\nextbox}
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\permanent\def\nextboxht {\ht\nextbox}
620\permanent\def\nextboxwd {\wd\nextbox}
621\permanent\def\nextboxdp {\dp\nextbox}
622\permanent\def\nextboxhtdp{\htdp\nextbox}
623
624\permanent\protected\def\flushnextbox{\box\nextbox}
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\permanent\protected\def\dowithnextboxcontent#1#2
654 {\afterassigned{#1\aftergrouped{#2}}
655 \setbox\nextbox}
656
657\permanent\protected\def\dowithnextboxcontentcs#1#2
658 {\afterassigned{#1\aftergroup#2}
659 \setbox\nextbox}
660
661
662
663
664
665
666
667\def\syst_boxes_do_rlap{\hpack to \zeropoint{\box\nextbox\hss}\endgroup}
668\def\syst_boxes_do_llap{\hpack to \zeropoint{\hss\box\nextbox}\endgroup}
669\def\syst_boxes_do_clap{\hpack to \zeropoint{\hss\box\nextbox\hss}\endgroup}
670\def\syst_boxes_do_tlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
671\def\syst_boxes_do_blap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
672
673\def\syst_boxes_rlap {\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox}
674\def\syst_boxes_llap {\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox}
675\def\syst_boxes_clap {\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox}
676\def\syst_boxes_math_clap{\mathpalette\syst_boxes_do_math_clap}
677\def\syst_boxes_math_llap{\mathpalette\syst_boxes_do_math_llap}
678\def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap}
679
680\def\syst_boxes_do_math_clap#1#2{\syst_boxes_clap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
681\def\syst_boxes_do_math_llap#1#2{\syst_boxes_llap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
682\def\syst_boxes_do_math_rlap#1#2{\syst_boxes_rlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
683
684\permanent\protected\def\rlap{\mathortext\syst_boxes_math_rlap\syst_boxes_rlap}
685\permanent\protected\def\llap{\mathortext\syst_boxes_math_llap\syst_boxes_llap}
686\permanent\protected\def\clap{\mathortext\syst_boxes_math_clap\syst_boxes_clap}
687\permanent\protected\def\tlap{\begingroup\dowithnextboxcs\syst_boxes_do_tlap\vbox}
688\permanent\protected\def\blap{\begingroup\dowithnextboxcs\syst_boxes_do_blap\vbox}
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\newif \ifsomeshapeleft
810\newif \ifreshapingbox
811\newif \ifreshapingfailed
812
813\newbox \shapebox
814\newcount \shapepenalty
815\newdimen \shapekern
816\newskip \shapeskip
817
818\newbox \newshapebox
819\newbox \oldshapebox
820\newbox \tmpshapebox
821
822\newcount \shapecounter
823
824\newevery \everyshapebox \relax
825
826\permanent\dimensiondef\shapesignal.12345678pt
827
828\permanent\protected\def\reshapebox#1
829 {\doreshapebox
830 {#1}
831 {\penalty\shapepenalty}
832 {\kern \shapekern }
833 {\vskip \shapeskip }}
834
835\permanent\protected\def\doreshapebox#1#2#3#4
836 {\global\reshapingfailedfalse
837 \ifzeropt\ht\oldshapebox
838 \setbox\newshapebox\emptyvbox
839 \else
840 \setbox\newshapebox\vbox
841 {\unvcopy\oldshapebox
842 \setbox\newshapebox\emptybox
843 \shapecounter\zerocount
844 \doloop{\dodoreshapebox{#1}{#2}{#3}{#4}}}
845 \setbox\newshapebox\box\tmpshapebox
846 \fi}
847
848
849
850\permanent\protected\def\insertshapesignal
851 {\hpack to \shapesignal{\strut\hss}
852 \prevdepth\strutdp}
853
854\permanent\protected\def\restoreshapebox
855 {\global\setbox\tmpshapebox\vbox{\vskip\lineheight\unvcopy\oldshapebox}}
856
857\permanent\def\dodoreshapebox#1#2#3#4
858 {\ifnum\lastnodetype=\gluenodecode
859 \shapeskip\lastskip
860 \global\setbox\tmpshapebox\vbox{#4\unvbox\tmpshapebox}
861 \unskip
862 \orelse\ifnum\lastnodetype=\kernnodecode
863 \shapekern\lastkern
864 \global\setbox\tmpshapebox\vbox{#3\unvbox\tmpshapebox}
865 \unkern
866 \orelse\ifnum\lastnodetype=\penaltynodecode
867 \shapepenalty\lastpenalty
868 \global\setbox\tmpshapebox\vbox{#2\unvbox\tmpshapebox}
869 \unpenalty
870 \orelse\ifnum\lastnodetype<\zeropoint
871 \exitloop
872 \else
873 \setbox\shapebox\lastbox
874 \ifvoid\shapebox
875 \orelse\ifdim\wd\shapebox=\shapesignal\relax
876 \exitloop
877 \else
878 \shapecounter\zerocount
879 \global\setbox\tmpshapebox\vbox{#1\unvbox\tmpshapebox}
880 \fi
881 \fi
882 \ifnum\shapecounter>100
883 \global\reshapingfailedtrue
884 \message{!!forced exit from shapebox \the\lastnodetype !!}
885 \restoreshapebox
886 \exitloop
887 \else
888 \advance\shapecounter \plusone
889 \fi}
890
891\permanent\protected\def\beginofshapebox
892 {\setbox\oldshapebox\vbox
893 \bgroup
894 \reshapingboxtrue
895 \the\everyshapebox
896 \insertshapesignal}
897
898\permanent\protected\def\endofshapebox
899 {\endgraf
900 \egroup}
901
902\aliased\let\beginshapebox\beginofshapebox
903\aliased\let\endshapebox \endofshapebox
904
905\permanent\protected\def\flushshapebox
906 {\bgroup
907 \ifzeropt\ht\newshapebox
908 \else
909
910
911 \ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi
912
913 \ifdim\prevdepth=\thousandpoint
914 \prevdepth\zeropoint
915 \fi
916 \ifdim\prevdepth<\zeropoint\relax
917
918 \donetrue
919 \orelse\ifinner
920
921 \donefalse
922 \orelse\ifdim\pagegoal=\maxdimen
923 \donetrue
924 \else
925
926 \donetrue
927 {\forgeteverypar\verticalstrut}\nobreak
928 \kern\struttotal
929 \kern\parskip
930
931 \fi
932 \scratchdimen\dp\newshapebox
933 \unvbox\newshapebox
934
935 \kern\scratchdimen
936
937 \ifdone
938 \kern\strutdp
939 \prevdepth\strutdp
940 \fi
941 \fi
942 \egroup}
943
944
945
946
947
948
949
950
951
952
953
954
955
956\permanent\protected\def\innerflushshapebox
957 {\ifzeropt\ht\newshapebox \else
958 \unvcopy\newshapebox\relax
959
960 \fi}
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979\permanent\protected\def\shapedhbox
980 {\expanded{\dowithnextbox
981 {\ht\nextbox\the\ht\shapebox
982 \dp\nextbox\the\dp\shapebox
983 \box\nextbox}}
984 \hbox}
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001\permanent\protected\def\doshowhyphenatednextbox
1002 {\clf_showhyphenatedinlist\nextbox}
1003
1004\permanent\protected\def\showhyphens
1005 {\dowithnextboxcs\doshowhyphenatednextbox\hpack}
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015\def\syst_boxes_hyphenatednextbox {\clf_hyphenatedlist\nextbox false\relax\unhbox\nextbox}
1016\def\syst_boxes_hyphenatednextboxcolor{\clf_hyphenatedlist\nextbox true \relax\unhbox\nextbox}
1017
1018\permanent\protected\def\hyphenatedword {\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox}
1019\permanent\protected\def\hyphenatedpar {\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox}
1020\permanent\protected\def\hyphenatedfile #1{\dowithnextboxcs\syst_boxes_hyphenatednextbox\hbox{\readfile{#1}\donothing\donothing}}
1021\permanent\protected\def\hyphenatedcoloredword{\dowithnextboxcs\syst_boxes_hyphenatednextboxcolor\hbox}
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052\mutable\let\nextprocessedtoken\empty
1053
1054\mutable\let\before \relax
1055
1056\mutable\let\after \relax
1057\mutable\let\white \relax
1058
1059\permanent\protected\def\processtokens#1#2#3#4#5
1060 {\begingroup
1061 \enforced\permanent\def\space{ }
1062 \enforced\let\\\space
1063 \enforced\def\before {#1}
1064 \enforced\def\between{#2}
1065 \enforced\def\after {#3}
1066 \enforced\def\white {#4}
1067 \enforced\let\m_syst_boxes_before\before
1068 \syst_boxes_processtokens#5\s!e_o_t_token
1069 \endgroup}
1070
1071\def\syst_boxes_processtokens
1072 {\afterassignment\syst_boxes_do_processtokens\let\nextprocessedtoken= }
1073
1074\def\syst_boxes_redo_processedtoken
1075 {\dowithnextbox
1076 {\before{\copy\nextbox}
1077 \enforced\let\before\between
1078 \syst_boxes_processtokens}
1079 \hbox\bgroup}
1080
1081\def\syst_boxes_do_processtokens
1082 {\ifx\nextprocessedtoken\s!e_o_t_token
1083 \after
1084 \orelse\ifx\nextprocessedtoken\bgroup
1085 \expandafter\syst_boxes_redo_processedtoken
1086 \else
1087 \expandafter\if\space\nextprocessedtoken
1088 \after\white
1089 \enforced\let\before\m_syst_boxes_before
1090 \else
1091 \before\nextprocessedtoken
1092 \enforced\let\before\between
1093 \fi
1094 \expandafter\syst_boxes_processtokens
1095 \fi}
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115\def\syst_boxes_boundtext#1
1116 {\setbox\scratchboxone\hbox{#1}
1117 \advance\scratchdimen \wd\scratchboxone
1118 \ifdim\scratchdimen>\zeropoint\relax#1\fi}
1119
1120\permanent\protected\def\doboundtext#1#2#3
1121 {\hbox
1122 {\setbox\scratchbox\hbox{#1}
1123 \scratchdimen#2\relax
1124 \ifdim\wd\scratchbox>\scratchdimen
1125 \setbox\scratchbox\hbox{#3}
1126 \advance\scratchdimen \wd\scratchbox
1127 \handletokens#1\with\syst_boxes_boundtext
1128 \fi
1129 \box\scratchbox}}
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146\ifdefined\fakecompoundhyphen\else \let\fakecompoundhyphen\relax \fi
1147\ifdefined\veryraggedright \else \def\veryraggedright{\raggedright} \fi
1148
1149
1150
1151\let\m_syst_boxes_left \empty
1152\let\m_syst_boxes_right\empty
1153
1154\permanent\protected\def\limitatetext#1#2#3
1155 {
1156 \splitatcomma{#2}\m_syst_boxes_left\m_syst_boxes_right
1157 \limitated
1158 \ifempty\m_syst_boxes_left\else
1159 left \m_syst_boxes_left
1160 \fi
1161 \ifempty\m_syst_boxes_right\else
1162 right \m_syst_boxes_right
1163 \fi
1164 strip true
1165 sentinel {#3}
1166 text {#1}
1167 \relax}
1168
1169
1170
1171
1172
1173
1174
1175\permanent\protected\def\limitatefirstline#1#2#3
1176 {\hbox\bgroup\strut
1177 \setbox\scratchbox\hbox{\begstrut#1\endstrut}
1178 \ifdim\wd\scratchbox>#2\relax
1179 \setbox\scratchbox\hbox{#3}
1180 \hsize#2\relax
1181 \advance\hsize\wd\scratchbox
1182 \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}
1183 \setbox\scratchbox\vsplit\scratchbox to \lineheight
1184 \vbox
1185 {\unvbox\scratchbox
1186 \global\setbox\plusone\lastbox
1187 \global\setbox\plusone\hbox{\strut\unhbox\plusone}
1188 \hbox
1189 {\unless\ifdefined\clip
1190 \box\plusone
1191 \orelse\ifdim\wd\plusone>\hsize
1192 \lower\strutdepth\hpack{\clip[\c!width=\hsize,\c!height=\lineheight]{\hpack{\raise\strutdepth\box\plusone}}}
1193 \else
1194 \box\plusone
1195 \fi
1196 \removeunwantedspaces#3}}
1197 \else
1198 #1
1199 \fi
1200 \egroup}
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218\permanent\protected\def\processisolatedchars#1#2
1219 {\dontleavehmode
1220 \begingroup
1221 \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}
1222 \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}
1223 \clf_applytobox
1224 method {char}
1225 box \scratchbox
1226 command {\csstring#2}
1227 nested true
1228 \relax
1229 \endgroup}
1230
1231\permanent\protected\def\processisolatedwords#1#2
1232 {\dontleavehmode
1233 \begingroup
1234 \setbox\scratchbox\hbox{\settrialtypesetting#2{\savecurrentattributes{pic}}}
1235 \setbox\scratchbox\hbox{\restorecurrentattributes{pic}#1}
1236 \clf_applytobox
1237 method {word}
1238 box \scratchbox
1239 command {\csstring#2}
1240 nested true
1241 \relax
1242 \endgroup}
1243
1244
1245
1246\permanent\protected\def\applytocharacters#1
1247 {\dontleavehmode
1248 \dowithnextbox{\clf_applytobox
1249 method {char}
1250 box \nextbox
1251 command {\csstring#1}
1252 nested true
1253 \relax}
1254 \hbox}
1255
1256\permanent\protected\def\applytowords#1
1257 {\dontleavehmode
1258 \dowithnextbox{\clf_applytobox
1259 method {word}
1260 box \nextbox
1261 command {\csstring#1}
1262 nested true
1263 \relax}
1264 \hbox}
1265
1266
1267
1268\permanent\protected\def\processwords#1
1269 {\processisolatedwords{#1}\processword}
1270
1271\mutable\let\processword\relax
1272
1273\permanent\protected\def\applytosplitstringchar#1#2
1274 {\dontleavehmode\clf_processsplit
1275 data {#2}
1276 command {\csstring#1}
1277 method {char}
1278 \relax}
1279
1280\permanent\protected\def\applytosplitstringword#1#2
1281 {\dontleavehmode\clf_processsplit
1282 data {#2}
1283 command {\csstring#1}
1284 method {word}
1285 \relax}
1286
1287\permanent\protected\def\applytosplitstringline#1#2
1288 {\dontleavehmode\clf_processsplit
1289 data {#2}
1290 command {\csstring#1}
1291 method {line}
1292 \relax}
1293
1294\permanent\protected\def\applytosplitstringcharspaced#1#2
1295 {\dontleavehmode\clf_processsplit
1296 data {#2}
1297 command {\csstring#1}
1298 method {char}
1299 spaced true
1300 \relax}
1301
1302\permanent\protected\def\applytosplitstringwordspaced#1#2
1303 {\dontleavehmode\clf_processsplit
1304 data {#2}
1305 command {\csstring#1}
1306 method {word}
1307 spaced true
1308 \relax}
1309
1310\permanent\protected\def\applytosplitstringlinespaced#1#2
1311 {\dontleavehmode\clf_processsplit
1312 data {#2}
1313 command {\csstring#1}
1314 method {line}
1315 spaced true
1316 \relax}
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343\permanent\protected\def\sbox
1344 {\vpack\bgroup
1345 \dowithnextboxcs\syst_boxes_sbox_finish\vbox}
1346
1347\def\syst_boxes_sbox_finish
1348 {\boxyoffset\nextbox\strutdp
1349 \dp\nextbox\strutdp
1350 \ht\nextbox\strutht
1351 \box\nextbox
1352 \egroup}
1353
1354
1355
1356
1357
1358
1359
1360\permanent\protected\def\inlinedbox
1361 {\bgroup
1362 \dowithnextboxcs\syst_boxes_inlined_finish\hbox}
1363
1364\def\syst_boxes_inlined_finish
1365 {\boxyoffset\nextbox\dimexpr(\htdp\nextbox\lineheight)\plustwo\strutdp\relax
1366 \ht\nextbox\strutht
1367 \dp\nextbox\strutdp
1368 \box\nextbox
1369 \egroup}
1370
1371
1372
1373
1374
1375
1376\permanent\protected\def\struttedbox
1377 {\hpack\bgroup
1378 \dowithnextboxcs\syst_boxes_struttedbox_finish\hbox}
1379
1380\def\syst_boxes_struttedbox_finish
1381 {\dp\nextbox\strutdepth
1382 \ht\nextbox\strutheight
1383 \box\nextbox
1384 \egroup}
1385
1386
1387
1388
1389
1390
1391
1392\permanent\protected\def\topskippedbox
1393 {\hpack\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
1394
1395\def\syst_boxes_topskippedbox_finish
1396 {\edef\m_boxes_tmp{\ifdim\strutdepth=\dp\nextbox\dp\nextbox\the\dp\nextbox\fi}
1397 \lower\topskip\hpack{\raise\strutheight\box\nextbox}
1398 \m_boxes_tmp
1399 \egroup}
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444\permanent\protected\def\centeredbox#1#
1445 {\bgroup
1446 \dontcomplain
1447 \forgetall
1448 \scangivendimensions#1\relax
1449 \advance\vsize\givenheight
1450 \advance\hsize\givenwidth
1451 \dowithnextboxcs\syst_boxes_centered_finish
1452 \hbox}
1453
1454\def\syst_boxes_centered_finish
1455 {\boxxoffset\nextbox.5\dimexpr
1456 \hsize
1457 \wd\nextbox
1458 \givenwidth
1459 \relax
1460 \boxyoffset\nextbox.5\dimexpr
1461 \vsize
1462 \ht\nextbox
1463 \dp\nextbox
1464 \givenheight
1465 \relax
1466 \wd\nextbox\dimexpr\hsize\givenwidth \relax
1467 \ht\nextbox\dimexpr\vsize\givenheight\relax
1468 \dp\nextbox\zeropoint
1469 \box\nextbox
1470 \egroup}
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481\permanent\protected\def\centerednextbox#1#
1482 {\bgroup
1483 \dowithnextbox
1484 {\hsize\wd\nextbox
1485 \vsize\ht\nextbox
1486 \centeredbox#1{\box\nextbox}
1487 \egroup}
1488 \hbox}
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502\permanent\protected\def\centerbox#1#
1503 {\bgroup
1504 \dowithnextbox
1505 {\setlocalhsize
1506 \setbox\scratchbox\hpack{\vrule\s!width \zeropoint#1}
1507 \ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi
1508 \setbox\scratchbox\vpack{\hrule\s!height\zeropoint#1}
1509 \ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi
1510 \vpack to \vsize{\vss\hpack to \hsize{\hss\box\nextbox\hss}\vss}
1511 \egroup}
1512 \hbox}
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528\newif\ifalignrigidcolumns
1529\newif\ifstretchrigidcolumns
1530\newif\iftightrigidcolumns
1531
1532\mutable\let\rigidcolumnlines\!!zerocount
1533
1534\newbox \rigidcolumnbox
1535\newdimen\rigidhsize
1536\newcount\rigidcolumns
1537
1538\permanent\protected\def\setrigidcolumnhsize#1#2#3
1539 {\global\rigidhsize\hsize
1540 \global\rigidcolumns#3\relax
1541 \hsize#1\relax
1542 \scratchdimen #2\relax
1543 \multiply\scratchdimen #3\relax
1544 \advance\scratchdimen #2\relax
1545 \advance\hsize \scratchdimen
1546 \divide\hsize #3\relax}
1547
1548
1549
1550
1551
1552
1553
1554
1555\permanent\protected\def\rigidcolumnbalance#1
1556 {\ifnum\rigidcolumns=1
1557 \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
1558 \else
1559 \vbox
1560 {\forgetall
1561 \nopenalties
1562 \dontcomplain
1563 \setbox\rigidcolumnbox\vbox
1564 {\line{}\goodbreak\unvbox#1\removebottomthings}
1565 \splittopskip\openstrutheight
1566 \setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
1567 \ifcase\rigidcolumnlines\relax
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578 \scratchdimen\ht\rigidcolumnbox
1579 \divide\scratchdimen \rigidcolumns
1580 \getnoflines\scratchdimen
1581
1582 \else
1583 \noflines\rigidcolumnlines
1584 \fi
1585 \scratchdimen\noflines\lineheight
1586
1587
1588
1589 \setbox0=\box\rigidcolumnbox
1590 \doloop
1591 {\setbox\rigidcolumnbox=\copy0
1592 \setbox\scratchbox\hpack to \rigidhsize
1593 {\dorecurse\rigidcolumns
1594 {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
1595 \dp\scratchbox\openstrutdepth
1596 \setbox\scratchbox\vtop
1597 \ifalignrigidcolumns to
1598 \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
1599 \fi
1600 {\unvbox\scratchbox}
1601 \wd\scratchbox\hsize
1602 \box\scratchbox
1603 \hfill}
1604 \hfillneg}
1605 \ifvoid\rigidcolumnbox\exitloop\else\advance\scratchdimen\lineheight\fi}
1606 \iftightrigidcolumns
1607 \setbox\scratchbox\hpack{\raise\dp\scratchbox\box\scratchbox}
1608 \else
1609 \advance\scratchdimen \openstrutdepth
1610 \setbox\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}
1611 \dp\scratchbox\openstrutdepth
1612 \ht\scratchbox\scratchdimen
1613 \fi
1614 \box\scratchbox}
1615 \fi}
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640\newdimen\vboxtohboxslack
1641\newdimen\hboxestohboxslack
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678\newbox\d_syst_boxes_separator
1679
1680\permanent\protected\def\startvboxtohboxseparator
1681 {\setbox\d_syst_boxes_separator\hbox attr \vboxtohboxseparatorattribute\plusone\bgroup}
1682
1683\permanent\protected\def\stopvboxtohboxseparator
1684 {\egroup}
1685
1686\permanent\protected\def\startvboxtohbox
1687 {\begingroup
1688 \setbox\scratchbox\hbox\bgroup}
1689
1690\permanent\protected\def\stopvboxtohbox
1691 {\ifvoid\d_syst_boxes_separator
1692 \hskip\zeropoint\ifcase\vboxtohboxslack\else\s!minus\vboxtohboxslack\fi
1693 \else
1694 \box\d_syst_boxes_separator
1695 \fi
1696 \egroup
1697 \clf_hboxtovbox\scratchbox
1698 \box\scratchbox
1699 \endgroup}
1700
1701
1702
1703\permanent\protected\def\convertvboxtohbox
1704 {\makehboxofhboxes
1705 \setbox\scratchboxone\hpack{\unhbox\scratchboxone\removehboxes}
1706 \noindent\unhbox\scratchboxone\par}
1707
1708\permanent\protected\def\makehboxofhboxes
1709 {\setbox\scratchboxone\emptyhbox
1710 \loop
1711 \setbox\scratchboxtwo\lastbox
1712 \ifhbox\scratchboxtwo
1713 \setbox\scratchboxone\hpack{\box\scratchboxtwo\unhbox\scratchboxone}
1714 \repeat}
1715
1716\permanent\protected\def\removehboxes
1717 {\setbox\scratchboxone\lastbox
1718 \ifhbox\scratchboxone
1719 {\removehboxes}\unhbox\scratchboxone
1720 \fi}
1721
1722
1723
1724\permanent\protected\def\starthboxestohbox
1725 {\bgroup
1726 \setbox\scratchbox\vbox\bgroup}
1727
1728\permanent\protected\def\stophboxestohbox
1729 {\egroup
1730 \clf_vboxlisttohbox\scratchbox\nextbox\dimexpr\hboxestohboxslack\relax
1731 \dontleavehmode
1732 \unhbox\nextbox
1733 \removeunwantedspaces
1734 \par
1735 \egroup}
1736
1737
1738
1739
1740
1741
1742
1743\newbox \unhhedbox
1744\newbox \hhbox
1745\newdimen \lasthhboxwidth
1746\newskip \hhboxindent
1747
1748\permanent\protected\def\unhhbox#1\with#2
1749 {\bgroup
1750 \nopenalties
1751 \dontcomplain
1752 \forgetall
1753 \setbox\unhhedbox\vbox{\hskip\hhboxindent\strut\unhbox#1}
1754 \doloop
1755 {\setbox\hhbox\vsplit\unhhedbox to \lineheight
1756 \ifvoid\unhhedbox
1757 \setbox\hhbox\hbox{\strut\hboxofvbox\hhbox}
1758 \fi
1759 \ht\hhbox\strutht
1760 \dp\hhbox\strutdp
1761 \ifzeropt\hhboxindent\else
1762 \setbox\hhbox\hpack{\kern\hhboxindent\box\hhbox}
1763 \hhboxindent\zeropoint
1764 \fi
1765 \global\lasthhboxwidth\wd\hhbox
1766 #2\relax
1767 \ifvoid\unhhedbox
1768 \exitloop
1769 \else
1770 \hskip\zeropoint \s!plus \zeropoint
1771 \fi}
1772 \egroup}
1773
1774\def\syst_boxes_hboxofvbox
1775 {\setbox0\vpack{\unvbox\scratchcounter\global\setbox1\lastbox}
1776 \unhbox1
1777 \egroup}
1778
1779\permanent\protected\def\hboxofvbox
1780 {\bgroup
1781 \afterassignment\syst_boxes_hboxofvbox
1782 \scratchcounter=}
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822\permanent\protected\def\doifcontent#1#2#3
1823 {\dowithnextbox
1824 {\ifhbox\nextbox
1825 \ifdim\wd\nextbox>\zeropoint
1826 #1\unhbox\nextbox#2\relax
1827 \else
1828 #3\relax
1829 \fi
1830 \else
1831 \ifdim\ht\nextbox>\zeropoint
1832 #1\unvbox\nextbox#2\relax
1833 \else
1834 #3\relax
1835 \fi
1836 \fi}}
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863\newbox\processbox
1864
1865\let\syst_boxes_process_indeed\relax
1866
1867\permanent\protected\def\processboxes#1
1868 {\bgroup
1869 \def\syst_boxes_process_indeed{#1}
1870 \setbox\processbox\emptybox
1871 \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
1872
1873\def\syst_boxes_process_yes
1874 {\dowithnextboxcs\syst_boxes_process_content\hbox}
1875
1876\def\syst_boxes_process_content
1877 {\removeunwantedspaces
1878 \syst_boxes_process_indeed
1879 \doifelsenextbgroup\syst_boxes_process_yes\syst_boxes_process_nop}
1880
1881\protected\def\syst_boxes_process_nop
1882 {\removeunwantedspaces
1883 \box\processbox
1884 \egroup}
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905\permanent\def\boxisempty#1
1906 {\ifdim\wd#1=\zeropoint
1907 \ifdim\ht#1=\zeropoint
1908 \ifdim\dp#1=\zeropoint
1909 \zerocount
1910 \else
1911 \plusone
1912 \fi
1913 \else
1914 \plusone
1915 \fi
1916 \else
1917 \plusone
1918 \fi}
1919
1920\def\syst_boxes_overlay_process
1921 {\ifcase\boxisempty\nextbox\else
1922 \syst_boxes_overlay_process_indeed
1923 \fi}
1924
1925\def\syst_boxes_overlay_process_indeed
1926 {
1927 \scratchdepth\dp\ifdim\dp\nextbox>\dp\processbox\nextbox\else\processbox\fi
1928 \ifdim\ht\nextbox>\ht\processbox
1929 \setbox\processbox\vpack to \ht\nextbox {\dp\processbox\zeropoint\vss\box\processbox\vss}
1930 \else
1931 \setbox\nextbox \vpack to \ht\processbox{\dp\nextbox \zeropoint\vss\box\nextbox \vss}
1932 \fi
1933 \dp\nextbox \scratchdepth
1934 \dp\processbox\scratchdepth
1935 \scratchwidth\wd\ifdim\wd\nextbox>\wd\processbox\nextbox\else\processbox\fi
1936 \setbox\processbox\hpack to \scratchwidth
1937 {\hpack to \scratchwidth{\hss\box\processbox\hss}
1938 \kern\scratchwidth
1939 \hpack to \scratchwidth{\hss\box\nextbox \hss}}}
1940
1941\permanent\protected\def\startoverlay
1942 {\bgroup
1943 \enforced\aliased\let\stopoverlay\egroup
1944 \processboxes\syst_boxes_overlay_process}
1945
1946\permanent\protected\lettonothing\stopoverlay
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959\permanent\protected\def\fakebox
1960 {\bgroup
1961 \afterassignment\syst_boxes_fakebox_finish\scratchcounter}
1962
1963\def\syst_boxes_fakebox_finish
1964 {\setbox\scratchbox\ifhbox\scratchcounter\emptyhbox\else\emptyvbox\fi
1965 \wd\scratchbox\wd\scratchcounter
1966 \ht\scratchbox\ht\scratchcounter
1967 \dp\scratchbox\dp\scratchcounter
1968 \box\scratchbox
1969 \egroup}
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986\def\syst_boxes_lrc_process#1
1987 {\bgroup
1988 \forgetall
1989 \enforced\let\\\endgraf
1990 #1
1991 \let\nexttoken}
1992
1993\permanent\protected\def\lbox#1#{\vbox#1\syst_boxes_lrc_process\raggedleft }
1994\permanent\protected\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
1995\permanent\protected\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
1996
1997\permanent\protected\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
1998\permanent\protected\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
1999\permanent\protected\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021\permanent\protected\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
2022\permanent\protected\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
2023
2024\def\syst_boxes_tbox_finish
2025 {\scratchheight\ht\strutbox
2026 \scratchdepth\dimexpr\htdp\nextbox\scratchheight\relax
2027 \ht\nextbox\scratchheight
2028 \dp\nextbox\scratchdepth
2029 \boxyoffset\nextbox\scratchdepth
2030 \box\nextbox
2031 \egroup}
2032
2033\def\syst_boxes_bbox_finish
2034 {\scratchdepth\dp\strutbox
2035 \scratchheight\dimexpr\htdp\nextbox\scratchdepth\relax
2036 \dp\nextbox\scratchdepth
2037 \ht\nextbox\scratchheight
2038 \boxyoffset\nextbox\scratchdepth
2039 \box\nextbox
2040 \egroup}
2041
2042
2043
2044
2045
2046
2047\def\syst_boxes_lhbox{\hpack to \hsize{\box\nextbox\hss }}
2048\def\syst_boxes_mhbox{\hpack to \hsize{\hss\box\nextbox\hss}}
2049\def\syst_boxes_rhbox{\hpack to \hsize{\hss\box\nextbox }}
2050
2051\permanent\protected\def\lhbox{\dowithnextboxcs\syst_boxes_lhbox\hbox}
2052\permanent\protected\def\mhbox{\dowithnextboxcs\syst_boxes_mhbox\hbox}
2053\permanent\protected\def\rhbox{\dowithnextboxcs\syst_boxes_rhbox\hbox}
2054
2055\aliased\let\lefthbox \lhbox
2056\aliased\let\midhbox \mhbox
2057\aliased\let\righthbox\rhbox
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072\newdimen\sizeofbox
2073
2074\permanent\protected\def\boxofsize#1
2075 {\bgroup
2076 \sizeofbox\zeropoint
2077 \scratchdimen\zeropoint
2078 \def\docommand
2079 {\advance\sizeofbox\scratchdimen
2080 \futurelet\nexttoken\dodocommand}
2081 \def\dodocommand
2082 {\ifx\nexttoken\bgroup
2083 \expanded{\egroup#1 to \the\sizeofbox}
2084 \else
2085 \expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen
2086 \fi}
2087 \docommand}
2088
2089
2090
2091
2092
2093
2094
2095
2096\permanent\protected\def\limitatelines#1#2
2097 {\dowithnextbox
2098 {\scratchdimen#1\hsize
2099 \ifdim\wd\nextbox>\scratchdimen
2100 \setbox\nextbox\hbox
2101 {\advance\scratchdimen .1\hsize
2102 \limitatetext{\unhbox\nextbox}{\scratchdimen}{\nobreak#2}}
2103 \fi
2104 \unhbox\nextbox}
2105 \hbox}
2106
2107\permanent\protected\def\fittoptobaselinegrid
2108 {\dowithnextbox
2109 {\bgroup
2110 \par
2111 \scratchdimen\ht\nextbox
2112 \ht\nextbox\strutht
2113 \dp\nextbox\strutdp
2114 \hpack{\box\nextbox}
2115 \prevdepth\strutdp
2116 \doloop
2117 {\advance\scratchdimen \lineheight
2118 \ifdim\scratchdimen<\zeropoint
2119 \exitloop
2120 \else
2121 \nobreak
2122 \hpack{\strut}
2123 \fi}
2124 \egroup}
2125 \vbox}
2126
2127
2128
2129\newif\iftraceboxplacement
2130
2131\newbox\fakedboxcursor
2132
2133\setbox\fakedboxcursor\hpack
2134 {\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
2135
2136\permanent\protected\def\boxcursor
2137 {\iftraceboxplacement
2138 \bgroup
2139 \scratchdimen2\onepoint
2140 \setbox\scratchbox\hpack to \zeropoint
2141 {\hss
2142 \vrule
2143 \s!width \scratchdimen
2144 \s!height\scratchdimen
2145 \s!depth \scratchdimen
2146 \hss}
2147 \smashedbox\scratchbox
2148 \egroup
2149 \else
2150 \copy\fakedboxcursor
2151 \fi}
2152
2153\permanent\protected\def\placedbox
2154 {\iftraceboxplacement\ruledhbox\else\hbox\fi}
2155
2156\newdimen\boxoffset
2157\newdimen\boxhdisplacement
2158\newdimen\boxvdisplacement
2159
2160\permanent\protected\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
2161\permanent\protected\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
2162\permanent\protected\def\topbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_topbox_finish \placedbox}
2163\permanent\protected\def\bottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_bottombox_finish \placedbox}
2164\permanent\protected\def\lefttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_lefttopbox_finish \placedbox}
2165\permanent\protected\def\righttopbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_righttopbox_finish \placedbox}
2166\permanent\protected\def\leftbottombox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbottombox_finish \placedbox}
2167\permanent\protected\def\rightbottombox{\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbottombox_finish\placedbox}
2168
2169\aliased\let\topleftbox \lefttopbox
2170\aliased\let\toprightbox \righttopbox
2171\aliased\let\bottomleftbox \leftbottombox
2172\aliased\let\bottomrightbox\rightbottombox
2173
2174\def\syst_boxes_rightbox_finish
2175 {\global\boxhdisplacement\boxoffset
2176 \global\boxvdisplacement.5\dimexpr\ht\nextbox\dp\nextbox\relax
2177 \boxcursor
2178 \boxxmove\nextbox \boxhdisplacement
2179 \boxymove\nextbox\boxvdisplacement
2180 \box\nextbox
2181 \egroup}
2182
2183\def\syst_boxes_leftbox_finish
2184 {\global\boxhdisplacement\dimexpr\wd\nextbox\boxoffset\relax
2185 \global\boxvdisplacement.5\dimexpr\ht\nextbox\dp\nextbox\relax
2186 \boxcursor
2187 \boxxmove\nextbox \boxhdisplacement
2188 \boxymove\nextbox\boxvdisplacement
2189 \box\nextbox
2190 \egroup}
2191
2192\def\syst_boxes_topbox_finish
2193 {\global\boxhdisplacement.5\wd\nextbox
2194 \global\boxvdisplacement\dimexpr\dp\nextbox\boxoffset\relax
2195 \boxcursor
2196 \boxxmove\nextbox \boxhdisplacement
2197 \boxymove\nextbox\boxvdisplacement
2198 \box\nextbox
2199 \egroup}
2200
2201\def\syst_boxes_bottombox_finish
2202 {\global\boxhdisplacement.5\wd\nextbox
2203 \global\boxvdisplacement\dimexpr\ht\nextbox\boxoffset\relax
2204 \boxcursor
2205 \boxxmove\nextbox \boxhdisplacement
2206 \boxymove\nextbox\boxvdisplacement
2207 \box\nextbox
2208 \egroup}
2209
2210\def\syst_boxes_lefttopbox_finish
2211 {\global\boxhdisplacement\dimexpr\wd\nextbox\boxoffset\relax
2212 \global\boxvdisplacement\dimexpr\dp\nextbox\boxoffset\relax
2213 \boxcursor
2214 \boxxmove\nextbox \boxhdisplacement
2215 \boxymove\nextbox\boxvdisplacement
2216 \box\nextbox
2217 \egroup}
2218
2219\def\syst_boxes_righttopbox_finish
2220 {\global\boxhdisplacement\boxoffset
2221 \global\boxvdisplacement\dimexpr\dp\nextbox\boxoffset\relax
2222 \boxcursor
2223 \boxxmove\nextbox \boxhdisplacement
2224 \boxymove\nextbox\boxvdisplacement
2225 \box\nextbox
2226 \egroup}
2227
2228\def\syst_boxes_leftbottombox_finish
2229 {\global\boxhdisplacement\dimexpr\wd\nextbox\boxoffset\relax
2230 \global\boxvdisplacement\dimexpr\ht\nextbox\boxoffset\relax
2231 \boxcursor
2232 \boxxmove\nextbox \boxhdisplacement
2233 \boxymove\nextbox\boxvdisplacement
2234 \box\nextbox
2235 \egroup}
2236
2237\def\syst_boxes_rightbottombox_finish
2238 {\global\boxhdisplacement\boxoffset
2239 \global\boxvdisplacement\dimexpr\ht\nextbox\boxoffset\relax
2240 \boxcursor
2241 \boxxmove\nextbox \boxhdisplacement
2242 \boxymove\nextbox\boxvdisplacement
2243 \box\nextbox
2244 \egroup}
2245
2246\permanent\protected\def\middlebox {\hpack\bgroup\dowithnextboxcs\syst_boxes_middlebox_finish \placedbox}
2247\permanent\protected\def\baselinemiddlebox{\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinemiddlebox_finish\placedbox}
2248\permanent\protected\def\baselineleftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselineleftbox_finish \placedbox}
2249\permanent\protected\def\baselinerightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_baselinerightbox_finish \placedbox}
2250
2251\def\syst_boxes_middlebox_finish
2252 {\global\boxhdisplacement.5\wd\nextbox
2253 \global\boxvdisplacement.5\dimexpr\ht\nextbox\dp\nextbox\relax
2254 \boxcursor
2255 \boxxmove\nextbox \boxhdisplacement
2256 \boxymove\nextbox\boxvdisplacement
2257 \box\nextbox
2258 \egroup}
2259
2260\def\syst_boxes_baselinemiddlebox_finish
2261 {\global\boxhdisplacement\dimexpr.5\wd\nextbox\boxoffset\relax
2262 \global\boxvdisplacement\boxoffset
2263 \boxcursor
2264 \boxxmove\nextbox \boxhdisplacement
2265 \boxymove\nextbox\boxvdisplacement
2266 \box\nextbox
2267 \egroup}
2268
2269\def\syst_boxes_baselineleftbox_finish
2270 {\global\boxhdisplacement\dimexpr\wd\nextbox\boxoffset\relax
2271 \global\boxvdisplacement\boxoffset
2272 \boxcursor
2273 \boxxmove\nextbox \boxhdisplacement
2274 \boxymove\nextbox\boxvdisplacement
2275 \box\nextbox
2276 \egroup}
2277
2278\def\syst_boxes_baselinerightbox_finish
2279 {\global\boxhdisplacement\boxoffset
2280 \global\boxvdisplacement\boxoffset
2281 \boxcursor
2282 \boxxmove\nextbox \boxhdisplacement
2283 \boxymove\nextbox\boxvdisplacement
2284 \box\nextbox
2285 \egroup}
2286
2287
2288
2289
2290
2291
2292\permanent\protected\def\lrtbbox#1#2#3#4
2293 {\bgroup
2294 \dowithnextboxcontent
2295 {\advance\hsize#1\advance\hsize#2\relax
2296 \advance\vsize#3\advance\vsize#4\relax}
2297 {\forgetall\vpack to \vsize{\vskip#3\hpack to \hsize{\hskip#1\box\nextbox\hss}\vss}\egroup}
2298 \vbox}
2299
2300
2301
2302
2303
2304
2305\permanent\protected\def\toplinebox
2306 {\dowithnextboxcs\syst_boxes_toplinebox_finish\tbox}
2307
2308\def\syst_boxes_toplinebox_finish
2309 {\ifdim\dp\nextbox>\strutdepth
2310 \scratchdimen\dp\nextbox
2311 \advance\scratchdimen\strutdepth
2312 \getnoflines\scratchdimen
2313 \struttedbox{\box\nextbox}
2314 \dorecurse\noflines\verticalstrut
2315 \else
2316 \box\nextbox
2317 \fi}
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341\installcorenamespace {stackbox}
2342\installcorenamespace {stacklst}
2343
2344\permanent\protected\def\setstackbox#1#2
2345 {\ifcsname\??stackbox#1:#2\endcsname\else
2346 \expandafter\newbox\csname\??stackbox#1:#2\endcsname
2347 \fi
2348 \global\setbox\csname\??stackbox#1:#2\endcsname\vbox}
2349
2350\permanent\protected\def\initializeboxstack#1
2351 {\def\docommand##1{\setstackbox{#1}{##1}{}}
2352 \ifcsname\??stacklst#1\endcsname
2353 \expandafter\processcommacommand\expandafter[\lastnamedcs]\docommand
2354 \fi
2355 \gletcsname\??stacklst#1\endcsname\empty}
2356
2357\permanent\protected\def\savebox#1#2
2358 {
2359 \ifcsname\??stacklst#1\endcsname
2360 \xdefcsname\??stacklst#1\expandafter\endcsname\expandafter{\lastnamedcs,#2}
2361 \else
2362 \xdefcsname\??stacklst#1\endcsname{#2}
2363 \fi
2364 \setstackbox{#1}{#2}}
2365
2366\permanent\protected\def\flushbox#1#2
2367 {\ifcsname\??stackbox#1:#2\endcsname
2368 \box\lastnamedcs
2369 \else
2370 \emptybox
2371 \fi}
2372
2373\permanent\protected\def\restorebox#1#2
2374 {\ifcsname\??stackbox#1:#2\endcsname
2375 \copy\lastnamedcs
2376 \else
2377 \emptybox
2378 \fi}
2379
2380\permanent\protected\def\foundbox#1#2
2381 {\vpack
2382 {\ifcsname\??stackbox#1:#2\endcsname
2383 \copy\lastnamedcs
2384 \fi}}
2385
2386\permanent\protected\def\doifelsebox#1#2
2387 {\unless\ifcsname\??stackbox#1:#2\endcsname
2388 \expandafter\secondoftwoarguments
2389 \orelse\ifvoid\lastnamedcs
2390 \expandafter\secondoftwoarguments
2391 \else
2392 \expandafter\firstoftwoarguments
2393 \fi}
2394
2395\aliased\let\doifboxelse\doifelsebox
2396
2397
2398
2399\installcorenamespace {boxstack}
2400
2401\newcount\c_syst_boxes_stack
2402
2403\mutable\let\b_syst_boxes_stack\relax
2404
2405\protected\def\syst_boxes_stack_allocate
2406 {\newbox\b_syst_boxes_stack
2407 \letcsname\??boxstack\number\c_syst_boxes_stack\endcsname\b_syst_boxes_stack}
2408
2409\protected\def\syst_boxes_push#1#2
2410 {\global\advance\c_syst_boxes_stack\plusone
2411 \expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\number\c_syst_boxes_stack\endcsname
2412 \ifrelax\b_syst_boxes_stack
2413 \syst_boxes_stack_allocate
2414 \fi
2415 #1\setbox\b_syst_boxes_stack\box#2\relax}
2416
2417\protected\def\syst_boxes_pop#1#2
2418 {#1\setbox#2\box\csname\??boxstack\number\c_syst_boxes_stack\endcsname
2419 \global\advance\c_syst_boxes_stack\minusone}
2420
2421\permanent\protected\def\localpushbox {\syst_boxes_push\relax}
2422\permanent\protected\def\localpopbox {\syst_boxes_pop \relax}
2423
2424\permanent\protected\def\globalpushbox{\syst_boxes_push\global}
2425\permanent\protected\def\globalpopbox {\syst_boxes_pop \global}
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462\permanent\protected\def\removedepth
2463 {\ifvmode
2464 \ifdim\prevdepth>\zeropoint
2465 \kern\prevdepth
2466 \fi
2467 \fi}
2468
2469\permanent\protected\def\obeydepth
2470 {\par
2471 \ifvmode\ifdim\prevdepth<\zeropoint\orelse\ifdim\prevdepth<\strutdp
2472 \kern\dimexpr\strutdp\prevdepth\relax
2473 \prevdepth\strutdp
2474 \fi\fi}
2475
2476\permanent\protected\def\undepthed
2477 {\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\hbox}
2478
2479
2480
2481
2482
2483
2484\permanent\protected\def\removebottomthings
2485 {\dorecurse\plusfive{\unskip\unkern\unpenalty}}
2486
2487\permanent\protected\def\removelastskip
2488 {\ifvmode\ifzeropt\lastskip\else\vskip\lastskip\fi\fi}
2489
2490
2491
2492
2493
2494
2495
2496\permanent\protected\def\makestrutofbox
2497 {\afterassignment\syst_boxes_makestrutofbox\c_boxes_register}
2498
2499\def\syst_boxes_makestrutofbox
2500 {\ht\c_boxes_register\strutht
2501 \dp\c_boxes_register\strutdp
2502 \wd\c_boxes_register\zeropoint}
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515\permanent\protected\def\raisebox#1{\bgroup\afterassignment\syst_boxes_raise_indeed\scratchdimen#1}
2516\permanent\protected\def\lowerbox#1{\bgroup\afterassignment\syst_boxes_lower_indeed\scratchdimen#1}
2517
2518\def\syst_boxes_raise_indeed{\dowithnextboxcs\syst_boxes_raise_finish}
2519\def\syst_boxes_lower_indeed{\dowithnextboxcs\syst_boxes_lower_finish}
2520
2521\def\syst_boxes_raise_finish
2522 {\boxyoffset\nextbox\scratchdimen
2523 \ht\nextbox\strutht
2524 \dp\nextbox\strutdp
2525 \box\nextbox
2526 \egroup}
2527
2528\def\syst_boxes_lower_finish
2529 {\boxyoffset\nextbox\scratchdimen
2530 \ht\nextbox\strutht
2531 \dp\nextbox\strutdp
2532 \box\nextbox
2533 \egroup}
2534
2535
2536
2537\permanent\protected\def\halfwaybox
2538 {\hpack\bgroup
2539 \dowithnextboxcs\syst_boxes_halfwaybox_finish\hbox}
2540
2541\def\syst_boxes_halfwaybox_finish
2542 {\dp\nextbox\zeropoint
2543 \lower.5\ht\nextbox\box\nextbox
2544 \egroup}
2545
2546\permanent\protected\def\depthonlybox
2547 {\tpack\bgroup
2548 \dowithnextboxcs\syst_boxes_depthonlybox_finish\vbox}
2549
2550\def\syst_boxes_depthonlybox_finish
2551 {\hsize\wd\nextbox
2552 \kern\zeropoint\box\nextbox
2553 \egroup}
2554
2555
2556
2557\permanent\def\setdimentoatleast#1#2{\ifdim#1>\zeropoint\else#1=#2\fi}
2558\permanent\def\setdimentoatmost #1#2{\ifdim#1>#2\relax \else#1=#2\fi}
2559
2560
2561
2562\aliased\let\naturalvcenter\normalvtop
2563
2564
2565
2566
2567
2568
2569
2570
2571\permanent\protected\def\frozenhbox
2572 {\hpack\bgroup
2573 \dowithnextboxcs\syst_boxes_frozenhbox_finish\hbox}
2574
2575\def\syst_boxes_frozenhbox_finish
2576 {\hpack{\hpack{\box\nextbox}}
2577 \egroup}
2578
2579
2580
2581
2582
2583
2584\installcorenamespace {boxx}
2585\installcorenamespace {boxy}
2586
2587\permanent\protected\def\setboxllx #1#2{\edefcsname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
2588\permanent\protected\def\setboxlly #1#2{\edefcsname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
2589
2590\permanent\protected\def\gsetboxllx#1#2{\xdefcsname\??box_x\number#1\endcsname{\the\dimexpr#2\relax}}
2591\permanent\protected\def\gsetboxlly#1#2{\xdefcsname\??box_y\number#1\endcsname{\the\dimexpr#2\relax}}
2592
2593\permanent\def\getboxllx#1{\ifcsname\??box_x\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
2594\permanent\def\getboxlly#1{\ifcsname\??box_y\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
2595
2596\permanent\def\directgetboxllx#1{\csname\??box_x\number#1\endcsname}
2597\permanent\def\directgetboxlly#1{\csname\??box_y\number#1\endcsname}
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612\permanent\protected\def\shownextbox
2613 {\dowithnextbox
2614 {\bgroup
2615 \showboxbreadth\maxcount
2616 \showboxdepth \maxcount
2617 \scratchcounter\interactionmode
2618 \batchmode
2619 \showbox\nextbox
2620 \box\nextbox
2621 \interactionmode\scratchcounter
2622 \egroup}}
2623
2624\permanent\protected\def\spreadhbox#1
2625 {\bgroup
2626 \ifhbox#1\relax
2627 \setbox\scratchboxtwo\emptybox
2628 \unhbox#1
2629 \doloop
2630 {\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip
2631 \setbox\scratchboxone\lastbox
2632 \ifvoid\scratchboxone
2633 \exitloop
2634 \else
2635 \setbox\scratchboxtwo\hbox
2636 {\ifhbox\scratchboxone \spreadhbox\scratchboxone\else\box\scratchboxone\fi
2637 \ifvoid\scratchboxtwo \else\hss\unhbox\scratchboxtwo\fi}
2638 \fi}
2639 \ifvoid\scratchboxtwo\else\unhbox\scratchboxtwo\fi
2640 \else
2641 \box#1
2642 \fi
2643 \egroup}
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654\permanent\protected\def\minimalhbox#1#
2655 {\dowithnextbox
2656 {\bgroup
2657 \setbox\scratchbox\hpack#1{\hss}
2658 \ifdim\wd\nextbox<\wd\scratchbox\wd\nextbox\wd\scratchbox\fi
2659 \box\nextbox
2660 \egroup}
2661 \hbox}
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678\def\syst_boxes_contenttostring
2679 {\normalexpanded{\endgroup\endlocalcontrol\boxtostring\nextbox}}
2680
2681\permanent\def\contenttostring
2682 {\beginlocalcontrol\begingroup
2683 \dowithnextboxcs\syst_boxes_contenttostring\hbox}
2684
2685\newtoks \everypreroll
2686\newif \ifprerolling
2687
2688\appendtoks
2689 \prerollingtrue
2690\to \everypreroll
2691
2692\let\prerolltostring\firstofoneargument
2693
2694\appendtoks
2695 \permanent\def\prerolltostring
2696 {\beginlocalcontrol\begingroup
2697 \the\everypreroll
2698 \dowithnextboxcs\syst_boxes_contenttostring\hbox}
2699\to \everydump
2700
2701
2702
2703\permanent\protected\def\nodestostring#1#2
2704 {\edef#2{\contenttostring{#1}}}
2705
2706
2707
2708\aliased\let\hyphenatedhbox\hbox
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722\newdimen\lastnaturalboxwd
2723\newdimen\lastnaturalboxht
2724\newdimen\lastnaturalboxdp
2725
2726
2727
2728\aliased\let\getnaturaldimensions\clf_getnaturaldimensions
2729\aliased\let\naturalwd \clf_naturalwd
2730
2731\aliased\let\getnaturalwd\clf_getnaturalwd
2732\aliased\let\setnaturalwd\clf_setnaturalwd
2733
2734\permanent\protected\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
2735
2736\aliased\let\doifrighttoleftinboxelse\doifelserighttoleftinbox
2737
2738
2739
2740\definesystemattribute [runningtext] [public]
2741
2742\permanent\protected\def\runninghbox{\hbox attr \runningtextattribute \fontid\font}
2743
2744
2745
2746\permanent\protected\def\beginhbox{\hbox\bgroup} \aliased\let\endhbox\egroup
2747\permanent\protected\def\beginvbox{\vbox\bgroup} \aliased\let\endvbox\egroup
2748\permanent\protected\def\beginvtop{\vtop\bgroup} \aliased\let\endvtop\egroup
2749
2750\permanent\protected\def\sethboxregister#1{\setbox#1\hbox}
2751\permanent\protected\def\setvboxregister#1{\setbox#1\vbox}
2752\permanent\protected\def\setvtopregister#1{\setbox#1\vtop}
2753
2754\permanent\protected\def\flushboxregister#1{\box\numexpr#1\relax}
2755
2756\permanent\protected\def\starthboxregister#1{\setbox#1\hbox\bgroup} \aliased\let\stophboxregister\egroup
2757\permanent\protected\def\startvboxregister#1{\setbox#1\vbox\bgroup} \aliased\let\stopvboxregister\egroup
2758\permanent\protected\def\startvtopregister#1{\setbox#1\vtop\bgroup} \aliased\let\stopvtopregister\egroup
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786\permanent\protected\def\lastlinewidth{\dimexpr\clf_lastlinewidth\scaledpoint\relax}
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796\permanent\protected\def\shiftbox {\clf_shiftbox}
2797\permanent\protected\def\vpackbox {\clf_vpackbox}
2798\permanent\protected\def\hpackbox {\clf_hpackbox}
2799\permanent\protected\def\vpackedbox{\clf_vpackedbox}
2800\permanent\protected\def\hpackedbox{\clf_hpackedbox}
2801
2802
2803
2804
2805\permanent\protected\def\linebox
2806 {\hpack\bgroup\dowithnextbox
2807 {\scratchdimen\dimexpr\dimexpr\htdp\nextbox\lineheight\relax2\dp\strutbox\relax
2808 \setbox\nextbox\hpack{\lower\scratchdimen\box\nextbox}
2809 \ht\nextbox\ht\strutbox
2810 \dp\nextbox\dp\strutbox
2811 \box\nextbox
2812 \egroup}
2813 \hbox}
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
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
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891\untraced\permanent\protected\def\showboxhere{\showbox nolevels content online }
2892
2893\protect \endinput
2894
2895
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 |