1
2
3
4
5
6
7
8
9
10
11
12
13
14\endinput
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77\writestatus{loading}{ConTeXt Support Macros Visualization}
78
79
80
81
82
83
84
85
86
87\unprotect
88
89\let\visualvrule\vrule
90\let\visualhrule\hrule
91
92
93
94
95
96
97
98
99
100\protected\def\dontinterfere
101 {\reseteverypar
102 \parindent\zeropoint
103 \parskip \zeropoint
104 \leftskip \zeropoint
105 \rightskip\zeropoint
106 \relax}
107
108
109
110
111
112
113
114
115\ifdefined\dontcomplain \else
116
117 \protected\def\dontcomplain
118 {\hbadness\plustenthousand
119 \vbadness\plustenthousand
120 \hfuzz \maxdimen
121 \vfuzz \maxdimen}
122
123\fi
124
125
126
127
128
129
130
131\ifdefined\normaloffinterlineskip \else
132 \let\normaloffinterlineskip\offinterlineskip
133\fi
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168\let\normalhglue\hglue
169\let\normalvglue\vglue
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190\def\hfilneg {\normalhskip\zeropoint\s!plus1\s!fil\relax}
191\def\vfilneg {\normalvskip\zeropoint\s!plus1\s!fil\relax}
192\def\hfillneg {\normalhskip\zeropoint\s!plus1\s!fill\relax}
193\def\vfillneg {\normalvskip\zeropoint\s!plus1\s!fill\relax}
194\def\hfilllneg{\normalhskip\zeropoint\s!plus1\s!filll\relax}
195\def\vfilllneg{\normalvskip\zeropoint\s!plus1\s!filll\relax}
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215\let\normalhfillneg\hfillneg
216\let\normalvfillneg\vfillneg
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258\newif\ifbaselinerule\baselineruletrue
259\newif\ifbaselinefill\baselinefillfalse
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275\newif\iftoprule \topruletrue
276\newif\ifbottomrule\bottomruletrue
277\newif\ifleftrule \leftruletrue
278\newif\ifrightrule \rightruletrue
279
280
281
282
283
284
285
286
287
288
289
290
291\newdimen \boxrulewidth \boxrulewidth=.2pt
292
293\newdimen \boxruleht
294\newdimen \boxruledp
295\newdimen \boxrulewd
296
297\newbox \boxrulescratchbox
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317\let\dowithruledbox\relax
318
319\protected\def\makeruledbox#1
320 {\boxruleht\ht#1
321 \boxruledp\dp#1
322 \boxrulewd\wd#1
323 \setbox\boxrulescratchbox\normalvbox
324 {\dontcomplain
325 \normaloffinterlineskip
326 \visualhrule
327 \s!height\boxrulewidth
328 \iftoprule\else\s!width\zeropoint\fi
329 \normalvskip\boxrulewidth
330 \normalhbox to \boxrulewd
331 {\visualvrule
332 \s!height\boxruleht
333 \s!depth \boxruledp
334 \s!width \ifleftrule\boxrulewidth\else\zeropoint\fi
335 \ifdim\boxruleht>\zeropoint \else \baselinerulefalse \fi
336 \ifdim\boxruledp>\zeropoint \else \baselinerulefalse \fi
337 \ifbaselinerule
338 \ifdim\boxrulewd<20\boxrulewidth
339 \baselinefilltrue
340 \fi
341 \cleaders
342 \ifbaselinefill
343 \visualhrule
344 \s!height\boxrulewidth
345 \else
346 \normalhbox
347 {\normalhskip2.5\boxrulewidth
348 \visualvrule
349 \s!height\boxrulewidth
350 \s!width5\boxrulewidth
351 \normalhskip2.5\boxrulewidth}
352 \fi
353 \fi
354 \normalhfill
355 \visualvrule
356 \s!width\ifrightrule\boxrulewidth\else\zeropoint\fi}
357 \normalvskip\boxrulewidth
358 \visualhrule
359 \s!height\boxrulewidth
360 \ifbottomrule\else\s!width\zeropoint\fi}
361 \wd#1\zeropoint
362 \setbox#1=\ifhbox#1\normalhbox\else\normalvbox\fi
363 {\normalhbox
364 {\box#1
365 \lower\boxruledp\normalhbox{\dowithruledbox{\box\boxrulescratchbox}}}}
366 \ht#1\boxruleht
367 \wd#1\boxrulewd
368 \dp#1\boxruledp}
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400\protected\def\ruledhbox
401 {\normalhbox\bgroup
402 \dowithnextboxcs\supp_visualizers_hbox_finish\normalhbox}
403
404\def\supp_visualizers_hbox_finish
405 {\makeruledbox\nextbox
406 \box\nextbox
407 \egroup}
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422\protected\def\ruledvbox
423 {\normalvbox\bgroup
424 \dowithnextboxcs\supp_visualizers_vbox_finish\normalvbox}
425
426\def\supp_visualizers_vbox_finish
427 {\makeruledbox\nextbox
428 \box\nextbox
429 \egroup}
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444\protected\def\ruledvtop
445 {\normalvtop\bgroup
446 \dowithnextboxcs\supp_visualizers_vtop_finish\normalvtop}
447
448\def\supp_visualizers_vtop_finish
449 {\makeruledbox\nextbox
450 \box\nextbox
451 \egroup}
452
453
454
455
456
457
458
459
460
461
462
463
464
465\protected\def\ruledvcenter
466 {\normalvbox\bgroup
467 \dontinterfere
468 \dowithnextboxcs\supp_visualizers_vcenter_finish\normalvbox}
469
470\def\supp_visualizers_vcenter_finish
471 {\scratchdimen.5\dimexpr\ht\nextbox\dp\nextbox\relax
472 \ht\nextbox\scratchdimen
473 \dp\nextbox\scratchdimen
474
475 \makeruledbox\nextbox
476 \box\nextbox
477 \egroup}
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\protected\def\ruledbox
503 {\dowithnextboxcs\supp_visualizers_box_finish}
504
505\def\supp_visualizers_box_finish
506 {\makeruledbox\nextbox\box\nextbox}
507
508
509
510
511\def\setruledbox#1=
512 {\afterassignment\supp_visualizers_setruledbox_indeed\scratchcounter}
513
514\def\supp_visualizers_setruledbox_indeed
515 {\dowithnextboxcs\supp_visualizers_setruledbox_finish}
516
517\def\supp_visualizers_setruledbox_finish
518 {\makeruledbox\nextbox
519 \setbox\scratchcounter\nextbox}
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553\newif\ifflexible
554\newif\ifzero
555\newif\ifnegative
556\newif\ifpositive
557
558\def\investigateskip#1
559 {\relax
560 \ifdim#1=\zeropoint
561 \ifdim\gluestretch#1=\zeropoint
562 \ifdim\glueshrink#1=\zeropoint
563 \flexiblefalse
564 \else
565 \flexibletrue
566 \fi
567 \else
568 \flexibletrue
569 \fi
570 \else
571 \flexibletrue
572 \fi
573 \ifdim#1=\zeropoint\relax
574 \zerotrue \else
575 \zerofalse \fi
576 \ifdim#1<\zeropoint\relax
577 \positivefalse \else
578 \positivetrue \fi
579 \ifdim#1>\zeropoint\relax
580 \negativefalse \else
581 \negativetrue \fi}
582
583\def\investigatecount#1
584 {\relax
585 \flexiblefalse
586 \ifnum#1=\zerocount
587 \zerotrue \else
588 \zerofalse \fi
589 \ifnum#1<\zerocount
590 \positivefalse \else
591 \positivetrue \fi
592 \ifnum#1>\zerocount
593 \negativefalse \else
594 \negativetrue \fi}
595
596\def\investigatemuskip#1
597 {\relax
598 \edef\!!stringa{\the#1}
599 \edef\!!stringb{0mu}
600 \def\!!stringc##1##2\\{##1}
601 \expandafter\edef\expandafter\!!stringc\expandafter
602 {\expandafter\!!stringc\!!stringa\\}
603 \edef\!!stringd{}
604 \flexiblefalse
605 \ifx\!!stringa\!!stringb
606 \zerotrue
607 \negativefalse
608 \positivefalse
609 \else
610 \zerofalse
611 \ifx\!!stringc\!!stringd
612 \positivefalse
613 \negativetrue
614 \else
615 \positivetrue
616 \negativefalse
617 \fi
618 \fi}
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650\newif\ifcenteredvcue \centeredvcuefalse
651
652\def\normalvcue#1
653 {\normalhbox \ifcenteredvcue to \hsize \fi {\normalhss#1\normalhss}}
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711\newdimen\testrulewidth \testrulewidth=\boxrulewidth
712\newif\ifvisiblestretch \visiblestretchfalse
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727\def\setvisiblehfilbox#1\to#2#3#4
728 {\setbox#1\normalhbox
729 {\visualvrule
730 \s!width #2\testrulewidth
731 \s!height#3\testrulewidth
732 \s!depth #4\testrulewidth}
733 \smashbox#1}
734
735\def\doruledhfiller#1#2#3#4
736 {#1#2
737 \bgroup
738 \dontinterfere
739 \dontcomplain
740 \setvisiblehfilbox0\to{4}{#3}{#4}
741 \setvisiblehfilbox2\to422
742 \copy0\copy2
743 \bgroup
744 \setvisiblehfilbox0\to422
745 \cleaders
746 \normalhbox to 12\testrulewidth
747 {\normalhss\copy0\normalhss}
748 #1
749 \egroup
750 \setbox0\normalhbox
751 {\normalhskip4\testrulewidth\copy0\copy2}
752 \smashbox0
753 \box0
754 \egroup}
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814\protected\def\ruledhss {\doruledhfiller\normalhss \normalhfilneg {0}{0}}
815\protected\def\ruledhfil {\doruledhfiller\normalhfil \normalhfilneg {10}{6}}
816\protected\def\ruledhfill {\doruledhfiller\normalhfill \normalhfillneg{18}{14}}
817\protected\def\ruledhfilneg {\doruledhfiller\normalhfilneg \normalhfil {6}{10}}
818\protected\def\ruledhfillneg{\doruledhfiller\normalhfillneg\normalhfill {14}{18}}
819
820
821
822
823
824
825
826
827
828\def\setvisiblevfilbox#1\to#2#3#4
829 {\setbox#1\normalhbox
830 {\visualvrule
831 \s!width #2\testrulewidth
832 \s!height#3\testrulewidth
833 \s!depth #4\testrulewidth}
834 \smashbox#1}
835
836\def\doruledvfiller#1#2#3
837 {#1#2
838 \bgroup
839 \dontinterfere
840 \dontcomplain
841 \normaloffinterlineskip
842 \setvisiblevfilbox0\to422
843 \setbox2\normalvcue
844 {\normalhskip #3\testrulewidth\copy0}
845 \smashbox2
846 \copy2
847 \bgroup
848 \setbox2\normalvcue
849 {\normalhskip 2\testrulewidth\copy0}
850 \smashbox2
851 \copy2
852 \cleaders
853 \normalvbox to 12\testrulewidth
854 {\normalvss\copy2\normalvss}
855 #1
856 \setbox2\normalvbox
857 {\normalvskip2\testrulewidth\copy2}
858 \smashbox2
859 \box2
860 \egroup
861 \box2
862 \egroup}
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892\protected\def\ruledvss {\doruledvfiller\normalvss \normalvfilneg {2}}
893\protected\def\ruledvfil {\doruledvfiller\normalvfil \normalvfilneg {4}}
894\protected\def\ruledvfill {\doruledvfiller\normalvfill \normalvfillneg{12}}
895\protected\def\ruledvfilneg {\doruledvfiller\normalvfilneg \normalvfil {8}}
896\protected\def\ruledvfillneg{\doruledvfiller\normalvfillneg\normalvfill {16}}
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935\def\supp_visualizers_hskip_indeed
936 {\relax
937 \dontinterfere
938 \dontcomplain
939 \investigateskip\scratchskip
940 \ifzero
941 \setbox0\normalhbox
942 {\normalhskip\testrulewidth
943 \visualvrule
944 \s!width4\testrulewidth
945 \s!height16\testrulewidth
946 \s!depth16\testrulewidth}
947 \else
948 \setbox0\normalhbox to \ifnegative\fi\scratchskip
949 {\visualvrule
950 \s!width2\testrulewidth
951 \ifnegative\s!depth\else\s!height\fi16\testrulewidth
952 \cleaders
953 \visualhrule
954 \ifnegative
955 \s!depth2\testrulewidth
956 \s!height\zeropoint
957 \else
958 \s!height2\testrulewidth
959 \s!depth\zeropoint
960 \fi
961 \normalhfill
962 \ifflexible
963 \normalhskip\ifnegative\else\fi\scratchskip
964 \normalhskip2\testrulewidth
965 \cleaders
966 \normalhbox
967 {\normalhskip 2\testrulewidth
968 \visualvrule
969 \s!width2\testrulewidth
970 \s!height\ifnegative7\else9\fi\testrulewidth
971 \s!depth\ifnegative9\else7\fi\testrulewidth
972 \normalhskip 2\testrulewidth}
973 \normalhfill
974 \fi
975 \visualvrule
976 \s!width2\testrulewidth
977 \ifnegative\s!depth\else\s!height\fi16\testrulewidth}
978 \setbox0\normalhbox
979 {\ifnegative\else\normalhskip\scratchskip\fi
980 \box0}
981 \fi
982 \smashbox0
983 \ifvisiblestretch \else
984 \flexiblefalse
985 \fi
986 \ifflexible
987
988 \skip2\scratchskip
989 \advance\skip2 1\scratchskip
990 \divide\skip2 2
991 \advance\scratchskip \skip2
992 \normalhskip\scratchskip
993 \normalpenalty\plustenthousand
994 \box0
995 \normalhskip\skip2
996 \else
997 \normalhskip\scratchskip
998 \box0
999 \fi
1000 \egroup}
1001
1002\protected\def\ruledhskip
1003 {\bgroup
1004 \afterassignment\supp_visualizers_hskip_indeed
1005 \scratchskip=}
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
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
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071\def\dodoruledvskip
1072 {\nextdepth\prevdepth
1073 \dontinterfere
1074 \dontcomplain
1075 \normaloffinterlineskip
1076 \investigateskip\scratchskip
1077 \ifzero
1078 \setbox0\normalvcue
1079 {\visualvrule
1080 \s!width32\testrulewidth
1081 \s!height2\testrulewidth
1082 \s!depth2\testrulewidth}
1083 \else
1084 \setbox0\normalvbox to \ifnegative\fi\scratchskip
1085 {\visualhrule
1086 \s!width16\testrulewidth
1087 \s!height2\testrulewidth
1088 \ifflexible
1089 \cleaders
1090 \normalhbox to 16\testrulewidth
1091 {\normalhss
1092 \normalvbox
1093 {\normalvskip 2\testrulewidth
1094 \visualhrule
1095 \s!width2\testrulewidth
1096 \s!height2\testrulewidth
1097 \normalvskip 2\testrulewidth}
1098 \normalhss}
1099 \normalvfill
1100 \else
1101 \normalvfill
1102 \fi
1103 \visualhrule
1104 \s!width16\testrulewidth
1105 \s!height2\testrulewidth}
1106 \setbox2\normalvbox to \ht0
1107 {\visualhrule
1108 \s!width2\testrulewidth
1109 \s!height\ht0}
1110 \ifnegative
1111 \ht0\zeropoint
1112 \setbox0\normalhbox
1113 {\normalhskip2\testrulewidth
1114 \normalhskip\wd0\box0}
1115 \fi
1116 \smashbox0
1117 \smashbox2
1118 \setbox0\normalvcue
1119 {\box2\box0}
1120 \setbox0\normalvbox
1121 {\ifnegative\normalvskip\scratchskip\fi\box0}
1122 \smashbox0
1123 \fi
1124 \ifvisiblestretch
1125 \ifflexible
1126 \skip2\scratchskip
1127 \advance\skip2 1\scratchskip
1128 \divide\skip2 2
1129 \advance\scratchskip \skip2
1130 \normalvskip\skip2
1131 \fi
1132 \fi
1133 \normalpenalty\plustenthousand
1134 \box0
1135 \prevdepth\nextdepth
1136 \normalvskip\scratchskip}
1137
1138
1139
1140
1141\def\doruledvskip
1142 {\endgraf
1143 \ifdim\pagegoal=\maxdimen
1144 \ifinner
1145 \dodoruledvskip
1146 \fi
1147 \else
1148 \dodoruledvskip
1149 \fi
1150 \egroup}
1151
1152\protected\def\ruledvskip
1153 {\bgroup
1154 \afterassignment\doruledvskip
1155 \scratchskip=}
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187\def\supp_visualizers_hkern_indeed
1188 {\dontinterfere
1189 \dontcomplain
1190 \baselinerulefalse
1191 \investigateskip\scratchskip
1192 \boxrulewidth2\testrulewidth
1193 \ifzero
1194 \setbox0\ruledhbox to 8\testrulewidth
1195 {\visualvrule
1196 \s!width\zeropoint
1197 \s!height16\testrulewidth
1198 \s!depth16\testrulewidth}
1199 \setbox0\normalhbox
1200 {\normalhskip4\testrulewidth\box0}
1201 \else
1202 \setbox0\ruledhbox to \ifnegative\fi\scratchskip
1203 {\visualvrule
1204 \s!width\zeropoint
1205 \ifnegative\s!depth\else\s!height\fi16\testrulewidth
1206 \ifflexible
1207 \normalhskip2\testrulewidth
1208 \cleaders
1209 \normalhbox
1210 {\normalhskip 2\testrulewidth
1211 \visualvrule
1212 \s!width2\testrulewidth
1213 \s!height\ifnegative7\else9\fi\testrulewidth
1214 \s!depth\ifnegative9\else7\fi\testrulewidth
1215 \normalhskip 2\testrulewidth}
1216 \normalhfill
1217 \else
1218 \normalhfill
1219 \fi}
1220 \testrulewidth2\testrulewidth
1221 \setbox0\ruledhbox{\box0}
1222 \fi
1223 \smashbox0
1224 \normalpenalty\plustenthousand
1225 \normalhbox to \zeropoint
1226 {\ifnegative\normalhskip1\scratchskip\fi
1227 \box0}
1228 \afterwards\scratchskip
1229 \egroup}
1230
1231\protected\def\ruledhkern#1
1232 {\bgroup
1233 \let\afterwards#1
1234 \afterassignment\supp_visualizers_hkern_indeed
1235 \scratchskip=}
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261\def\supp_visualizers_vkern_finish
1262 {\nextdepth\prevdepth
1263 \dontinterfere
1264 \dontcomplain
1265 \baselinerulefalse
1266 \normaloffinterlineskip
1267 \investigateskip\scratchskip
1268 \boxrulewidth2\testrulewidth
1269 \ifzero
1270 \setbox0\ruledhbox to 32\testrulewidth
1271 {\visualvrule
1272 \s!width\zeropoint
1273 \s!height4\testrulewidth
1274 \s!depth4\testrulewidth}
1275 \else
1276 \setbox0\ruledvbox to \ifnegative\fi\scratchskip
1277 {\hsize16\testrulewidth
1278 \ifflexible
1279 \cleaders
1280 \normalhbox to 16\testrulewidth
1281 {\normalhss
1282 \normalvbox
1283 {\normalvskip 2\testrulewidth
1284 \visualhrule
1285 \s!width2\testrulewidth
1286 \s!height2\testrulewidth
1287 \normalvskip 2\testrulewidth}
1288 \normalhss}
1289 \normalvfill
1290 \else
1291 \visualvrule
1292 \s!width\zeropoint
1293 \s!height\ifnegative\fi\scratchskip
1294 \normalhfill
1295 \fi}
1296 \fi
1297 \testrulewidth2\testrulewidth
1298 \setbox0\ruledvbox{\box0}
1299 \smashbox0
1300 \setbox0\normalvbox
1301 {\ifnegative\normalvskip\scratchskip\fi
1302 \normalvcue
1303 {\ifnegative\normalhskip16\testrulewidth\fi\box0}}
1304 \smashbox0
1305 \normalpenalty\plustenthousand
1306 \box0
1307 \prevdepth\nextdepth}
1308
1309\def\supp_visualizers_vkern_indeed
1310 {\ifdim\pagegoal=\maxdimen
1311 \ifinner
1312 \supp_visualizers_vkern_finish
1313 \fi
1314 \else
1315 \supp_visualizers_vkern_finish
1316 \fi
1317 \afterwards\scratchskip
1318 \egroup}
1319
1320\protected\def\ruledvkern#1
1321 {\bgroup
1322 \let\afterwards#1\relax
1323 \afterassignment\supp_visualizers_vkern_indeed
1324 \scratchskip=}
1325
1326\protected\def\ruledkern
1327 {\ifvmode
1328 \expandafter\ruledvkern
1329 \else
1330 \expandafter\ruledhkern
1331 \fi
1332 \normalkern}
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364\def\supp_visualizers_hglue_indeed
1365 {\leavevmode
1366 \scratchcounter\spacefactor
1367 \visualvrule\s!width\zeropoint
1368 \normalpenalty\plustenthousand
1369 \ruledhkern\normalhskip\scratchskip
1370 \spacefactor\scratchcounter
1371 \egroup}
1372
1373\protected\def\ruledhglue
1374 {\bgroup
1375 \afterassignment\supp_visualizers_hglue_indeed\scratchskip=}
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394\def\supp_visualizers_vglue_indeed
1395 {\endgraf
1396 \nextdepth\prevdepth
1397 \visualhrule\s!height\zeropoint
1398 \normalpenalty\plustenthousand
1399 \ruledvkern\normalvskip\scratchskip
1400 \prevdepth\nextdepth
1401 \egroup}
1402
1403\protected\def\ruledvglue
1404 {\bgroup
1405 \afterassignment\supp_visualizers_vglue_indeed\scratchskip=}
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416\def\supp_visualizers_mkern_finish#1
1417 {\dontinterfere
1418 \dontcomplain
1419 \setbox\boxrulescratchbox\normalhbox
1420 {\normalstartimath
1421 \normalmkern\ifnegative\fi\scratchskip
1422 \normalstopimath}
1423 \setbox\boxrulescratchbox\normalhbox to \wd\boxrulescratchbox
1424 {\visualvrule
1425 \s!height16\testrulewidth
1426 \s!depth 16\testrulewidth
1427 \s!width \testrulewidth
1428 \leaders
1429 \visualhrule
1430 \s!height\ifpositive 16\else14\fi\testrulewidth
1431 \s!depth \ifpositive14\else 16\fi\testrulewidth
1432 \normalhfill
1433 \ifflexible
1434 \normalhskip\wd\boxrulescratchbox
1435 \leaders
1436 \visualhrule
1437 \s!height\testrulewidth
1438 \s!depth \testrulewidth
1439 \normalhfill
1440 \fi
1441 \visualvrule
1442 \s!height16\testrulewidth
1443 \s!depth 16\testrulewidth
1444 \s!width \testrulewidth}
1445 \smashbox0
1446 \ifnegative
1447 #1\scratchskip
1448 \box\boxrulescratchbox
1449 \else
1450 \box\boxrulescratchbox
1451 #1\scratchskip
1452 \fi
1453 \egroup}
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464\protected\def\ruledmkern
1465 {\bgroup
1466 \afterassignment\supp_visualizers_mkern_indeed
1467 \scratchmuskip=}
1468
1469\def\supp_visualizers_mkern_indeed
1470 {\investigatemuskip\scratchmuskip
1471 \flexiblefalse
1472 \supp_visualizers_mkern_finish\normalmkern}
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483\def\supp_visualizers_mskip_indeed
1484 {\investigatemuskip\scratchmuskip
1485 \flexibletrue
1486 \supp_visualizers_mkern_finish\normalmskip}
1487
1488\protected\def\ruledmskip
1489 {\bgroup
1490 \afterassignment\supp_visualizers_mskip_indeed
1491 \scratchmuskip=}
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561\def\supp_visualizers_penalty_box#1#2#3#4#5#6
1562 {\setbox#1\normalhbox
1563 {\ifnum#2=\zerocount \else
1564 \edef\sign{\ifnum#2>\zerocount \else\fi}
1565 \scratchdimen
1566 \ifnum\sign#2>9999 28\else
1567 \ifnum\sign#2>999 22\else
1568 \ifnum\sign#2>99 16\else
1569 \ifnum\sign#2>9 10\else
1570 4\fi\fi\fi\fi \testrulewidth
1571 \ifnum#2<\zerocount
1572 \normalhskip\scratchdimen
1573 \normalhskip2\testrulewidth
1574 \visualvrule
1575 \s!width 2\testrulewidth
1576 \s!height#3\testrulewidth
1577 \s!depth #4\testrulewidth
1578 \fi
1579 \visualvrule
1580 \s!width \scratchdimen
1581 \s!height#5\testrulewidth
1582 \s!depth #6\testrulewidth
1583 \ifnum#2>\zerocount
1584 \visualvrule
1585 \s!width 2\testrulewidth
1586 \s!height#3\testrulewidth
1587 \s!depth #4\testrulewidth
1588 \fi
1589 \fi}
1590 \smashbox#1}
1591
1592\protected\def\ruledhpenalty
1593 {\bgroup
1594 \afterassignment\supp_visualizers_hpenalty_indeed
1595 \scratchcounter=}
1596
1597\def\supp_visualizers_hpenalty_indeed
1598 {\dontinterfere
1599 \dontcomplain
1600 \investigatecount\scratchcounter
1601 \testrulewidth2\testrulewidth
1602 \boxrulewidth\testrulewidth
1603 \setbox0\ruledhbox to 8\testrulewidth
1604 {\ifnegative\else\normalhss\fi
1605 \visualvrule
1606 \s!depth8\testrulewidth
1607 \s!width\ifzero\zeropoint\else4\testrulewidth\fi
1608 \ifpositive\else\normalhss\fi}
1609 \supp_visualizers_penalty_box{2}{\scratchcounter}{0}{8}{3.5}{4.5}
1610 \normalpenalty\plustenthousand
1611 \setbox0\normalhbox
1612 {\normalhskip4\testrulewidth
1613 \ifnegative
1614 \box2\box0
1615 \else
1616 \box0\box2
1617 \fi}
1618 \smashbox0
1619 \box0
1620 \normalpenalty\scratchcounter
1621 \egroup}
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642\protected\def\ruledvpenalty
1643 {\bgroup
1644 \afterassignment\supp_visualizers_vpenalty_indeed
1645 \scratchcounter=}
1646
1647\def\supp_visualizers_vpenalty_indeed
1648 {\ifdim\pagegoal=\maxdimen \else
1649 \nextdepth\prevdepth
1650 \dontinterfere
1651 \dontcomplain
1652 \investigatecount\scratchcounter
1653 \testrulewidth2\testrulewidth
1654 \boxrulewidth\testrulewidth
1655 \setbox0\ruledhbox
1656 {\visualvrule
1657 \s!height4\testrulewidth
1658 \s!depth 4\testrulewidth
1659 \s!width \zeropoint
1660 \visualvrule
1661 \s!height\ifnegative.5\else4\fi\testrulewidth
1662 \!!dept \ifpositive.5\else4\fi\testrulewidth
1663 \s!width 8\testrulewidth}
1664 \supp_visualizers_penalty_box{2}{\scratchcounter}{4}{4}{.5}{.5}
1665 \setbox0\normalhbox
1666 {\normalhskip4\testrulewidth
1667 \ifnegative
1668 \box2\box0
1669 \else
1670 \box0\box2
1671 \fi
1672 \normalhss}
1673 \smashbox0
1674 \normalpenalty\plustenthousand
1675 \nointerlineskip
1676 \dp0\nextdepth
1677 \normalvbox
1678 {\normalvcue{\box0}}
1679 \fi
1680 \normalpenalty\scratchcounter
1681 \egroup}
1682
1683
1684
1685\protected\def\ruledpenalty
1686 {\ifvmode
1687 \expandafter\ruledvpenalty
1688 \else
1689 \expandafter\ruledhpenalty
1690 \fi}
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701\protected\def\showfils
1702 {\showingcompositiontrue
1703 \let\hss \ruledhss
1704 \let\hfil \ruledhfil
1705 \let\hfill \ruledhfill
1706 \let\hfilneg \ruledhfilneg
1707 \let\hfillneg \ruledhfillneg
1708 \let\vss \ruledvss
1709 \let\vfil \ruledvfil
1710 \let\vfill \ruledvfill
1711 \let\vfilneg \ruledvfilneg
1712 \let\vfillneg \ruledvfillneg}
1713
1714\protected\def\dontshowfils
1715 {\let\hss \normalhss
1716 \let\hfil \normalhfil
1717 \let\hfill \normalhfill
1718 \let\hfilneg \normalhfilneg
1719 \let\hfillneg \normalhfillneg
1720 \let\vss \normalvss
1721 \let\vfil \normalvfil
1722 \let\vfill \normalvfill
1723 \let\vfilneg \normalvfilneg
1724 \let\vfillneg \normalvfillneg}
1725
1726\protected\def\showboxes
1727 {\showingcompositiontrue
1728 \baselineruletrue
1729 \let\hbox \ruledhbox
1730 \let\vbox \ruledvbox
1731 \let\vtop \ruledvtop
1732 \let\vcenter \ruledvcenter}
1733
1734\protected\def\dontshowboxes
1735 {\let\hbox \normalhbox
1736 \let\vbox \normalvbox
1737 \let\vtop \normalvtop
1738 \let\vcenter \normalvcenter}
1739
1740\protected\def\showskips
1741 {\showingcompositiontrue
1742 \let\hskip \ruledhskip
1743 \let\vskip \ruledvskip
1744 \let\kern \ruledkern
1745 \let\mskip \ruledmskip
1746 \let\mkern \ruledmkern
1747 \let\hglue \ruledhglue
1748 \let\vglue \ruledvglue}
1749
1750\protected\def\dontshowskips
1751 {\let\hskip \normalhskip
1752 \let\vskip \normalvskip
1753 \let\kern \normalkern
1754 \let\mskip \normalmskip
1755 \let\mkern \normalmkern
1756 \let\hglue \normalhglue
1757 \let\vglue \normalvglue}
1758
1759\protected\def\showpenalties
1760 {\showingcompositiontrue
1761 \let\penalty \ruledpenalty}
1762
1763\protected\def\dontshowpenalties
1764 {\let\penalty \normalpenalty}
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788\newif\ifshowingcomposition
1789
1790\protected\def\showcomposition
1791 {\ifshowingcomposition
1792 \showfils
1793 \showboxes
1794 \showskips
1795 \showpenalties
1796 \fi}
1797
1798\protected\def\dontshowcomposition
1799 {\ifshowingcomposition
1800 \dontshowfils
1801 \dontshowboxes
1802 \dontshowskips
1803 \dontshowpenalties
1804 \fi}
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826\ifx\bodyfontsize\undefined
1827 \edef\defaulttestrulewidth{\the\testrulewidth}
1828\else
1829 \def\defaulttestrulewidth{.02\bodyfontsize}
1830\fi
1831
1832\protected\def\showmakeup
1833 {\testrulewidth\defaulttestrulewidth
1834 \showingcompositiontrue
1835 \showcomposition}
1836
1837\protect
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
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873\endinput
1874 |