summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/makecell/makecell.dtx
blob: 0cf9df93053a3d430bf2b38dd971be2c86628510 (plain)
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
1001
1002
1003
1004
1005
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
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
% \iffalse
%
%    makecell.dtx - tabular column heads and multilined cells.
%    (c) 2005 Olga Lapko (Lapko.O@g23.relcom.ru)
%
%    This program is provided under the terms of the
%    LaTeX Project Public License distributed from CTAN
%    archives in directory macros/latex/base/lppl.txt.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{makecell.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{makecell}
%<*package>
    [2005/07/02 v0.1a Multilined Cells and Tabular Heads]
%</package>
%
%<*batchfile>
\begingroup

\input docstrip.tex

\keepsilent
\askforoverwritefalse

\generate{\file{makecell.sty}{\from{makecell.dtx}{package}}}

\endgroup
%</batchfile>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{makecell}
\IfFileExists{rotating.sty}{\usepackage{rotating}}{}
\IfFileExists{footmisc.sty}{\usepackage[perpage]{footmisc}}{}
\IfFileExists{multirow.sty}{\usepackage{multirow}}{}
\IfFileExists{hyperref.sty}{\usepackage{hyperref}}{}
\IfFileExists{hypcap.sty}{\usepackage{hypcap}}{}
\IfFileExists{caption.sty}{\usepackage[font=small,labelfont=bf,labelsep=period]{caption}[2004/11/28]
\IfFileExists{floatrow.sty}{\usepackage[font=small,style=plaintop,captionskip=5pt]{floatrow}}{\let\ttabbox\relax}}{}
\usepackage{tabularx}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\makeatletter
\@beginparpenalty10000
\widowpenalty10000
\clubpenalty10000
\makeatother
\providecommand*{\file}[1]{\texttt{#1}}
\providecommand*{\pkg}[1]{\textsf{#1}}
\providecommand*{\cls}[1]{\textsf{#1}}
\providecommand*{\env}[1]{\texttt{#1}}

%\OnlyDescription
\begin{document}
  \DocInput{makecell.dtx}
  \PrintChanges
\end{document}
%</driver>
% \fi
%
% \CheckSum{664}
%
% \GetFileInfo{makecell.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \title{The \textsf{makecell} package\thanks{This
%          file has version number \fileversion,
%          last revised \filedate.}}
%   \author{%
%   Olga Lapko\\
%   {\tt Lapko.O@g23.relcom.ru} }
%   \date{\filedate}
%   \maketitle
%   \begin{abstract}
%   This package offers command |\thead|, based on one-column tabular
%   environment for tabular column heads. This macro allows to support
%   common layout for tabular column heads in documentation. Another command,
%   |\makecell|, is offered for creation of multilined tabular cells.
%
%   Package also offers: \quad 1)\nobreak\enskip macro |\makegapedcells|, which
%   changes vertical spaces around all cells (like in \pkg{tabls} package) in
%   tabular; \quad 2)\nobreak\enskip macros |\multirowhead|  and |\multirowcell|,
%   which use |\multirow| macro from \pkg{multirow} package.\smallskip
%
%   Current package calls \pkg{array} package. (Macro |\makegapedcells| also
%   temporarily redefines macro |\@classz| from this package.)
%   \end{abstract}
%
% \section{Tabular Cells and Column Heads}
%
% \subsection{Building Commands}
%
% \DescribeMacro{\makecell}
% Macro creates one-column tabular with predefined common settings of
% alignment, spacing and vertical spaces around (see section~\ref{sec:sets}). This will be useful for
% creation of multilined cells. This macro allows optional alignment settings.
% \begin{quote}
% |\makecell|\oarg{vertical or/and horizontal alignment}\marg{cell text}
% \end{quote}
% For vertical alignment you use \texttt{t}, \texttt{b}, or \texttt{c}---%^^A
% this letters you usually put in optional argument of \env{tabular} or \texttt{array}
% environments. For horizontal alignment you may use alignment settings
% like \texttt{r}, \texttt{l}, or \texttt{c}, or more complex, like
% |{p{3cm}}|. Since this package loads \pkg{array} package, you may
% use such alignment settings like |{>{\parindent1cm}p{3cm}}|.
%\begin{verbatim}
%\begin{tabular}{|c|c|}
%\hline
%Cell text & 28--31\\
%\hline
%\makecell{Multilined \\ cell text} & 28--31\\
%\hline
%\makecell[l]{Left aligned \\ cell text} & 37--43\\
%\hline
%\makecell*[r]{Right aligned \\ cell text} & 37--43\\
%\hline
%\makecell[b]{Bottom aligned \\ cell text} & 52--58\\
%\hline
%\makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\
%\hline
%\makecell[{{>{\parindent1em}p{3cm}}}]{Cell long...} & 52--58\\
%\hline
%\end{tabular}
%\end{verbatim}
% \begin{table}[h]
% \ttabbox
% {\caption{Example of multilined cells}\label{tab:cells}}%
% {\begin{tabular}{|c|c|}
% \hline
% Cell text & 28--31\\
% \hline
% \makecell{Multilined \\ cell text} & 28--31\\
% \hline
% \makecell[l]{Left aligned \\ cell text} & 37--43\\
% \hline
% \makecell*[r]{Right aligned \\ cell text} & 37--43\\
% \hline
% \makecell[b]{Bottom aligned\\ cell text} & 52--58\\
% \hline
% \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\
% \hline
% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & 52--58\\
% \hline
% \end{tabular}}
% \end{table}
%
% Starred form of command, |\makecell*|, creates vertical |\jot| spaces around.
%
% \emph{Note}. When you define column alignment like |p{3cm}| in optional argument of
% |\makecell| (or |\thead|, see below), please follow these rules: \quad 1)\nobreak\enskip if
% vertical alignment defined, write column alignment in group, e.g. |[c{p{3cm}}]|; \quad
% 2)\nobreak\enskip if it is absent, write column alignment in double group---%^^A
% |[{{p{3cm}}}]|, or add empty group---|[{}{p{3cm}}]|. Be also careful with vertical
% alignment when you define column alignment as paragraph block: e.g., use |{{b{3cm}}}| for
% bottom alignment.
%
% \DescribeMacro{\thead}
% Macro creates one-column tabular for column heads with predefined
% common settings (see table~\ref{tab:thead}). This macro uses common layout for column heads:
% font, alignment, spacing, and vertical spaces around (see section~\ref{sec:sets}).
%\begin{verbatim}
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\begin{tabular}{|l|c|}
%\hline
%\thead{First column head}&
%  \thead{Second \\multlined \\ column head}\\
%\hline
%Left column text & 28--31\\
%\hline
%\end{tabular}
%\end{verbatim}
% \begin{table}[h]
% \ttabbox
% {\caption{Example of column heads}\label{tab:thead}}
% {\renewcommand\theadset{\def\arraystretch{.85}}
% \begin{tabular}{|l|c|}
% \hline
% \thead{First column head}&
%   \thead{Second \\multlined \\ column head}\\
% \hline
% Long left column text & 28--31\\
% \hline
% \end{tabular}}
% \end{table}
%
% Starred form of command, |\thead*|, creates vertical |\jot| spaces around.
%
% \DescribeMacro{\rothead}
% Creates table heads rotated by 90$^\circ$ counterclockwise.
% Macro uses the same font and spacing settings as previous
% one, but column alignment changed to |p{\rotheadsize}| with |\raggedright|
% justification: in this case left side of all text lines ``lie'' on one base line.
%
% \DescribeMacro{\rotheadsize}
% This parameter defines the width of rotated tabular heads. You may define that like:
% \begin{quote}
% |\setlength\rotheadsize{3cm}|
% \end{quote}
% or
% \begin{quote}
% |\settowidth\rotheadsize{\theadfont |\meta{Widest head text}|}|
% \end{quote}
% like in following example:
%\begin{verbatim}
%\settowidth\rotheadsize{\theadfont Second multilined}
%\begin{tabular}{|l|c|}
%\hline
%\thead{First column head}&
%  \rothead{Second multilined \\ column head}\\
%\hline
%Left column text & 28--31\\
%\hline
%\end{tabular}
%\end{verbatim}
% \begin{table}[h]
% \ttabbox
% {\caption{Example of rotated column heads}}%
% {\settowidth\rotheadsize{\theadfont Second multilined}%^^A
% \begin{tabular}{l|l}
% \hline
% \thead{First column head}&
%   \rothead{Second multilined \\ column head}\\
% \hline
% Long left column text & 28--31\\
% \hline
% \end{tabular}}
% \end{table}
%
% \subsection{Settings For Tabular Cells}\label{sec:sets}
%
% This section describes macros, which make layout tuning for multilined cells,
% created by |\makecell| macro. The |\cellset| macro also is used by |\thead| macro.
%
% \DescribeMacro{\cellset}
% Spacing settings for cells. Here you could use commands like:
% \begin{quote}
% |\renewcommand\theadcell{\renewcommand\arraytretch{1}%|\\
% |    \setlength\extrarowheight{0pt}}|
% \end{quote}
% as was defined in current package.
% These settings used by both |\makecell| and |\thead| (|\rothead|) commands.
%
% \DescribeMacro{\cellalign}
% Default align for cells. Package offers vertical and horizontal centering alignment, it defined like:
% \begin{quote}
% |\renewcommand\cellalign{cc}|
% \end{quote}
%
% \DescribeMacro{\cellgape}
% Define vertical spaces around |\makecell|, using |\gape| command if necessary. It defined like:
% \begin{quote}
% |\renewcommand\cellgape{}|
% \end{quote}
% You may define this command like
% \begin{quote}
% |\renewcommand\cellgape{\gape*{1pt}}|
% \end{quote}
% or
% \begin{quote}
% |\renewcommand\cellgape{\gape[t]}|
% \end{quote}
% (See also section~\ref{sec:gape} about |\gape| command.)
%
% \subsection{Settings For Column Heads}
%
% This section describes macros, which make layout tuning for tabular column heads,
% created by |\thead| (|\rothead|) macro.
%
% \DescribeMacro{\theadfont}
% Sets a special font for column heads. It could be smaller size
% \begin{quote}
% |\renewcommand\theadfont{\foonotesize}|
% \end{quote}
% as was defined in current package.
% Next example defines italic shape
% \begin{quote}
% |\renewcommand\theadfont{\itshape}|
% \end{quote}
%
% \DescribeMacro{\theadset}
% Spacing settings for column heads. Here you could use commands like:
% \begin{quote}
% |\renewcommand\theadcell{\renewcommand\arraytretch{1}%|\\
% |    \setlength\extrarowheight{0pt}}|
% \end{quote}
%
% \DescribeMacro{\theadalign}
% Default align for tabular column heads. Here also offered centering alignment:
% \begin{quote}
% |\renewcommand\theadalign{cc}|
% \end{quote}
%
% \DescribeMacro{\theadgape}
% Define vertical spaces around, using |\gape| command if necessary. It defined like:
% \begin{quote}
% |\renewcommand\theadgape{\gape}|
% \end{quote}
%
% \DescribeMacro{\rotheadgape}
% Analogous definition for rotated column heads. Default is absent:
% \begin{quote}
% |\renewcommand\rotheadgape{}|
% \end{quote}
%
% \section{Changing of Height and Depth of Boxes}\label{sec:gape}
%
% Sometimes \env{tabular} or \env{array} cells, or some elements in text need a
% height/depth correction. The |\raisebox| command could help for it, but usage
% of that macro in these cases, especially inside math, is rather complex.
% Current package offers the |\gape| macro, which usage is similar to |\smash| macro.
% The |\gape| macro allows to change height and/or depth of included
% box with necessary dimension.
%
% \DescribeMacro{\gape}
% This macro changes included box by |\jot| value (usually 3\,pt). It is defined with optional
% and mandatory arguments, like |\smash| macro, which (re)defined by \pkg{amsmath} package.
% Optional argument sets change of height only (\texttt{t}) or depth only~(\texttt{b}).
% Mandatory argument includes text.
%   \begin{quote}
%   |\gape|\oarg{\texttt{t} or \texttt{b}}\marg{text}
%   \end{quote}
% Examples of usage:
% \begin{quote}
% \noindent
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \gape{\cmd{\gape}\texttt{\{text\}}}\cr
% \noalign{\hrule}
% \crcr}}\qquad
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \gape[t]{\cmd{\gape}\texttt{[t]\{text\}}}\cr
% \noalign{\hrule\vskip\jot}
% \crcr}}\qquad
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \gape[b]{\cmd{\gape}\texttt{[b]\{text\}}}\cr
% \noalign{\hrule}
% \crcr}}
% \end{quote}
%
% \DescribeMacro{\Gape}
% Another way of height/depth modification. This macro allows different correction for
% height and depth of box:
%   \begin{quote}
%   |\Gape|\oarg{height corr}\oarg{depth corr}\marg{text}
%   \end{quote}
%
% If both arguments absent, |\Gape| command works like |\gape|\marg{text}, in other
% words, command uses |\jot| as correction value for height and depth of box.
%
% If only one optional argument exists, |\Gape| command uses value
% from this argument for both height and depth box corrections.
% \begin{quote}
% \noindent
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \Gape{\cmd{\Gape}\texttt{\{text\}}}\cr
% \noalign{\hrule}
% \crcr}}\texttt{\phantom{xxxxx}}\qquad
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \Gape[\jot]{\cmd{\Gape}\texttt{[\cmd{\jot}]\{text\}}}\cr
% \noalign{\hrule}
% \crcr}}\\[2ex]
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \Gape[6pt]{\cmd{\Gape}\texttt{[6pt]\{text\}}}\cr
% \noalign{\hrule}
% \crcr}}\qquad
% \vbox{\halign{#\cr
% \noalign{\hrule}
% \Gape[6pt][-2pt]{\cmd{\Gape}\texttt{[6pt][-2pt]\{text\}}}\cr
% \noalign{\hrule\vskip8pt}
% \crcr}}
% \end{quote}
%
% \DescribeMacro{\bottopstrut}
% \DescribeMacro{\topstrut}
% \DescribeMacro{\botstrut}
% These three macros modify standard |\strut| by |\jot| value:
%     |\bottopstrut| changes both height and depth;
%     |\topstrut| changes only height;
%     |\botstrut| changes only depth.
%  These commands could be useful, for example, in first and last table rows.
%
%  \emph{Note}. If you use
%  \pkg{bigstrut} package note that these macros duplicate \cmd{\bigstrut},
%  \cmd{\bigstrut[t]}, and \cmd{\bigstrut[b]} commands consequently. Please note that value,
%  which increases strut in \cmd{\topstrut} etc. equals to \cmd{\jot}, but  \cmd{\bigstrut}
%  and others use a special dimension \cmd{\bigstrutjot}.
%
% \section{How to Change Vertical Spaces Around in Whole Table}\label{sec:beta}
%
% This section describes macros which try to emulate one of possibilities of \pkg{tabls}
% package: to get necessary vertical spacing around cells.
%
% \DescribeMacro{\setcellgapes}
% Sets the parameters for vertical spaces. It looks like |\gape*| command without
% \marg{text} argument:
% \begin{quote}
% |\setcellgapes|\oarg{\texttt{t} or \texttt{b}}\marg{value}
% \end{quote}
% The  next examples with array and tabular use following settings:
% \begin{quote}
% |\setcellgapes{5pt}|
% \end{quote}
% You may also try to load negative values if you wish. This macro you may put in the
% preamble as common settings.
%
% \DescribeMacro{\makegapedcells}
% \DescribeMacro{\nomakegapedcells}
% The first macro switches on vertical spacing settings. The second cancels first~one.
%
% The \cmd{\makegapedcells} macro temporarily redefines macro
% |\@classz| of \pkg{array} package, so use this mechanism carefully.
% Load |\makegapedcells| inside group or inside environment (see table~\ref{tab:gaped}):
%\begin{verbatim}
%\begin{table}[h]
%\makegapedcells
%...
%\end{table}
%\end{verbatim}
% \setcellgapes{5pt}
% \begin{table}
% \makegapedcells
% \ttabbox
% {\caption{Example of multilined cells with additional vertical spaces}\label{tab:gaped}}%
% {\begin{tabular}{|c|c|}
% \hline
% Cell text & 28--31\\
% \hline
% \makecell{Multilined \\ cell text} & 28--31\\
% \hline
% \makecell[l]{Left aligned \\ cell text} & 37--43\\
% \hline
% \makecell*[r]{Right aligned \\ cell text} & 37--43\\
% \hline
% \makecell[b]{Bottom aligned \\ cell text} & 52--58\\
% \hline
% \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\
% \hline
% \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long  text with predefined width} & 52--58\\
% \hline
% \end{tabular}}
% \end{table}
%
% Please note that space defined in |\setcellgapes| and space which creates |\gape| mechanism
% in commands for tabular cells (usually |\thead| or |\makecell*|) are summarized.
%
% \section{Multirow Table Heads and Cells}
%
% The next examples show usage of macros which use |\multirow| command from \pkg{multirow}
% package.\nopagebreak
%
% At first goes short repetition of arguments of |\multirow| macro itself:
% \begin{quote}
% |\multirow|\marg{nrow}\oarg{njot}\marg{width}\oarg{vmove}\marg{contents}
% \end{quote}
% \marg{nrow} sets number of rows (i.e. text lines);
% \oarg{njot} is mainly used if you've used \pkg{bigstrut} package: it makes additional
%       tuning of vertical position (see comments in \pkg{multirow} package);
% \marg{width} defines width of contents, the |*| sign used to indicate that
%       the text argument's natural width is to be used;
% \oarg{vmove} is a length used for fine tuning: the text will be raised (or
%       lowered, if \meta{vmove} is negative) by that length;
% \marg{contents} includes ``|\multirow|'ed'' text.\smallskip
%
% \DescribeMacro{\multirowcell}
% \DescribeMacro{\multirowthead}
% These two macros use following arguments (example uses |\multirowcell| command):
% \begin{quote}
% |\multirowcell|\marg{nrow}\oarg{vmove}\oarg{hor alignment}\marg{contents}
% \end{quote}
% in these macros were skipped \oarg{njot} and \marg{width}. Instead of tuning optional
% argument \oarg{njot} for vertical
% correction used \oarg{vmove} optional argument.
% For the \marg{width} argument both |\multirowcell| and |\multirowthead| macros
% use natural width of contents (i.e. the |*| argument used).
%
% First example (table~\ref{tab:mrowI}) with ``|\multirow|'ed'' column heads and cells:
%\begin{verbatim}
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\begin{tabular}{|l|c|c|}
% \multirowthead{4}{First ...}&
% \multicolumn{2}{c|}{\thead{Multicolumn head}}\\                 \cline{2-3}
%   & \thead{Second ...} & \thead{Third ...}\\                    \hline
% Cell text & A &\multirowcell{3}{28--31}\\                       \cline{1-2}
% \makecell{Multilined\\Cell text} & B& \\                        \hline
% \makecell[l]{Left ...} & C & \multirowcell{4}[1ex][l]{37--43}\\ \cline{1-2}
% \makecell[r]{Right ...} & D & \\                                \hline
% \makecell[b]{Bottom ...} & E & \multirowcell{5}[1ex][r]{37--43\\52--58}\\
% \cline{1-2}
% \makecell[{{p{5cm}}}]{Cell ...} & F & \\                        \cline{1-2}
% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell ...} & G & \\        \hline
% \end{tabular}
%\end{verbatim}
%
% \begin{table}[p]
%\renewcommand\theadset{\def\arraystretch{.85}}%
% \ttabbox
% {\caption{Example of ``\cmd{\multirow}'ed'' cells}\label{tab:mrowI}}%
% {\begin{tabular}{|l|c|c|}
% \hline
% \multirowthead{4}{First Column head}&
% \multicolumn{2}{c|}{\thead{Multicolumn head}}\\
% \cline{2-3}
%  & \thead{Second \\multlined \\ column head} &
%   \thead{Third \\ column head}\\
% \hline
% Cell text & A &\multirowcell{3}{28--31}\\
% \cline{1-2}
% \makecell{Multilined\\Cell text} & B& \\
% \hline
% \makecell[l]{Left aligned\\ cell text} & C & \multirowcell{4}[1ex][l]{37--43}\\
% \cline{1-2}
% \makecell[r]{Right aligned\\ cell text} & D & \\
% \hline
% \makecell[b]{Bottom aligned\\ cell text} & E & \multirowcell{5}[1ex][r]{37--43\\52--58}\\
% \cline{1-2}
% \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\
% \cline{1-2}
% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with predefined width} & G & \\
% \hline
% \end{tabular}}
% \end{table}
%
% Second example (table~\ref{tab:mrowII}) with ``multirow'ed'' column heads and cells
% uses |\makegapedcells| command. The |\theadgape| command does nothing:
%\begin{verbatim}
%\makegapedcells
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\renewcommand\theadgape{}
%...
%\end{verbatim}
% \begin{table}[p]\makegapedcells
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\renewcommand\theadgape{}
% \ttabbox
% {\caption{Example of ``\cmd{\multirow}'ed'' cells and additional vertical spaces}\label{tab:mrowII}}%
% {\begin{tabular}{|l|c|c|}
% \hline
% \multirowthead{4}{First Column head}&
% \multicolumn{2}{c|}{\thead{Multicolumn head}}\\
% \cline{2-3}
%  & \thead{Second \\multlined \\ column head} &
%   \thead{Third \\ column head}\\
% \hline
% Cell text & A &\multirowcell{4}{28--31}\\
% \cline{1-2}
% \makecell{Multilined \\Cell text} & B& \\
% \hline
% \makecell[l]{Left aligned \\ cell text} & C & \multirowcell{4}[0ex][l]{37--43}\\
% \cline{1-2}
% \makecell[r]{Right aligned \\ cell text} & D & \\
% \hline
% \makecell[b]{Bottom aligned \\ cell text} & E & \multirowcell{6}[0ex][r]{37--43\\52--58}\\
% \cline{1-2}
% \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\
% \cline{1-2}
% \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with predefined width} & G & \\
% \hline
% \end{tabular}}
% \end{table}
% \bigskip
%
% The last example (table~\ref{tab:mrowIII}) uses \env{tabularx} environment with |\hsize|
% in the width argument.
%\begin{verbatim}
%\makegapedcells
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\renewcommand\theadgape{}
%\begin{tabularx}\hsize{|X|c|c|}
%...
%\cline{1-2}
%\makecell[{{p{\hsize}}}]{Cell ...} & F & \\
%\cline{1-2}
%\makecell[{{>{\parindent1em}p{\hsize}}}]{Cell ...} & G & \\
%\hline
%\end{tabularx}
%\end{verbatim}
% As you may see the |\makecell|'s in last two rows defined as
% \begin{quote}
% |\makecell[{{p{\hsize}}}]{...}|
% \end{quote}
% and
% \begin{quote}
% |\makecell[{{>{\parindent1em}p{\hsize}}}]{...}|
% \end{quote}
% consequently.
% \begin{table}\makegapedcells
%\renewcommand\theadset{\def\arraystretch{.85}}%
%\renewcommand\theadgape{}
% \ttabbox
% {\caption{Example of \env{tabularx} environment}\label{tab:mrowIII}}%
% {\begin{tabularx}\hsize{|X|c|c|}
% \hline
% \multirowthead{4}{First Column head}&
% \multicolumn{2}{c|}{\thead{Multicolumn head}}\\
% \cline{2-3}
%  & \thead{Second \\multlined \\ column head} &
%   \thead{Third \\ column head}\\
% \hline
% Cell text & A &\multirowcell{4}{28--31}\\
% \cline{1-2}
% \makecell{Multilined \\Cell text} & B& \\
% \hline
% \makecell[l]{Left aligned \\ cell text} & C & \multirowcell{4}[0ex][l]{37--43}\\
% \cline{1-2}
% \makecell[r]{Right aligned \\ cell text} & D & \\
% \hline
% \makecell[b]{Bottom aligned \\ cell text} & E & \multirowcell{6}[0ex][r]{37--43\\52--58}\\
% \cline{1-2}
% \makecell[{{p{\hsize}}}]{Cell long long long long long long text with predefined width} & F & \\
% \cline{1-2}
% \makecell[{{>{\parindent1em}p{\hsize}}}]{Cell long long long long long long text with predefined width} & G & \\
% \hline
% \end{tabularx}}
% \end{table}
%
% \StopEventually{}\clearpage
%
% \section{Code of package}
%
% \subsection{Multilined cells}
%
%  First goes request of \pkg{array} package.
%    \begin{macrocode}
\RequirePackage{array}
%    \end{macrocode}
%
% \begin{macro}{\makecell}
% The definition of command for multilined cells. At first defined |\gape| stuff.
% Non-star from loads special setting for vertical space around (if it used).
% Star form always creates additional vertical |\jot|-spaces.
%    \begin{macrocode}
\newcommand\makecell{\@ifstar{\let\tabg@pe\gape\makecell@}%
                             {\let\tabg@pe\cellgape\makecell@}}
%    \end{macrocode}
% Next macro loads vertical and horizontal common alignment for cells and
% defines spacing parameters |\arraystretch| and |\extrarowheight| if necessary.
%    \begin{macrocode}
\newcommand\makecell@{\def\t@bset{\cellset}%
   \let\mcell@align\cellalign
   \@ifnextchar[\mcell@tabular
     {\expandafter\mcell@@tabular\cellalign\@nil}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thead}
% The macro for tabular column heads. At first defined |\gape| stuff.
% Non-star from loads special setting for vertical space around (if it used).
% Star form always creates additional vertical |\jot|-spaces.
%    \begin{macrocode}
\newcommand\thead{\@ifstar{\let\tabg@pe\gape\thead@}%
                          {\let\tabg@pe\theadgape\thead@}}
%    \end{macrocode}
% Next macro loads vertical and horizontal common alignment for column heads and
% defines spacing parameters |\arraystretch| and |\extrarowheight| if necessary.
% (First go settings for cells then special settings for column heads.)
%
% For column heads also loaded font settings.
%    \begin{macrocode}
\newcommand\thead@{\def\t@bset{\cellset\theadfont\theadset}%
   \let\mcell@align\theadalign
   \@ifnextchar[\mcell@tabular
     {\expandafter\mcell@@tabular\theadalign\@nil}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rotheadsize}
% The width dimension for rotated cells.
%    \begin{macrocode}
\@ifdefinable\rotheadsize{\newdimen\rotheadsize}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rotcell}
% The macro for rotated cell. If no \pkg{rotating} package loaded
% this macro works like |\makecell|.
%    \begin{macrocode}
\newcommand\rotcell{\@ifundefined{turn}%
  {\PackageWarning{makecell}%
     {\string\rotcell\space needs rotating package}%
  \let\tabg@pe\empty\let\t@bset\cellset\makecell@}
  {\@ifnextchar[{\@rotcell}{\@@rotcell}}}
%    \end{macrocode}
% For rotated cell default column setting is similar to |p{\rotheadsize}| (plus some
% additional justification settings)
%    \begin{macrocode}
\@ifdefinable\@rotcell{}
\def\@rotcell[#1]#2{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\makecell[#1]{#2}\endturn}
\newcommand\@@rotcell[1]{\makecell{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\makecell[c{>{\rightskip0explus
    \rotheadsize\hyphenpenalty0\pretolerance-1%
    \noindent\hskip\z@}p{\rotheadsize}
    }]{#1}\endturn}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\rothead}
% The macro for rotated tabular column heads. If no \pkg{rotating} package loaded
% this macro works like |\thead|.
%    \begin{macrocode}
\newcommand\rothead{\@ifundefined{turn}%
  {\PackageWarning{makecell}{\string\rothead\space
    needs rotating package}%
   \let\tabg@pe\theadgape
   \def\t@bset{\cellset\theadfont\theadset}\thead@}%
  {\let\theadgape\rotheadgape
   \@ifnextchar[{\@rothead}{\@@rothead}}}
%    \end{macrocode}
% For rotated column head default column setting is similar to |p{\rotheadsize}| (plus some
% additional justification settings)
%    \begin{macrocode}
\@ifdefinable\@rothead{}
\def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[#1]{#2@{}}\endturn}}
\newcommand\@@rothead[1]{\thead{\\[-.65\normalbaselineskip]
  \turn{\cellrotangle}\thead[c{>{\rightskip0explus
    \rotheadsize\hyphenpenalty0\pretolerance-1%
    \noindent\hskip\z@}p{\rotheadsize}
    @{}}]{#1}\endturn}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\multirowcell}
% The macro for multirow cells. If no \pkg{multirow} package loaded
% this macro works like |\makecell|.
%    \begin{macrocode}
\newcommand\multirowcell{\@ifundefined{multirow}%
  {\PackageWarning{makecell}{\string\multirowcell\space
   needs multirow package}}%
  {\let\mcell@multirow\multirow}\mcell@mrowcell@}
%    \end{macrocode}
% These macros define settings for |\multirow| arguments.
%    \begin{macrocode}
\newcommand\mcell@mrowcell@[1]{\@ifnextchar
  [{\mcell@mrowcell@@{#1}}{\mcell@mrowcell@@{#1}[0pt]}}
\@ifdefinable\mcell@mrowcell@@{}
\def\mcell@mrowcell@@#1[#2]{\edef\mcell@nrows{#1}\edef\mcell@fixup{#2}%
   \let\tabg@pe\cellgape\makecell@}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\multirowthead}
% The macro for multirow column heads. If no \pkg{multirow} package loaded
% this macro works like |\thead|.
%    \begin{macrocode}
\newcommand\multirowthead{\@ifundefined{multirow}%
  {\PackageWarning{makecell}{\string\multirowthead\space
   needs multirow package}}%
  {\let\mcell@multirow\multirow}\mcell@mrowhead@}
%    \end{macrocode}
% These macros define settings for |\multirow| arguments.
%    \begin{macrocode}
\newcommand\mcell@mrowhead@[1]{\@ifnextchar
  [{\mcell@mrowhead@@{#1}}{\mcell@mrowhead@@{#1}[0pt]}}
\@ifdefinable\mcell@mrowhead@@{}
\def\mcell@mrowhead@@#1[#2]{\edef\mcell@nrows{#1}\edef\mcell@fixup{#2}%
   \let\tabg@pe\theadgape\thead@}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mcell@multirow}
% By default |\mcell@multirow| macro gobbles |\multirow|'s arguments.
%    \begin{macrocode}
\@ifdefinable\mcell@multirow{}
\def\mcell@multirow#1#2[#3]{}%
%    \end{macrocode}
% \end{macro}
%
% Definitions for horizontal and vertical alignments, which use by \env{tabular}
% and \env{array} environments.
%
% For \texttt{l}, \texttt{r}, \texttt{t}, and \texttt{b} alignments commands
% set |c|-argument as vertical or horizontal centering alignment if necessary.
% For \texttt{l} and \texttt{r} alignments also redefined alignment
% settings for |\makecell| (|\thead|) blocks.
%    \begin{macrocode}
\newcommand\mcell@l{\def\mcell@ii{l}\let\mcell@c\mcell@ic
  \global\let\mcell@left\empty}
\newcommand\mcell@r{\def\mcell@ii{r}\let\mcell@c\mcell@ic
  \global\let\mcell@right\empty}
\newcommand\mcell@t{\def\mcell@i{t}\let\mcell@c\mcell@iic}
\newcommand\mcell@b{\def\mcell@i{b}\let\mcell@c\mcell@iic}
\newcommand\mcell@{}
%    \end{macrocode}
% If alone |c|-argument loaded it is used for horizontal alignment.
%    \begin{macrocode}
\newcommand\mcell@c{\def\mcell@ii{c}}
\newcommand\mcell@ic{\def\mcell@i{c}}
\newcommand\mcell@iic{\def\mcell@ii{c}}
%    \end{macrocode}
% Default vertical and horizontal alignment is centered.
%    \begin{macrocode}
\newcommand\mcell@i{c}
\newcommand\mcell@ii{c}
%    \end{macrocode}
%
% Default horizontal alignment of |\makecell| (|\thead|) blocks is centered.
%    \begin{macrocode}
\@ifdefinable\mcell@left{\let\mcell@left\hfill}
\@ifdefinable\mcell@right{\let\mcell@right\hfill}
%    \end{macrocode}
%
% \begin{macro}{\mcell@tabular}
% \begin{macro}{\mcell@@tabular}
% \begin{macro}{\mcell@@@tabular}
% The core macros for tabular building.
%
% Next few macros for sorting of |\makecell| (|\thead|) arguments.
%    \begin{macrocode}
\@ifdefinable\mcell@tabular{}\@ifdefinable\mcell@@tabular{}
\@ifdefinable\mcell@@@tabular{}
\def\mcell@tabular[#1]#2{\mcell@@tabular#1\@nil{#2}}
%    \end{macrocode}
% The code for this macro borrowed from \pkg{caption} 3.x package (AS).
%    \begin{macrocode}
\newcommand\mcell@ifinlist[2]{%
  \let\next\@secondoftwo
  \edef\mcell@tmp{#1}%
  \@for\mcell@Tmp:={#2}\do{%
    \ifx\mcell@tmp\mcell@Tmp
      \let\next\@firstoftwo
    \fi}\next}
%    \end{macrocode}
%
% The |\mcell@@tabular| macro at first calls |\mcell@setalign| macro for sorting of
% alignment arguments,
% then calls |\mcell@@@tabular| macro, which created tabular cell or column head.
%    \begin{macrocode}
\def\mcell@@tabular#1#2\@nil#3{%
  \expandafter\mcell@setalign\mcell@align\@nil
  \mcell@setalign{#1}{#2}\@nil
  \expandafter\mcell@@@tabular\expandafter\mcell@i\mcell@ii\@nil{#3}}
%    \end{macrocode}
%
% \begin{macro}{\mcell@setalign}
% This macro sorts arguments for vertical and horizontal alignment.
%
% First argument has second check at the end of macro for the case if
% it is |c|-argument.
%    \begin{macrocode}
\@ifdefinable\mcell@setalign{}
\def\mcell@setalign#1#2\@nil{\def\@tempa{#1}\def\@tempc{c}%
%    \end{macrocode}
% Restore default alignment for |\makecell| and |\thead| blocks.
%    \begin{macrocode}
  \global\let\mcell@left\hfill\global\let\mcell@right\hfill
%    \end{macrocode}
% If in optional argument appears alone |c|-argument it defines
% horizontal centering only.
%    \begin{macrocode}
  \def\mcell@c{\def\mcell@ii{c}}%
  \mcell@ifinlist{#1}{l,r,t,b,c,}{\@nameuse{mcell@#1}}%
%    \end{macrocode}
% If argument is not \texttt{l}, \texttt{r}, \texttt{c}, \texttt{t}, or \texttt{b}
% it could define horizontal alignment only.
%    \begin{macrocode}
      {\def\mcell@ii{#1}\let\mcell@c\mcell@ic
       \let\mcell@left\empty\let\mcell@right\empty}%
  \mcell@ifinlist{#2}{l,r,t,b,c,}{\@nameuse{mcell@#2}}%
%    \end{macrocode}
% If argument is not \texttt{l}, \texttt{r}, \texttt{c}, \texttt{t}, or \texttt{b}
% it could define horizontal alignment only.
%    \begin{macrocode}
      {\def\mcell@ii{#2}\let\mcell@c\mcell@ic
       \let\mcell@left\empty\let\mcell@right\empty}%
%    \end{macrocode}
% Here goes repeated check for first argument, if it is |c|-argument
% we call |\mcell@c| command, which can be now redefined.
%    \begin{macrocode}
  \ifx\@tempa\@tempc\mcell@c\fi
}
%    \end{macrocode}
% \end{macro}
%
% This macro builds tabular itself.
% First (and last) go commands which align |\makecell| and |\thead|
% blocks like \texttt{l}, \texttt{r}, or \texttt{c} (if they loaded).
% Then goes check whether math mode exists.
% The |\mcell@multirow| emulation macro transforms to |\multirow| when necessary.
%    \begin{macrocode}
\def\mcell@@@tabular#1#2\@nil#3{%\mcell@mstyle
  \ifdim\parindent<\z@\leavevmode\else\noindent\fi
  \null\mcell@left
      \ifmmode
         \mcell@multirow\mcell@nrows*[\mcell@fixup]{\tabg@pe
          {\hbox{\t@bset$\array[#1]{@{}#2@{}}#3\endarray$}}}%
      \else
         \mcell@multirow\mcell@nrows*[\mcell@fixup]{\tabg@pe
          {\hbox{\t@bset\tabular[#1]{@{}#2@{}}#3\endtabular}}}%
      \fi\mcell@right\null}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\cellset}
% \begin{macro}{\cellgape}
% \begin{macro}{\cellalign}
% \begin{macro}{\cellrotangle}
% \begin{macro}{\theadfont}
% \begin{macro}{\theadset}
% \begin{macro}{\theadgape}
% \begin{macro}{\rotheadgape}
% \begin{macro}{\theadalign}
% The layout macros for tabular building settings.\nopagebreak
%
% Spacing settings for tabular spacing inside cells (like |\arraystretch| or |\extrarowheight|).\nopagebreak
%    \begin{macrocode}
\newcommand\cellset{\def\arraystretch{1}\extrarowheight\z@
   \nomakegapedcells}
%    \end{macrocode}
% Vertical space around cells (created by |\gape| stuff).
%    \begin{macrocode}
\newcommand\cellgape{}
%    \end{macrocode}
% Vertical and horizontal alignment of cell text.
%    \begin{macrocode}
\newcommand\cellalign{cc}
%    \end{macrocode}
% Angle for rotated column heads and cells.
%    \begin{macrocode}
\newcommand\cellrotangle{90}
%    \end{macrocode}
%
% Font for column heads
%    \begin{macrocode}
\newcommand\theadfont{\footnotesize}
%    \end{macrocode}
% Special spacing settings for tabular spacing in column heads (like |\arraystretch| or/and |\extrarowheight|).
%    \begin{macrocode}
\newcommand\theadset{}
%    \end{macrocode}
% Vertical space around column heads (created by |\gape| stuff).
%    \begin{macrocode}
\newcommand\theadgape{\gape}
%    \end{macrocode}
% Vertical space around rotated column heads.
%    \begin{macrocode}
\newcommand\rotheadgape{}
%    \end{macrocode}
% Vertical and horizontal alignment of column head text.
%    \begin{macrocode}
\newcommand\theadalign{cc}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Gape commands}
%
% \begin{macro}{\gape}
% \begin{macro}{\setcellgapes}
% The macro itself. It uses analogous to |\smash| macro from \pkg{amsmath} package.
% Starred form has additional mandatory argument for value of |\gape|.
%    \begin{macrocode}
\newcommand\gape{\@ifnextchar[\@gape{\@gape[tb]}}
%    \end{macrocode}
%
% The |\setcellgapes| defines settings used by |\makegapedcells| command.
%
% First goes check for optional argument.
%    \begin{macrocode}
\newcommand\setcellgapes{\@ifnextchar[%]
  {\mcell@setgapes{MB}}{\mcell@setgapes{MB}[tb]}}
%    \end{macrocode}
% Then body of settings.
%    \begin{macrocode}
\@ifdefinable\@setcellgapes{}
\def\mcell@setgapes#1[#2]#3{\expandafter\let\csname
  mcell@#1@\expandafter\endcsname\csname mcell@mb@#2\endcsname
 \@namedef{mcell@#1jot}{#3}}
%    \end{macrocode}
%
% The macros which count advanced height and depth of boxes.
%    \begin{macrocode}
\newcommand\mcell@mb@t[2]{\@tempdima\ht#1\advance\@tempdima#2%
  \ht#1\@tempdima}
\newcommand\mcell@mb@b[2]{\@tempdimb\dp#1\advance\@tempdimb#2%
  \dp#1\@tempdimb}
\newcommand\mcell@mb@tb[2]{\mcell@mb@t{#1}{#2}\mcell@mb@b{#1}{#2}}
%    \end{macrocode}
%
% The body of |\gape| macros.
%    \begin{macrocode}
\@ifdefinable\@gape{}\@ifdefinable\@@gape{}
\def\@gape[#1]{\mcell@setgapes{mb}[#1]{\jot}\@@gape}
\def\@@gape{%
  \ifmmode \expandafter\mathpalette\expandafter\mathg@pe
  \else \expandafter\makeg@pe
  \fi}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\makeg@pe}
% The macros which put box with necessary parameters in text and math mode.
%    \begin{macrocode}
\newcommand\makeg@pe[1]{\setbox\z@
  \hbox{\color@begingroup#1\color@endgroup}\mcell@mb@\z@\mcell@mbjot\box\z@}
\newcommand\mathg@pe[2]{\setbox\z@
  \hbox{$\m@th#1{#2}$}\mcell@mb@\z@\mcell@mbjot\box\z@}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Gape}
% The macros which put box with necessary parameters in text and math mode.
%    \begin{macrocode}
\newcommand\Gape{\@ifnextchar[\@Gape{\@Gape[\jot]}}
\@ifdefinable\@Gape{}\@ifdefinable\@@Gape{}
\def\@Gape[#1]{\@ifnextchar[{\@@Gape[#1]}{\@@Gape[#1][#1]}}
\def\@@Gape[#1][#2]{\def\depth{\dp\z@}\def\height{\ht\z@}%
  \edef\mcell@mb@##1##2{%
    \@tempdima\ht\z@\advance\@tempdima#1\ht\z@\@tempdima
    \@tempdimb\dp\z@\advance\@tempdimb#2\dp\z@\@tempdimb}%
    \@@gape}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\topstrut}
% \begin{macro}{\botstrut}
% \begin{macro}{\bottopstrut}
% The macros abbreviations for |\strut| which changed by value of |\jot|.
% First enlarges both depth and height.
%    \begin{macrocode}
\newcommand\bottopstrut{\gape{\strut}}
%    \end{macrocode}
% Second enlarges only height.
%    \begin{macrocode}
\newcommand\topstrut{\gape[t]{\strut}}
%    \end{macrocode}
% Third enlarges only depth.
%    \begin{macrocode}
\newcommand\botstrut{\gape[b]{\strut}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Modification of command from \pkg{array} package}
%
% \begin{macro}{\makegapedcells}
% \begin{macro}{\nomakegapedcells}
% At first is saved |\@classz| macro.
%    \begin{macrocode}
\@ifdefinable\mcell@oriclassz{\let\mcell@oriclassz\@classz}
%    \end{macrocode}
% This macros redefine and restore the |\@classz| macro from \pkg{array} package.
%    \begin{macrocode}
\newcommand\makegapedcells{\let\@classz\mcell@classz}
\newcommand\nomakegapedcells{\let\@classz\mcell@oriclassz}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\mcell@agape}
% Following macro creates tabular/array cells with changed vertical spaces.
%    \begin{macrocode}
\newcommand\mcell@agape[1]{\setbox\z@\hbox{#1}\mcell@MB@\z@\mcell@MBjot
   \null\mcell@left\box\z@\mcell@right\null}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mcell@classz}
% Redefined |\@classz| macro from \pkg{array} package.
%    \begin{macrocode}
\newcommand\mcell@classz{\@classx
   \@tempcnta \count@
   \prepnext@tok
   \@addtopreamble{%\mcell@mstyle
      \ifcase\@chnum
         \hfil
         \mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
         \hskip1sp
         \mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
         \hfil\hskip1sp
         \mcell@agape{\d@llarbegin \insert@column\d@llarend}\or
         $\mcell@agape{\vcenter
         \@startpbox{\@nextchar}\insert@column\@endpbox}$\or
         \mcell@agape{\vtop
         \@startpbox{\@nextchar}\insert@column\@endpbox}\or
         \mcell@agape{\vbox
         \@startpbox{\@nextchar}\insert@column\@endpbox}%
      \fi
      \global\let\mcell@left\relax\global\let\mcell@right\relax
    }\prepnext@tok}
%    \end{macrocode}
% \end{macro}
%
% \Finale
\endinput