Example: tourism industry

The makecell package - ibiblio

Themakecellpackage Olga package helps to create common layout for tabular material. The\theadcommand, based on one-column tabular environment, is offered forcreation of tabular column heads. This macro allows to support commonlayout for tabular column heads in whole documentation. Another com-mand,\ makecell , is offered for creation of multilined tabular cells. Thereare also command\makecellboxcommand andmcellboxenvironment usageof tabular cells inside also offers:1) macro\makegapedcells, which changes ver-tical spaces around all cells in tabular, like intablspackage, but usescode ofarraypackage. (Macro\makegapedcellsredefines Macro\nomakegapedcellscancels this redefinition.);2) macros\multirowheadand\multirowcell, which use\multirowmacrofrommultirowpackage;3) numbered rows\nlineor skipping cells\elinein tabulars; also are the skipping rows command\erowsand repeated rowscommand\Xrows;4) diagonally divided cells (\diaghead) plus citationof sample file ofslashboxpackage, which does the same;5)\hlineand\clinewith defined thickness:\Xhlineand\Xclineconsequently.

When you de ne column alignment like {p{3cm}} in optional argu-ment of \makecell (or \thead, see below), please follow these rules: 1) if vertical alignment de ned, write column alignment in group, e.g. [c{p{3cm}}]; 2) if vertical alignment is absent, write column alignment in double group|

Tags:

  Ment, Argus, Argu ment

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of The makecell package - ibiblio

1 Themakecellpackage Olga package helps to create common layout for tabular material. The\theadcommand, based on one-column tabular environment, is offered forcreation of tabular column heads. This macro allows to support commonlayout for tabular column heads in whole documentation. Another com-mand,\ makecell , is offered for creation of multilined tabular cells. Thereare also command\makecellboxcommand andmcellboxenvironment usageof tabular cells inside also offers:1) macro\makegapedcells, which changes ver-tical spaces around all cells in tabular, like intablspackage, but usescode ofarraypackage. (Macro\makegapedcellsredefines Macro\nomakegapedcellscancels this redefinition.);2) macros\multirowheadand\multirowcell, which use\multirowmacrofrommultirowpackage;3) numbered rows\nlineor skipping cells\elinein tabulars; also are the skipping rows command\erowsand repeated rowscommand\Xrows;4) diagonally divided cells (\diaghead) plus citationof sample file ofslashboxpackage, which does the same;5)\hlineand\clinewith defined thickness:\Xhlineand\Xclineconsequently.

2 This file has version number , last revised 2009/08 Tabular Cells and Column Building Commands .. Settings For Tabular Cells .. Settings For Column Heads ..62 Changing of Height and Depth of Boxes73 How to Change Vertical Spaces Around Cells in Whole Table84 Multirow Table Heads and Multirow Table Heads and Cells: Second Variant ..135 Numbered Lines in Tabulars146 Cells (One-Column Tabulars) in the Text157 Diagonally Divided Cell168 Comparison: Diagonally Divided Cell with the slashbox package 189 Thick Rules for the hline and cline Commands2110 Code of Multilined cells .. Gape commands .. Modification of command fromarraypackage .. Rows of skipped and numbered cells .. Diagonally separated column heads .. The\hlineand\clinewith necessary thickness ..3421 Tabular Cells and Column Building CommandsMacro creates one-column tabular with predefined common settings of alignment,\makecellspacing and vertical spaces around (see section ).

3 This will be useful for creationof multilined cells. This macro allows optional alignment settings.\ makecell [ vertical or/and horizontal alignment ]{ cell text }For vertical alignment you uset,b, orc this letters you usually put in op-tional argument oftabularorarrayenvironments. For horizontal alignmentyou may use alignment settings liker,l, orc, or more complex, like{p{3cm}}.Since this package loadsarraypackage, you may use such alignment settings like{>{\parindent1cm}p{3cm}}.\begin{tabu lar}{|c|c|}\hlineCell 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}}}]{Cel l long text with predefined width} & 52--58\\\hline\ makecell [{{>{\parindent1e m}p{3cm}}}]{Cell } & 52--58\\\hline\end{tabular}Starred form of command,\ makecell *, creates vertical\jotspaces When you define column alignment like{p{3cm}}in optional argu- ment of\ makecell (or\thead, see below), please follow these rules:1) ifvertical alignment defined, write column alignment in group, [c{p{3cm}}];2) if vertical alignment is absent, write column alignment in double group [{{p{3cm}}}], or add empty group [{}{p{3cm}}].

