forked from latex3/latex2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathltboxes.dtx
1426 lines (1426 loc) · 43.7 KB
/
ltboxes.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%
% Copyright (C) 1993-2022
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% The list of all files belonging to the LaTeX base distribution is
% given in the file `manifest.txt'. See also `legal.txt' for additional
% information.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the unpacking scripts (with
% extension .ins) which are part of the distribution.
%
% \fi
%
% \iffalse
%%% From File: ltboxes.dtx
%
%<*driver>
% \fi
\ProvidesFile{ltboxes.dtx}
[2022/01/31 v1.4c LaTeX Kernel (Box Commands)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltboxes.dtx}
\title{\filename}
\date{\filedate}
\author{David Carlisle\and
Leslie Lamport\and
Frank Mittelbach\and
Chris Rowley}
\begin{document}
\MaintainedByLaTeXTeam{latex}
\maketitle
\DocInput{\filename}
\end{document}
%</driver>
% \fi
%
%
% \changes{v1.1e}{1998/08/17}{(RmS) Minor Documentation fixes.}
% \changes{v1.3b}{2019/08/27}{Various commands made robust}
%
%
%
% \section{\LaTeX\ Box commands}
%
%
% \DescribeMacro\makebox
% |\makebox[|\meta{wid}|][|\meta{pos}|]{|\meta{obj}|}|\\
% Puts \meta{obj} in an |\hbox| of width \meta{wid}, positioned by
% \meta{pos}.
%
% The possible \meta{pos} are:\\
% \begin{tabular}{ll}
% |s| stretched,\\
% |l| flushleft,\\
% |r| flushright,\\
% |c| (default) centred.
% \end{tabular}
%
% If \meta{wid} is missing, then \meta{pos} is also missing and
% \meta{obj} is put in an |\hbox| of its natural width.
%
% |\makebox(|\meta{x}|,|\meta{y}|)[|\meta{pos}|]{|\meta{obj}|}|\\
% Puts \meta{obj} in an |\hbox| of width $x * |\unitlength|$
% and height $y * |\unitlength|$.
% \meta{pos} arguments are
% |s|, |l|, |r| or |c| (default) for stretched, flushleft, flushright
% or centred, and |t| or |b|
% for top, bottom -- or combinations like |tr| or |rb|.
% Default for horizontal and vertical are centered.
% Note that in this picture mode version of |\makebox| a [b] aligns on
% the \emph{bottom} of the text as documented. If you want to align on
% the \emph{baseline} use
% |\makebox( , )[b]{\raisebox{0pt}[\height][0pt]{xyz}}}|
% or |\makebox( , )[b]{\smash{xyz}}|
%
% \DescribeMacro\mbox
% |\mbox{|\meta{obj}|}| The same as |\makebox{|\meta{obj}|}|, but is
% more efficient as no checking for optional arguments is done.
%
% \DescribeMacro\newsavebox
% |\newsavebox{\cmd}| : If |\cmd| is undefined, then defines it
% to be a \TeX\ box register.
%
% \DescribeMacro\savebox
% |\savebox{\cmd}| ... : |\cmd| is defined to be a \TeX\ box register,
% and the '...' are any |\makebox| arguments. It is
% like |\makebox|, except it doesn't produce text but
% saves the value in |\box| |\cmd|.
%
% \DescribeMacro\sbox
% |\sbox{|\meta{cmd}|}{|\meta{obj}|}| is an efficient abbreviation for\\
% |\savebox{|\meta{cmd}|}{|\meta{obj}|}|.
%
% \DescribeEnv{lrbox}
% |\begin{lrbox}{|\meta{cmd}|}|\meta{text}|\end{lrbox}| is equivalent
% to\\
% |\sbox{|\meta{cmd}|}{|\meta{text}|}|\\
% except that any white space at the beginning and end of \meta{text}
% is ignored.
%
% \DescribeMacro\framebox
% |\framebox| ... : like |\makebox|, except it puts a `frame' around
% the box. The frame is made of lines of thickness
% |\fboxrule|, separated by space |\fboxsep| from the
% text -- except for |\framebox(X,Y)| ... , where the
% thickness of the lines is as for the picture environment,
% and there is no separation added.
%
% \DescribeMacro\fbox
% |\fbox{|\meta{obj}|}| is an abbreviation for
% |\framebox{|\meta{obj}|}|.
%
% \DescribeMacro\parbox
% |\parbox[|\meta{pos}|][|\meta{height}|][|\meta{inner-pos}|]{|^^A
% \meta{width}|}{|\meta{text}|}| :
% Makes a box with |\hsize| \meta{width}, positioned by \meta{pos} as
% follows:
% c : |\vcenter| (placed in |$...$| if not in math mode)
% b : |\vbox|
% t : |\vtop|
% default value is c.
% Sets |\hsize| := \meta{width} and calls |\@parboxrestore|, which
% does the following:
% Restores the original definitions of:
%
% \begin{tabular}{l}
% |\par|\\
% |\\|\\
% |\-|\\
% |\'|\\
% | \`|\\
% |\=|
% \end{tabular}
%
% Resets the following parameters:
%
% \begin{tabular}{l@{\quad=\quad}ll}
% |\parindent| & 0pt \\
% |\parskip| & 0pt & added 20 Jan 87\\
% |\linewidth| & |\hsize|\\
% |\@totalleftmargin| & 0pt\\
% |\leftskip| & 0pt\\
% |\rightskip| & 0pt\\
% |\@rightskip| & 0pt\\
% |\parfillskip| & 0pt plus 1fil\\
% |\lineskip| & |\normallineskip|\\
% |\baselineskip| & |\normalbaselineskip|
% \end{tabular}
%
% Calls |\sloppy|
%
% Note: |\@arrayparboxrestore| same as |\@parboxrestore|
% but it doesn't restore |\\|.
%
% \DescribeEnv{minipage}
% |minipage| : Similar to |\parbox|, except it also
% makes this look like a page by setting
%
% |\textwidth| == |\columnwidth| == box width
%
% changes footnotes by redefining:\\%
% |\@mpfn| == mpfootnote \\
% |\thempfn| == |\thempfootnote|\\
% |\@footnotetext| == |\@mpfootnotetext|
%
% resets the following list environment parameters:\\
% |\@listdepth| == |\@mplistdepth|\\
% where |\@mplistdepth| is initialized to zero,
%
% and executes |\@minipagerestore| to allow the document
% style to reset any other parameters it desires.
% It sets |@minipage| true, and resets |\everypar| to set
% it false. This switch keeps |\addvspace| from putting space
% at the top of a minipage.
%
% Change added 24 May 89: |\minipage| sets |@minipage| globally;
% |\endminipage| resets it false.
%
%
% \DescribeMacro\rule
% |\rule[|\meta{raised}|]{|\meta{width}|}{|\meta{height}|}| :
% Makes a $\meta{width}*\meta{height}$ rule, raised \meta{raised}.
%
% \DescribeMacro\underline
% |\underline{|\meta{text}|}| : Makes an underlined hbox with
% \meta{text} in it.
%
% \DescribeMacro\raisebox
% |\raisebox{|\meta{distance}|}[|\meta{height}|][|\meta{depth}^^A
% |]{|\meta{box}|}| :\\
% Raises \meta{box} up by \meta{distance} length (down if
% \meta{distance} negative). Makes \TeX\ think that the new box extends
% \meta{height} above the line and \meta{depth} below, for a total
% vertical length of \meta{height}+\meta{depth}. Default values of
% \meta{height} \& \meta{depth} = actual height and depth of box in new
% position.
%
% \MaybeStop{}
%
% \changes{v0.1e}{1994/03/02}{Remove need for drv file}
% \changes{v0.1e}{1994/03/02}{Add 2ekernel module}
% \changes{v1.0a}{1994/03/07}{Unify format with other Kernel files}
% \changes{v1.0f}{1994/05/11}
% {Superfluous braces removed from several commands}
% \changes{v1.0j}{1994/10/18}
% {stuff from ltpatch done}
% \changes{v1.0p}{1994/11/09}
% {more color changes\ldots}
% \changes{v1.0q}{1994/11/17}
% {\cs{@tempa} to \cs{reserved@a}}
% \changes{v1.0t}{1995/05/07}{Use \cs{hb@xt@}}
% \changes{v1.0w}{1995/10/16}{Clarify makebox description}
% \begin{macrocode}
%<*2ekernel>
\message{boxes,}
% \end{macrocode}
%
% \begin{macro}{\makebox}
% \changes{v0.1a}{1993/12/03}
% {modified}
% |\makebox| User level command just looks for optional |[| or |(|.
% \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2015/01/01}%
%<latexrelease> {\makebox}{Make \makebox robust}%
%<*2ekernel|latexrelease>
\DeclareRobustCommand\makebox{%
\leavevmode
\@ifnextchar(%)
\@makepicbox
{\@ifnextchar[\@makebox\mbox}}%
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\makebox}{Make \makebox robust}%
%<latexrelease>\def\makebox{%
%<latexrelease> \leavevmode
%<latexrelease> \@ifnextchar(%)
%<latexrelease> \@makepicbox
%<latexrelease> {\@ifnextchar[\@makebox\mbox}}%
%<latexrelease>\expandafter\let\csname makebox \endcsname\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mbox}
% \changes{v0.1a}{1993/12/03}
% {extra group}
% \changes{v1.0j}{1994/10/18}
% {\cs{long} added}
% The basic horizontal box command for \LaTeX.
% \begin{macrocode}
\DeclareRobustCommand\mbox[1]{\leavevmode\hbox{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@makebox}
% \changes{v0.1a}{1993/12/03}
% {default changed from x to c}
% Look for a possible second optional argument (defaults to |c|).
% \begin{macrocode}
\def\@makebox[#1]{%
\@ifnextchar [{\@imakebox[#1]}{\@imakebox[#1][c]}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@begin@tempboxa}
% \changes{v0.1a}{1993/12/03}
% {macro added}
% \changes{v0.1b}{1993/12/08}
% {Extra braces for color support
% (braces removed from other macros)}
% \changes{v1.0f}{1994/05/11}
% {Use new \cs{color@setgroup} concept.}
% Helper macro for supporting |\height|, |\width| etc. Grab |#1| into
% |\@tempboxa| and measure it.
% \begin{macrocode}
\long\def\@begin@tempboxa#1#2{%
\begingroup
\setbox\@tempboxa#1{\color@begingroup#2\color@endgroup}%
\def\width{\wd\@tempboxa}%
\def\height{\ht\@tempboxa}%
\def\depth{\dp\@tempboxa}%
\let\totalheight\@ovri
\totalheight\height
\advance\totalheight\depth}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@end@tempboxa}
% \changes{v0.1a}{1993/12/03}
% {macro added}
% End the group started by |\@begin@tempboxa|, so that the scope of
% |\height| only includes the `length' argument to the user-command.
% \begin{macrocode}
\let\@end@tempboxa\endgroup
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bm@c}
% \begin{macro}{\bm@l}
% \begin{macro}{\bm@r}
% \begin{macro}{\bm@s}
% \begin{macro}{\bm@t}
% \begin{macro}{\bm@b}
% \changes{v0.1a}{1993/12/03}
% {macros added}
% Set up spacing.
% \begin{macrocode}
\def\bm@c{\hss\unhbox\@tempboxa\hss}
\def\bm@l{\unhbox\@tempboxa\hss}\let\bm@t\bm@l
\def\bm@r{\hss\unhbox\@tempboxa}\let\bm@b\bm@r
\def\bm@s{\unhbox\@tempboxa}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@imakebox}
% \changes{v0.1a}{1993/12/03}
% {macro modified}
% Internal form of |\makebox|.
% \begin{macrocode}
\long\def\@imakebox[#1][#2]#3{%
\@begin@tempboxa\hbox{#3}%
\setlength\@tempdima{#1}% support calc
\hb@xt@\@tempdima{\csname bm@#2\endcsname}%
\@end@tempboxa}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@makepicbox}
% \changes{v0.1a}{1993/12/03}
% {macro modified}
% Picture mode form of |\makebox|.
% \begin{macrocode}
\def\@makepicbox(#1,#2){%
\@ifnextchar[{\@imakepicbox(#1,#2)}{\@imakepicbox(#1,#2)[]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@imakepicbox}
% picture mode version
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease> {\@imakepicbox}{default units}%
\long\def\@imakepicbox(#1,#2)[#3]#4{%
\@defaultunitsset\@tempdimc{#2}\unitlength
\vbox to\@tempdimc
{\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss
\let\mb@t\vss
\@tfor\reserved@a :=#3\do{%
\if s\reserved@a
\let\mb@l\relax\let\mb@r\relax
\else
\expandafter\let\csname mb@\reserved@a\endcsname\relax
\fi}%
\mb@t
\@defaultunitsset\@tempdimc{#1}\unitlength
\hb@xt@\@tempdimc{\mb@l #4\mb@r}%
\mb@b
% \end{macrocode}
% This kern ensures that a |b| option aligns on the bottom of the
% text rather than the baseline. this is the documented behaviour in
% the \LaTeX\ Book. The kern is removed in compatibility mode.
% \begin{macrocode}
\kern\z@}}
%</2ekernel|latexrelease>
% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\@imakepicbox}{default units}%
%<latexrelease>\long\def\@imakepicbox(#1,#2)[#3]#4{%
%<latexrelease> \vbox to#2\unitlength
%<latexrelease> {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss
%<latexrelease> \let\mb@t\vss
%<latexrelease> \@tfor\reserved@a :=#3\do{%
%<latexrelease> \if s\reserved@a
%<latexrelease> \let\mb@l\relax\let\mb@r\relax
%<latexrelease> \else
%<latexrelease> \expandafter\let\csname mb@\reserved@a\endcsname\relax
%<latexrelease> \fi}%
%<latexrelease> \mb@t
%<latexrelease> \hb@xt@ #1\unitlength{\mb@l #4\mb@r}%
%<latexrelease> \mb@b
%<latexrelease> \kern\z@}}
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\set@color}
% \changes{v0.1a}{1993/12/03}
% {macro added}
% \changes{v0.1a}{1993/12/03}
% {color support}
% This macro is initially a no-op, but the color package will redefine
% it to insert a |\special|.
% \begin{macrocode}
\let\set@color\relax
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\color@begingroup}
% \changes{v1.0b}{1994/03/14}
% {macro added for color support}
% \begin{macro}{\color@endgroup}
% \changes{v1.0b}{1994/03/14}
% {macro added for color support}
% \begin{macro}{\color@setgroup}
% \changes{v1.0f}{1994/05/11}
% {macro added for color support}
% \begin{macro}{\normalcolor}
% \changes{v1.0g}{1994/05/12}
% {macro added for color support}
% \begin{macro}{\color@hbox}
% \changes{v1.0n}{1994/11/05}
% {macro added for color support}
% \begin{macro}{\color@vbox}
% \changes{v1.0r}{1994/11/18}
% {macro added for color support}
% \begin{macro}{\color@endbox}
% \changes{v1.0n}{1994/11/05}
% {macro added for color support}
% \changes{v1.4b}{2021/02/04}
% {Always add the color groups (gh/488)}
% In the past these macros were initially no-ops, and the \pkg{color}
% package redefined
% redefine them to be |\begingroup|, |\endgroup|,
% |\begingroup\set@color|,\\ |\hbox\bgroup\color@begingroup|,
% |\color@endgroup\egroup|.
% and \meta{set to main document color} respectively.
%
% Nowadays we always set the group already in the kernel as this makes the
% coding simpler.
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2021/06/01}%
%<latexrelease> {\color@begingroup}{color group settings}%
\let\color@begingroup\begingroup
\def\color@endgroup{\endgraf\endgroup}
\def\color@setgroup{\color@begingroup} % changed further in color package
\let\normalcolor\relax % remains untouched; only changed in a color package
\def\color@hbox{\hbox\bgroup\color@begingroup}
\def\color@vbox{\vbox\bgroup\color@begingroup}
\def\color@endbox{\color@endgroup\egroup}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\color@begingroup}{color group settings}%
%<latexrelease>
%<latexrelease>\let\color@begingroup\relax
%<latexrelease>\let\color@endgroup\relax
%<latexrelease>\let\color@setgroup\relax
%<latexrelease>\let\normalcolor\relax
%<latexrelease>\let\color@hbox\relax
%<latexrelease>\let\color@vbox\relax
%<latexrelease>\let\color@endbox\relax
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\newsavebox}
% \changes{v0.1a}{1993/12/03}
% {Pass the whole of arg 1 to \cs{@ifdefinable}}
% Allocate a new `savebox'.
% \begin{macrocode}
\def\newsavebox#1{\@ifdefinable{#1}{\newbox#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\savebox}
% Save |#1| in a box register.
% \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2015/01/01}%
%<latexrelease> {\savebox}{Make \savebox robust}%
%<*2ekernel|latexrelease>
\DeclareRobustCommand\savebox[1]{%
\@ifnextchar(%)
{\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}}%
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\savebox}{Make \savebox robust}%
%<latexrelease>\def\savebox#1{%
%<latexrelease> \@ifnextchar(%)
%<latexrelease> {\@savepicbox#1}{\@ifnextchar[{\@savebox#1}{\sbox#1}}}%
%<latexrelease>\expandafter\let\csname savebox \endcsname\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\sbox}
% \changes{v0.1a}{1993/12/03}
% {extra group}
% \changes{v0.1a}{1993/12/03}
% {color support}
% \changes{v1.0b}{1994/03/14}
% {Use \cs{color@setgroup}}
% \changes{v1.0j}{1994/10/18}
% {\cs{long} added}
% Save |#1| in a box register.
% \begin{macrocode}
\DeclareRobustCommand\sbox[2]{\setbox#1\hbox{%
\color@setgroup#2\color@endgroup}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@savebox}
% \changes{v0.1a}{1993/12/03}
% {default c not x}
% Look for second optional argument.
% \begin{macrocode}
\def\@savebox#1[#2]{%
\@ifnextchar [{\@isavebox#1[#2]}{\@isavebox#1[#2][c]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@isavebox}
% \changes{v0.1a}{1993/12/03}
% {extra group}
% \changes{v0.1a}{1993/12/03}
% {color support}
% \changes{v1.0b}{1994/03/14}
% {Use \cs{color@setgroup}}
% \changes{v1.0d}{1994/04/15}
% {Added missing percent character.}
% \changes{v1.0v}{1995/07/20}
% {Use \cs{sbox}}
% \begin{macrocode}
\long\def\@isavebox#1[#2][#3]#4{%
\sbox#1{\@imakebox[#2][#3]{#4}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@savepicbox}
% Picture mode version of |\savebox|.
% \begin{macrocode}
\def\@savepicbox#1(#2,#3){%
\@ifnextchar[%]
{\@isavepicbox#1(#2,#3)}{\@isavepicbox#1(#2,#3)[]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@isavepicbox}
% \changes{v0.1a}{1993/12/03}
% {extra group}
% \changes{v1.0b}{1994/03/14}
% {Use \cs{color@setgroup}}
% \changes{v1.0l}{1994/10/25}
% {missing percent (moved from ltpatch)}
% \changes{v1.0v}{1995/07/20}
% {Use \cs{sbox}}
% Picture mode version of |\savebox|.
% \begin{macrocode}
\long\def\@isavepicbox#1(#2,#3)[#4]#5{%
\sbox#1{\@imakepicbox(#2,#3)[#4]{#5}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lrbox}
% \changes{v0.1a}{1993/12/03}
% {macro added}
% \changes{v0.1a}{1993/12/03}
% {color support}
% \changes{v0.1b}{1993/12/08}
% {move \cs{@endpefalse} out of the inner group}
% \changes{v1.0b}{1994/03/14}
% {Use \cs{color@setgroup}}
% |lrbox|: the new environment form of |\sbox|. Use |\aftergroup| tricks
% to enable a \emph{local} assignment to be made to the box, in a way
% that it still has an effect \emph{outside} the |lrbox| environment.
% \begin{macrocode}
\def\lrbox#1{%
\edef\reserved@a{%
\endgroup
\setbox#1\hbox{%
\begingroup\aftergroup}%
\def\noexpand\@currenvir{\@currenvir}%
\def\noexpand\@currenvline{\on@line}}%
\reserved@a
\@endpefalse
\color@setgroup
\ignorespaces}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\endlrbox}
% \changes{v0.1a}{1993/12/03}
% {macro added}
% End the |lrbox| environment.
% \begin{macrocode}
\def\endlrbox{\unskip\color@endgroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\usebox}
% unchanged
% \begin{macrocode}
\DeclareRobustCommand\usebox[1]{\leavevmode\copy #1\relax}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frame}
%
% The following definition of |\frame| was written by Pavel Curtis
% (Extra space removed 14 Jan 88)
% RmS 92/08/24: Replaced occurrence of |\@halfwidth| by |\@wholewidth|
% \begin{macrocode}
\DeclareRobustCommand\frame[1]{%
\leavevmode
\hbox{%
\hskip-\@wholewidth
\vbox{%
\vskip-\@wholewidth
\hrule \@height\@wholewidth
\hbox{%
\vrule\@width\@wholewidth
#1%
\vrule\@width\@wholewidth}%
\hrule\@height\@wholewidth
\vskip-\@wholewidth}%
\hskip-\@wholewidth}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fboxrule}
% \begin{macro}{\fboxsep}
% user level parameters,
% \begin{macrocode}
\newdimen\fboxrule
\newdimen\fboxsep
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\fbox}
% Abbreviated framed box command.
% \changes{v0.1a}{1993/12/03}
% {extra group}
% \changes{v1.0g}{1994/05/12}
% {New definition, merged with \cs{framebox}}
% \changes{v1.0i}{1994/06/01}
% {New version, using \cs{@frameb@x}}
% \changes{v1.0j}{1994/10/18}
% {\cs{long} added}
% \changes{v1.0k}{1994/10/24}
% {Inner braces added (to fix latex/1061)}
% \changes{v1.0s}{1995/04/27}
% {Move \cs{leavevmode} for graphics/1512}
% \begin{macrocode}
\DeclareRobustCommand\fbox[1]{%
\leavevmode
\setbox\@tempboxa\hbox{%
\color@begingroup
\kern\fboxsep{#1}\kern\fboxsep
\color@endgroup}%
\@frameb@x\relax}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\framebox}
% Framed version of |\makebox|.
% \changes{v1.0g}{1994/05/12}
% {Merged \cs{fbox} and \cs{framebox}}
% \changes{v1.0i}{1994/06/01}
% {New version, so \cs{width} is correct in \cs{framebox}}
% \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2015/01/01}%
%<latexrelease> {\framebox}{Make \framebox robust}%
%<*2ekernel|latexrelease>
\DeclareRobustCommand\framebox{%
\@ifnextchar(%)
\@framepicbox{\@ifnextchar[\@framebox\fbox}}%
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\framebox}{Make \framebox robust}%
%<latexrelease>\def\framebox{%
%<latexrelease> \@ifnextchar(%)
%<latexrelease> \@framepicbox{\@ifnextchar[\@framebox\fbox}}%
%<latexrelease>\expandafter\let\csname framebox \endcsname\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@framebox}
% Deal with optional arguments.
% \begin{macrocode}
\def\@framebox[#1]{%
\@ifnextchar[%]
{\@iframebox[#1]}%
{\@iframebox[#1][c]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iframebox}
% The handling the optional arguments.
% \changes{v1.0i}{1994/06/01}
% {New version, so \cs{width} is correct in \cs{framebox}}
% \changes{v1.0j}{1994/10/18}
% {\cs{leavevmode} moved to \cs{@frameb@x}}
% \changes{v1.0s}{1995/04/27}
% {Move \cs{leavevmode} for graphics/1512}
% In order to set the whole box, including the frame to the
% specified dimension, we first determine that dimension
% from the natural size of the text, |#3|.
% calculated width.
% \begin{macrocode}
\long\def\@iframebox[#1][#2]#3{%
\leavevmode
\@begin@tempboxa\hbox{#3}%
\setlength\@tempdima{#1}%
\setbox\@tempboxa\hb@xt@\@tempdima
{\kern\fboxsep\csname bm@#2\endcsname\kern\fboxsep}%
\@frameb@x{\kern-\fboxrule}%
\@end@tempboxa}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@frameb@x}
% Common part of |\framebox| and |\fbox|. |#1| is a negative kern
% in the |\framebox| case so that the vertical rules do not add to the
% width of the box.
% \changes{v1.0i}{1994/06/01}
% {Macro added.}
% \changes{v1.0j}{1994/10/18}
% {\cs{leavevmode} added}
% \changes{v1.0s}{1995/04/27}
% {Move \cs{leavevmode} for graphics/1512}
% \begin{macrocode}
\def\@frameb@x#1{%
\@tempdima\fboxrule
\advance\@tempdima\fboxsep
\advance\@tempdima\dp\@tempboxa
\hbox{%
\lower\@tempdima\hbox{%
\vbox{%
\hrule\@height\fboxrule
\hbox{%
\vrule\@width\fboxrule
#1%
\vbox{%
\vskip\fboxsep
\box\@tempboxa
\vskip\fboxsep}%
#1%
\vrule\@width\fboxrule}%
\hrule\@height\fboxrule}%
}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@framepicbox}
% Picture mode version.
% \begin{macrocode}
\def\@framepicbox(#1,#2){%
\@ifnextchar[{\@iframepicbox(#1,#2)}{\@iframepicbox(#1,#2)[]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iframepicbox}
% Picture mode version.
% \begin{macrocode}
\long\def\@iframepicbox(#1,#2)[#3]#4{%
\frame{\@imakepicbox(#1,#2)[#3]{#4}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\parbox}
% \changes{v0.1a}{1993/12/03}
% {Redefined to support extra optional arguments}
% \changes{v0.1d}{1993/12/15}
% {Changed default from `c' to `s'}
% The main vertical-box command for \LaTeX.
% \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2015/01/01}%
%<latexrelease> {\parbox}{Make \parbox robust}%
%<*2ekernel|latexrelease>
\DeclareRobustCommand\parbox{%
\@ifnextchar[%]
\@iparbox
{\@iiiparbox c\relax[s]}}%
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\parbox}{Make \parbox robust}%
%<latexrelease>\def\parbox{%
%<latexrelease> \@ifnextchar[%]
%<latexrelease> \@iparbox
%<latexrelease> {\@iiiparbox c\relax[s]}}%
%<latexrelease>\expandafter\let\csname parbox \endcsname\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iparbox}
% \changes{v0.1d}{1993/12/15}
% {Changed default from `c' to `s'}
% Optional argument handling.
% \begin{macrocode}
\def\@iparbox[#1]{%
\@ifnextchar[%]
{\@iiparbox{#1}}%
{\@iiiparbox{#1}\relax[s]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iiparbox}
% Optional argument handling.
% \begin{macrocode}
\def\@iiparbox#1[#2]{%
\@ifnextchar[%]
{\@iiiparbox{#1}{#2}}%
{\@iiiparbox{#1}{#2}[#1]}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@iiiparbox}
% \begin{macro}{\@parboxto}
% \changes{v1.0j}{1994/10/18}
% {Macro added to remove misuse of \cs{@empty}}
% \changes{v0.1b}{1993/12/08}
% {\cs{endgraf} added due to extra group in \cs{@begin@tempboxa}}
% \changes{v1.0y}{1996/06/10}
% {(DPC) Changed \cs{endgraf} to \cs{@@par}}
% \changes{v1.1f}{1999/04/27}
% {(CAR) Changed \cs{@empty} to \cs{relax} as flag for natural
% width: pr/2975}
% \changes{v1.1g}{2006/05/18}
% {Ensure \cs{@parboxto} holds the value of \cs{@tempdimb} not the
% register itself (pr/3867)}
% The internal version of |\parbox|.
% \begin{macrocode}
\let\@parboxto\@empty
\long\def\@iiiparbox#1#2[#3]#4#5{%
\leavevmode
\@pboxswfalse
\setlength\@tempdima{#4}%
\@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
\ifx\relax#2\else
\setlength\@tempdimb{#2}%
\edef\@parboxto{to\the\@tempdimb}%
\fi
\if#1b\vbox
\else\if #1t\vtop
\else\ifmmode\vcenter
\else\@pboxswtrue $\vcenter
\fi\fi\fi
\@parboxto{\let\hss\vss\let\unhbox\unvbox
\csname bm@#3\endcsname}%
\if@pboxsw \m@th$\fi
\@end@tempboxa}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v1.0c}{1994/04/12}
% {Remove \cs{@acci}, now defined in ltplain.dtx}
% \changes{v1.0c}{1994/04/12}
% {Remove \cs{@dischyph}, now defined in ltinit.dtx}
%
% \begin{macro}{\@arrayparboxrestore}
% Restore various paragraph parameters.
%
% The rational for allowing two normally global flags to be set
% locally here was stated originally by
% Donald Arseneau and extended by Chris Rowley.
% It is because these flags are only set globally to
% true by section commands, and these should never appear within
% boxes or, indeed, in any group; and they are only ever
% set globally to false when they are definitely true.
%
% If anyone is unhappy with this argument then both flags should be
% treated as in |\set@nobreak|; otherwise this command will be
% redundant.
% \changes{v1.1a}{1996/10/24}{Added local settings of flags: dangerous!!}
% \begin{macrocode}
%</2ekernel>
%<latexrelease>\IncludeInRelease{2017-04-15}%
%<latexrelease> {\normallineskiplimit}
%<latexrelease> {reset \lineskiplimit}%
%<*2ekernel|latexrelease>
\def\@arrayparboxrestore{%
\let\if@nobreak\iffalse
\let\if@noskipsec\iffalse
\let\par\@@par
\let\-\@dischyph
% \end{macrocode}
% Redefined accents to allow changes in font encoding
% \changes{v1.0h}{1994/05/13}
% {New accent system, use \cs{let} not \cs{def}}
% \begin{macrocode}
\let\'\@acci\let\`\@accii\let\=\@acciii
\parindent\z@ \parskip\z@skip
\everypar{}%
\linewidth\hsize
\@totalleftmargin\z@
\leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
\parfillskip\@flushglue
\lineskip\normallineskip
% \end{macrocode}
% \changes{v1.3a}{2017/03/29}
% {Reset \cs{lineskiplimit}}
% \begin{macrocode}
\lineskiplimit\normallineskiplimit
% \end{macrocode}
%
% \begin{macrocode}
\baselineskip\normalbaselineskip
\sloppy}
%</2ekernel|latexrelease>
% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000-00-00}%
%<latexrelease> {\normallineskiplimit}
%<latexrelease> {reset \lineskiplimit}%
%<latexrelease>\def\@arrayparboxrestore{%
%<latexrelease> \let\if@nobreak\iffalse
%<latexrelease> \let\if@noskipsec\iffalse
%<latexrelease> \let\par\@@par
%<latexrelease> \let\-\@dischyph
%<latexrelease> \let\'\@acci\let\`\@accii\let\=\@acciii
%<latexrelease> \parindent\z@ \parskip\z@skip
%<latexrelease> \everypar{}%
%<latexrelease> \linewidth\hsize
%<latexrelease> \@totalleftmargin\z@
%<latexrelease> \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
%<latexrelease> \parfillskip\@flushglue \lineskip\normallineskip
%<latexrelease> \baselineskip\normalbaselineskip
%<latexrelease> \sloppy}
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@parboxrestore}
% Restore various paragraph parameters, and also |\\|.
% \begin{macrocode}
\def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@minipage}
% Switch that is true at the start of a minipage.
% \changes{v1.0z}{1996/07/26}{put \cs{global} into definition}
% \begin{macrocode}