WUT_Computer_Science/helpfulMaterials/tabular (LaTeX2e unofficial reference manual (January 2023)).html

335 lines
206 KiB
HTML
Raw Normal View History

2023-04-19 14:31:31 +02:00
<!DOCTYPE html>
<html><!-- Created by GNU Texinfo 7.0.1, https://www.gnu.org/software/texinfo/ --><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- This document is an unofficial reference manual for LaTeX, a
document preparation system, version of January 2023.
This manual was originally translated from LATEX.HLP v1.0a in the
VMS Help Library. The pre-translation version was written by
George D. Greenwade of Sam Houston State University. The
LaTeX 2.09 version was written by Stephen Gilmore. The
LaTeX2e version was adapted from this by Torsten Martinsen. Karl
Berry made further updates and additions, and gratefully acknowledges
using Hypertext Help with LaTeX, by Sheldon Green, and
LaTeX Command Summary (for LaTeX 2.09) by
L. Botway and C. Biemesderfer (published by the TeX Users
Group as TeXniques number 10), as reference material. We also
gratefully acknowledge additional material appearing in
latex2e-reference by Martin Herbert Dietze. (From these references no
text was directly copied.)
Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Karl Berry.
Copyright 1988, 1994, 2007 Stephen Gilmore.
Copyright 1994, 1995, 1996 Torsten Martinsen.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions. -->
<title>tabular (LaTeX2e unofficial reference manual (January 2023))</title>
<meta name="description" content="tabular (LaTeX2e unofficial reference manual (January 2023))">
<meta name="keywords" content="tabular (LaTeX2e unofficial reference manual (January 2023))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="http://latexref.xyz/index.html" rel="start" title="Top">
<link href="http://latexref.xyz/Index.html" rel="index" title="Index">
<link href="http://latexref.xyz/index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="http://latexref.xyz/Environments.html" rel="up" title="Environments">
<link href="http://latexref.xyz/thebibliography.html" rel="next" title="thebibliography">
<link href="http://latexref.xyz/table.html" rel="prev" title="table">
<style type="text/css">
<!--
/* $Id: latex2e.css 935 2021-07-23 17:48:15Z jimhefferon $
Minor css for latexrefman. Public domain.
Originally written by Jim Hefferon and Karl Berry, 2018. */
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
BODY {
margin-top: 1em;
margin-left: 1em; /* auto results in two-digit <ol> lost off left */
margin-right: 1em;
margin-bottom: 1em;
/* the idea is to use the whole window, unless it is ridiculously
wide, probably with too-small fonts, too. */
max-width: 64em;
}
/* Because we want @math{... @code ...} to be upright, not slanted,
and Texinfo won't fix it. */
code {font-style:normal; font-family:monospace; }
/* We put a link to our own home page at the bottom. */
div.referenceinfo {font-size:small;}
/* So you can style for yourself */
@import url("/css/latexreflocal.css");
-->
</style>
<style>.clockify-integration-popup{background:#eff4f7;box-shadow:rgba(0,0,0,.12) 0px 1px 3px,rgba(0,0,0,.24) 0px 1px 2px;width:350px;position:fixed;top:3vh;right:3vw;z-index:9999999999;color:#333;font-size:14px}.clockify-integration-popup *::selection{background:highlight;color:highlighttext}.clockify-integration-popup img,.clockify-integration-popup svg{vertical-align:inherit}.clockify-integration-popup input:not([type=image i]){box-sizing:border-box}.clockify-integration-popup input,.clockify-integration-popup textarea{box-shadow:none}.clockify-integration-popup label{display:inline-block !important;font-weight:normal}.clockify-integration-popup span{float:none}.clockify-integration-popup-close-icon{width:18px;height:18px;cursor:pointer;position:absolute;top:16px;right:20px}.clockify-integration-popup-header{height:20px}.clockify-integration-popup .toaster__container{position:absolute !important}.clockify-integration-popup .projects-list{display:block}.clockify-integration-popup .ant-switch{min-height:auto}#clockifyButton,#clockifySmallButton{display:inline-flex;justify-content:center;align-items:center;font-size:14px}#clockifyButton img,#clockifyButton svg,#clockifySmallButton img,#clockifySmallButton svg{vertical-align:inherit}.clockify-button-active{color:#03a9f4}.clockify-button-inactive{color:#444}.clockify-input{border:1px solid #c6d2d9;border-radius:2px;width:134px;padding-left:7px;height:30px;font-size:14px}.clockify-input:focus,.clockify-input:hover{outline:none;box-shadow:0 0 4px rgba(0,0,0,.05);border:1px solid #03a9f4;background-color:#fff}.clockify-input.clockify-input-default{border-color:#c6d2d9;color:#333;background-color:#fff}.clockify-input.clockify-input-success{border-color:#cde9ce;color:#285b2a;background-color:#dbefdc}.clockify-input.clockify-input-error{border-color:#fccac7;color:#7f231c;background-color:#fdd9d7}.clockify-manual-entry-header-text{margin-left:20px}.clockify-trello-card .clockifyButton{visibility:hidden}.clockify-trello-card:hover .clockifyButton{visibility:visible}.clockify-trello-card:not(:hover) .clockifyButton{visibility:hidden}.clockify-trello-card:not(:hover) .clockifyButton.active{visibility:visible}.clockify-trello-card:not(:hover) .clockifyButton:not(.active){visibility:hidden}.clockify-integration-popup{@import'~@fontsource/roboto/400.css';@import'~@fontsource/roboto/700.css'}.clockify-integration-popup .ant-switch{margin:0;padding:0;color:rgba(0, 0, 0, 0.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:relative;display:inline-block;box-sizing:border-box;min-width:44px;height:22px;line-height:22px;vertical-align:middle;background-color:rgba(0, 0, 0, 0.25);border:0;border-radius:100px;cursor:pointer;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.clockify-integration-popup .ant-switch:focus{outline:0;box-shadow:0 0 0 2px rgba(0, 0, 0, 0.1)}.clockify-integration-popup .ant-switch-checked:focus{box-shadow:0 0 0 2px #e6f7ff}.clockify-integration-popup .ant-switch:focus:hover{box-shadow:none}.clockify-integration-popup .ant-switch-checked{background-color:#1890ff}.clockify-integration-popup .ant-switch-loading,.clockify-integration-popup .ant-switch-disabled{cursor:not-allowed;opacity:.4}.clockify-integration-popup .ant-switch-loading *,.clockify-integration-popup .ant-switch-disabled *{box-shadow:none;cursor:not-allowed}.clockify-integration-popup .ant-switch-inner{display:block;margin:0 7px 0 25px;color:#fff;font-size:12px;transition:margin .2s}.clockify-integration-popup .ant-switch-checked .ant-switch-inner{margin:0 25px 0 7px}.clockify-integration-popup .ant-switch-handle{position:absolute;top:2px;left:2px;width:18px;height:18px;transition:all .2s ease-in-out}.clockify-integration-popup .ant-switch-handle::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:#fff;border-radius:9px;box-shadow:0 2px 4px 0 rgba(0, 35, 11, 0.2);transition:all .2s ease-in-out;content:""}.clockify-integration-popup .ant-switch-checked .ant-switch-hand
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3Nhc3MvX2ludGVncmF0aW9uLnNjc3MiLCJ3ZWJwYWNrOi8vLi9zYXNzL3ZhcmlhYmxlcy9fY29sb3JzLnNjc3MiLCJ3ZWJwYWNrOi8vLi9zYXNzL21haW4taW50ZWdyYXRpb24uc2NzcyIsIndlYnBhY2s6Ly8uL3Nhc3MvX2dsb2JhbC5zY3NzIiwid2VicGFjazovLy4vbm9kZV9tb2R1bGVzL2FudGQvbGliL3N3aXRjaC9zdHlsZS9pbmRleC5jc3MiLCJ3ZWJwYWNrOi8vLi9zYXNzL19zdGFydC10aW1lci5zY3NzIiwid2VicGFjazovLy4vc2Fzcy9fZHVyYXRpb24uc2NzcyIsIndlYnBhY2s6Ly8uL3Nhc3MvX2VkaXQtZm9ybS5zY3NzIiwid2VicGFjazovLy4vc2Fzcy9fcHJvamVjdHMtbGlzdC5zY3NzIiwid2VicGFjazovLy4vc2Fzcy9fdGFnLWxpc3Quc2NzcyIsIndlYnBhY2s6Ly8uL3Nhc3MvX3BvcHB1cC1tb2RhbC5zY3NzIiwid2VicGFjazovLy4vc2Fzcy9fY3V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Q0FDQyxZQUFBLENBR0Qsc0RBQ0MsV0FBQSxDQUNBLFdBQUEsQ0FDQSxVQUFBLENBQ0EsV0FBQSxDQUNBLGlCQUFBLENBQ0Esa0JKdkNNLENJd0NOLGFKbkNZLENJb0NaLGNBQUEsQ0FHRCw0REFDQyxrQkoxQ1ksQ0k2Q2IsMkRBQ0MsVUFBQSxDQUNBLFVBQUEsQ0FDQSxpQkFBQSxDQUNBLFFBQUEsQ0FDQSxZQUFBLENBR0Qsc0VBQ0MsWUFBQSxDQUdELHFEQUNDLGlCQUFBLENBQ0EsbUJBQUEsQ0FDQSxLQUFBLENBQ0EsUUFBQSxDQUNBLGtCQUFBLENBQ0EsY0FBQSxDQUNBLFNBQUEsQ0FDQSxXQUFBL
<body lang="en">
<div class="section-level-extent" id="tabular">
<div class="nav-panel">
<p>
Next: <a href="http://latexref.xyz/thebibliography.html" accesskey="n" rel="next"><code class="code">thebibliography</code></a>, Previous: <a href="http://latexref.xyz/table.html" accesskey="p" rel="prev"><code class="code">table</code></a>, Up: <a href="http://latexref.xyz/Environments.html" accesskey="u" rel="up">Environments</a> &nbsp; [<a href="http://latexref.xyz/index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="http://latexref.xyz/Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="tabular-1">8.23 <code class="code">tabular</code></h3>
<a class="index-entry-id" id="index-environment_002c-tabular"></a>
<a class="index-entry-id" id="index-tabular-environment"></a>
<a class="index-entry-id" id="index-lines-in-tables"></a>
<a class="index-entry-id" id="index-lining-text-up-in-tables"></a>
<p>Synopsis:
</p>
<div class="example">
<pre class="example-preformatted">\begin{tabular}[<var class="var">pos</var>]{<var class="var">cols</var>}
<var class="var">column 1 entry</var> &amp;<var class="var">column 2 entry</var> ... &amp;<var class="var">column n entry</var> \\
...
\end{tabular}
</pre></div>
<p>or
</p>
<div class="example">
<pre class="example-preformatted">\begin{tabular*}{<var class="var">width</var>}[<var class="var">pos</var>]{<var class="var">cols</var>}
<var class="var">column 1 entry</var> &amp;<var class="var">column 2 entry</var> ... &amp;<var class="var">column n entry</var> \\
...
\end{tabular*}
</pre></div>
<p>Produce a table, a box consisting of a sequence of horizontal rows.
Each row consists of items that are aligned vertically in columns. This
illustrates many of the features.
</p>
<div class="example">
<pre class="example-preformatted">\begin{tabular}{l|l}
\textit{Player name} &amp;\textit{Career home runs} \\
\hline
Hank Aaron &amp;755 \\
Babe Ruth &amp;714
\end{tabular}
</pre></div>
<p>The output will have two left-aligned columns with a vertical bar
between them. This is specified in <code class="code">tabular</code>s argument
<code class="code">{l|l}</code>.
<a class="index-entry-id" id="index-_0026-_0028for-table-cells_0029"></a>
Put the entries into different columns by separating them with an
ampersand, <code class="code">&amp;</code>. The end of each row is marked with a double
backslash, <code class="code">\\</code>. Put a horizontal rule below a row, after a double
backslash, with <code class="code">\hline</code>.
<a class="index-entry-id" id="index-_005c_005c-_0028for-tabular_0029"></a>
After the last row the <code class="code">\\</code> is optional, unless an <code class="code">\hline</code>
command follows to put a rule below the table.
</p>
<p>The required and optional arguments to <code class="code">tabular</code> consist of:
</p>
<dl class="table">
<dt><var class="var">pos</var></dt>
<dd><p>Optional. Specifies the tables vertical position. The default is to
align the table so its vertical center matches the baseline of the
surrounding text. There are two other possible alignments: <code class="code">t</code>
aligns the table so its top row matches the baseline of the surrounding
text, and <code class="code">b</code> aligns on the bottom row.
</p>
<p>This only has an effect if there is other text. In the common case of a
<code class="code">tabular</code> alone in a <code class="code">center</code> environment this option makes
no difference.
</p>
</dd>
<dt><var class="var">cols</var></dt>
<dd><p>Required. Specifies the formatting of columns. It consists of a
sequence of the following specifiers, corresponding to the types of
column and intercolumn material.
</p>
<dl class="table">
<dt><code class="code">l</code></dt>
<dd><p>A column of left-aligned items.
</p>
</dd>
<dt><code class="code">r</code></dt>
<dd><p>A column of right-aligned items.
</p>
</dd>
<dt><code class="code">c</code></dt>
<dd><p>A column of centered items.
</p>
</dd>
<dt><code class="code">|</code></dt>
<dd><p>A vertical line the full height and depth of the environment.
</p>
</dd>
<dt><code class="code">@{<var class="var">text or space</var>}</code></dt>
<dd><p>Insert <var class="var">text or space</var> at this location in every row. The <var class="var">text
or space</var> material is typeset in LR mode. This text is fragile
(see <a class="pxref" href="http://latexref.xyz/_005cprotect.html"><code class="code">\protect</code></a>).
</p>
<p>If between two column specifiers there is no @-expression then
LaTeXs <code class="code">book</code>, <code class="code">article</code>, and <code class="code">report</code> classes will
put on either side of each column a space of width <code class="code">\tabcolsep</code>,
which by default is 6<span class="dmn">pt</span>. That is, by default adjacent columns are
separated by 12<span class="dmn">pt</span> (so <code class="code">\tabcolsep</code> is misleadingly named
since it is only half of the separation between tabular columns). In
addition, a space of <code class="code">\tabcolsep</code> also comes before the first
column and after the final column, unless you put a <code class="code">@{...}</code>
there.
</p>
<p>If you override the default and use an @-expression then LaTeX does
not insert <code class="code">\tabcolsep</code> so you must insert any desired space
yourself, as in <code class="code">@{\hspace{1em}}</code>.
</p>
<p>An empty expression <code class="code">@{}</code> will eliminate the space. In
particular, sometimes you want to eliminate the space before the first
column or after the last one, as in the example below where the
tabular lines need to lie on the left margin.
</p>
<div class="example">
<pre class="example-preformatted">\begin{flushleft}
\begin{tabular}{@{}l}
...
\end{tabular}
\end{flushleft}
</pre></div>
<p>The next example shows text, a decimal point between the columns,
arranged so the numbers in the table are aligned on it.
</p>
<div class="example">
<pre class="example-preformatted">\begin{tabular}{r@{$.$}l}
$3$ &amp;$14$ \\
$9$ &amp;$80665$
\end{tabular}
</pre></div>
<a class="anchor" id="g_t_005cextracolsep"></a><a class="index-entry-id" id="index-_005cextracolsep"></a>
<p>An <code class="code">\extracolsep{<var class="var">wd</var>}</code> command in an @-expression causes an
extra space of width <var class="var">wd</var> to appear to the left of all subsequent
columns, until countermanded by another <code class="code">\extracolsep</code>. Unlike
ordinary intercolumn space, this extra space is not suppressed by an
@-expression. An <code class="code">\extracolsep</code> command can be used only in an
@-expression in the <code class="code">cols</code> argument. Below, LaTeX inserts the
right amount of intercolumn space to make the entire table 4 inches
wide.
</p>
<div class="example">
<pre class="example-preformatted">\begin{tabular*}{4in}{l@{\extracolsep{\fill}}l}
Seven times down, eight times up \ldots
&amp;such is life!
\end{tabular*}
</pre></div>
<p>To insert commands that are automatically executed before a given
column, load the <code class="code">array</code> package and use the <code class="code">&gt;{...}</code>
specifier.
</p>
</dd>
<dt><code class="code">p{<var class="var">wd</var>}</code></dt>
<dd><p>Each item in the column is typeset in a parbox of width <var class="var">wd</var>, as if
it were the argument of a <code class="code">\parbox[t]{wd}{...}</code> command.
</p>
<p>A line break double backslash <code class="code">\\</code> may not appear in the item,
except inside an environment like <code class="code">minipage</code>, <code class="code">array</code>, or
<code class="code">tabular</code>, or inside an explicit <code class="code">\parbox</code>, or in the scope of
a <code class="code">\centering</code>, <code class="code">\raggedright</code>, or <code class="code">\raggedleft</code>
declaration (when used in a <code class="code">p</code>-column element these declarations
must appear inside braces, as with <code class="code">{\centering .. \\
..}</code>). Otherwise LaTeX will misinterpret the double backslash as
ending the tabular row. Instead, to get a line break in there use
<code class="code">\newline</code> (see <a class="pxref" href="http://latexref.xyz/_005cnewline.html"><code class="code">\newline</code></a>).
</p>
</dd>
<dt><code class="code">*{<var class="var">num</var>}{<var class="var">cols</var>}</code></dt>
<dd><p>Equivalent to <var class="var">num</var> copies of <var class="var">cols</var>, where <var class="var">num</var> is a
positive integer and <var class="var">cols</var> is a list of specifiers. Thus the
specifier <code class="code">\begin{tabular}{|*{3}{l|r}|}</code> is equivalent to
the specifier <code class="code">\begin{tabular}{|l|rl|rl|r|}</code>. Note that
<var class="var">cols</var> may contain another <code class="code">*</code>-expression.
</p>
</dd>
</dl>
</dd>
<dt><var class="var">width</var></dt>
<dd><p>Required for <code class="code">tabular*</code>, not allowed for <code class="code">tabular</code>. Specifies
the width of the <code class="code">tabular*</code> environment. The space between columns
should be rubber, as with <code class="code">@{\extracolsep{\fill}}</code>, to allow
the table to stretch or shrink to make the specified width, or else you
are likely to get the <code class="code">Underfull \hbox (badness 10000) in alignment
...</code> warning.
</p>
</dd>
</dl>
<p>Parameters that control formatting:
</p>
<dl class="ftable">
<dt id="index-_005carrayrulewidth"><span><code class="code">\arrayrulewidth</code><a class="copiable-link" href="#index-_005carrayrulewidth"></a></span></dt>
<dd><a class="anchor" id="tabular-arrayrulewidth"></a><p>A length that is the thickness of the rule created by <code class="code">|</code>,
<code class="code">\hline</code>, and <code class="code">\vline</code> in the <code class="code">tabular</code> and <code class="code">array</code>
environments. The default is <samp class="samp">.4pt</samp>. Change it as in
<code class="code">\setlength{\arrayrulewidth}{0.8pt}</code>.
</p>
</dd>
<dt id="index-_005carraystretch"><span><code class="code">\arraystretch</code><a class="copiable-link" href="#index-_005carraystretch"></a></span></dt>
<dd><a class="anchor" id="tabular-arraystrech"></a><p>A factor by which the spacing between rows in the <code class="code">tabular</code> and
<code class="code">array</code> environments is multiplied. The default is <samp class="samp">1</samp>, for
no scaling. Change it as <code class="code">\renewcommand{\arraystretch}{1.2}</code>.
</p>
</dd>
<dt id="index-_005cdoublerulesep"><span><code class="code">\doublerulesep</code><a class="copiable-link" href="#index-_005cdoublerulesep"></a></span></dt>
<dd><a class="anchor" id="tabular-doublerulesep"></a><p>A length that is the distance between the vertical rules produced by the
<code class="code">||</code> specifier. The default is <samp class="samp">2pt</samp>.
</p>
</dd>
<dt id="index-_005ctabcolsep"><span><code class="code">\tabcolsep</code><a class="copiable-link" href="#index-_005ctabcolsep"></a></span></dt>
<dd><a class="anchor" id="tabular-tabcolsep"></a><p>A length that is half of the space between columns. The default is
<samp class="samp">6pt</samp>. Change it with <code class="code">\setlength</code>.
</p>
</dd>
</dl>
<p>The following commands can be used inside the body of a <code class="code">tabular</code>
environment, the first two inside an entry and the second two between
lines:
</p>
<ul class="mini-toc">
<li><a href="http://latexref.xyz/_005cmulticolumn.html" accesskey="1"><code class="code">\multicolumn</code></a></li>
<li><a href="http://latexref.xyz/_005cvline.html" accesskey="2"><code class="code">\vline</code></a></li>
<li><a href="http://latexref.xyz/_005ccline.html" accesskey="3"><code class="code">\cline</code></a></li>
<li><a href="http://latexref.xyz/_005chline.html" accesskey="4"><code class="code">\hline</code></a></li>
</ul>
</div>
<hr><div class="referenceinfo"> <a href="https://latexref.xyz/"> <i>Unofficial LaTeX2e reference manual</i></a></div>
</body></html>