4 Be also careful with ver-tical alignment when you define column alignment as paragraph block: , use{{b{3cm}}}for bottom alignment (and{{m{3cm}}}for centered vertical align- ment ).Macro creates one-columntabularfor column heads with predefined common\theadsettings (see table 2). This macro uses common layout for column heads: font,alignment, spacing, and vertical spaces around (see section ).\renewcommand\theadset{\def\arraystret ch{.85}}%\begin{tabular}{|l|c|}\hline3 Table of multilinedcellsCell text28 31 Multilinedcell text28 31 Left alignedcell text37 43 Right alignedcell text37 43 Bottom alignedcell text52 58 Cell long text withpredefined width52 58 Cell long text withpredefined width52 58\thead{First column head}&\thead{Second \\multlined \\ column head}\\\hlineLeft column text & 28--31\\\hline\end{tabular}Table of column headsFirst column headSecondmultlinedcolumn headLong left column text28 31 Starred form of command,\thead*, creates vertical\jotspaces table heads rotated by 90 counterclockwise.

5 Macro uses the same\rotheadfont and spacing settings as previous one, but column alignment changed top{\rotheadsize}with\raggedrightjustifi cation: in this case left side of alltext lines lies on one base parameter defines the width of rotated tabular heads. You may define\rotheadsizethat like:\setlength\rotheadsize{3cm}or\setto width\rotheadsize{\theadfont Widest head text }like in following example (table 3):\settowidth\rotheadsize{\theadfont Second multilined}\begin{tabular}{|l|c|}4\hline \thead{First column head}&\rothead{Second multilined \\ column head}\\\hlineLeft column text & 28--31\\\hline\end{tabular}Table of rotated col-umn headsFirst column headSecond multilinedcolumn headLong left column text28 Settings For Tabular CellsThis section describes macros, which make layout tuning for multilined cells, cre-ated by\makecellmacro (and also\multirowcelland\rotcellmacros). The\cellsetmacro also is used by\thead(\rothead,\multirowtead) settings for cells.

6 Here you could use commands like:\cellset\renewcommand\cellset{\rene wcommand\arraytretch{1}%\setlength\extra rowheight{0pt}}as was defined in current align for cells. package offers vertical and horizontal centering align-\cellalignment, it defined like:\renewcommand\cellalign{cc}Define vertical spaces around\ makecell , using\gapecommand if necessary.\cellgapeIt defined like:\renewcommand\cellgape{}You may define this command like\renewcommand\cellgape{\Gape[1pt]}or \renewcommand\cellgape{\gape[t]}(See also section 2 about\gapeand\Gapecommand.)The angle for rotated cells and column heads. The default value 90 (counter-\cellrotangleclockwise). This value definition is used by both\rotcelland\ Settings For Column HeadsThis section describes macros, which make layout tuning for tabular column heads,created by\thead(\rothead,\multirowtead) a special font for column heads. It could be smaller size\theadfont\renewcommand\theadfont{\f oonotesize}as was defined in current package (here we suppose that\smallcommand usedfor tabular contents itself).

7 Next example defines italic shape\renewcommand\theadfont{\itshape}Sp acing settings for column heads. Here you could use commands like:\theadset\renewcommand\theadset{\re newcommand\arraytretch{1}%\setlength\ext rarowheight{0pt}}Default align for tabular column heads. Here also offered centering alignment:\theadalign\renewcommand\thead align{cc}Define vertical spaces around column head (\thead), using\gapecommand if\theadgapenecessary. It defined like:\renewcommand\theadgape{\gape}Analo gous definition for rotated column heads. Default is absent:\rotheadgape\renewcommand\rothead gape{}62 Changing of Height and Depth of BoxesSometimestabularorarraycells, or some elements in text need a height/depthcorrection. The\raiseboxcommand could help for it, but usage of that macro inthese cases, especially inside math, is rather complex. Current package offers the\gapemacro, which usage is similar to\smashmacro. The\gapemacro allowsto change height and/or depth of included box with necessary macro changes included box by\jotvalue (usually 3 pt).

8 It is defined\gapewith optional and mandatory arguments, like\smashmacro, which (re)definedbyamsmathpackage. Optional argument sets change of height only (t) or depthonly (b). Mandatory argument includes text.\gape[ torb ]{ text }Examples of usage:\gape{text}\gape[t]{text}\gape[b]{ text}Another way of height/depth modification. This macro allows different correc-\Gapetion for height and depth of box:\Gape[ height corr ][ depth corr ]{ text }If both arguments absent,\Gapecommand works like\gape{ text }, in otherwords, command uses\jotas correction value for height and depth of only one optional argument exists,\Gapecommand uses value from thisargument for both height and depth box corrections.\Gape{text}\Gape[\jot]{text} \Gape[6pt]{text}\Gape[6pt][-2pt]{text}Yo u may also use\heightand\depthparameters in optional arguments of\Gapemacro, parameters was borrowed from\ three macros modify standard\strutby\jotvalue:\bottopstrut\b ottopstrut\topstrut\botstrutchanges both height and depth;\topstrutchanges only height;\botstrutchanges only depth.

9 These commands could be useful, for example, in first andlast table If you usebigstrutpackage note that these macros duplicate\bigstrut,\bigstrut[t], and\bigstrut[b]commands consequently. Please note thatvalue, which increases strut in\topstrutetc. equals to\jot, but\bigstrutand others use a special dimension\ How to Change Vertical Spaces Around Cellsin Whole TableThis section describes macros which try to emulate one of possibilities oftablspackage: to get necessary vertical spacing around the parameters for vertical spaces:\setcellgapes\setcellgapes[ torb ]{ value }The next examples with array and tabular use following settings:\setcellgapes{5pt}You may also try to load negative values if you wish. This macro you may put inthe preamble as common first macro switches on vertical spacing settings. The second cancels\makegapedcells\nomakegapedcellsf irst \makegapedcellsmacro temporarily redefines macro\@classzofarraypackage, so use this mechanism carefully.

10 Load\makegapedcellsinside group orinside environment (see table 4):\begin{table}[h]\ \end{table}Please note that space defined in\setcellgapesand space which creates\gapemechanism in commands for tabular cells (usually\theador\ makecell *)are of multi-lined cells with additional verticalspacesCell text28 31 Multilinedcell text28 31 Left alignedcell text37 43 Right alignedcell text37 43 Bottom alignedcell text52 58 Cell long text withpredefined width52 58 Cell long text withpredefined width52 5894 Multirow Table Heads and CellsThe next examples show usage of macros which use\multirowcommand first goes short repetition of arguments of\multirowmacro itself:\multirow{ nrow }[ njot ]{ width }[ vmove ]{ contents }{ nrow }sets number of rows ( text lines);[ njot ]is mainly used if you veusedbigstrutpackage: it makes additional tuning of vertical position (see com-ments inmultirowpackage);{ width }defines width of contents, the*sign usedto indicate that the text argument s natural width is to be used;[ vmove ]isa length used for fine tuning: the text will be raised (or lowered, if vmove isnegative) by that length;{ contents }includes \multirow ed two macros use following arguments (example uses\multirowcellcom-\multirowcell\multi rowtheadmand):\multirowcell{ nrow }[ vmove ][ hor alignment ]{ contents }in these macros were skipped[ njot ]and{ width }.


Related search queries