summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-altabcr.html
blob: 6b018e33a4832047c3e4dcdc1f894258fe17ba80 (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
<head>
<title>UK TeX FAQ -- question label altabcr</title>
</head><body>
<h3>Alignment tab changed to <code>\</code><code>cr</code></h3>
<p/>This is an error you may encounter in LaTeX when a tabular
environment is being processed.  &#8220;Alignment tabs&#8221; are the
<code>&#38;</code> signs that separate the columns of a tabular; so the error
message
<blockquote>

<pre>
! Extra alignment tab has been changed to \cr
</pre>
</blockquote><p>
could arise from a simple typo, such as:
<blockquote>
<pre>
\begin{tabular}{ll}
  hello   & there & jim \\
  goodbye & now
\end{tabular}
</pre>
</blockquote><p>
where the second <code>&#38;</code> in the first line of the table is more than the
two-column <code>ll</code> column specification can cope with. In this
case, an extra &#8220;<code>l</code>&#8221; in that solves the problem.  (If you
continue from the error in this case, &#8220;<code>jim</code>&#8221; will be moved
to a row of his own.)  Another simple typo that can provoke the error
is:
<blockquote>
<pre>
\begin{tabular}{ll}
  hello   & there
  goodbye & now
\end{tabular}
</pre>
</blockquote><p>
where the &#8216;<code>\\</code>&#8217; has been missed from the first line of the table.
In this case, if you continue from the error, you will find that
LaTeX has made a table equivalent to:
<blockquote>
<pre>
\begin{tabular}{ll}
  hello   & there goodbye\\
  now
\end{tabular}
</pre>
</blockquote><p>
(with the second line of the table having only one cell).
<p/>Rather more difficult to spot is the occurrence of the error when
you&#8217;re using alignment instructions in a &#8220;<code>p</code>&#8221; column:
<blockquote>
<pre>
\usepackage{array}
...
\begin{tabular}{l&#62;{\raggedright}p{2in}}
here & we are again \\
happy & as can be
\end{tabular}
</pre>
</blockquote><p>
the problem here (as explained in 
<a href="FAQ-tabcellalign.html">tabular cell alignment</a>) is that the
<code>\</code><code>raggedright</code> command in the column specification has overwritten
<code>tabular</code>&#8217;s definition of <code>\\</code>, so that
&#8220;<code>happy</code>&#8221; appears in a new line of the second column, and the
following <code>&#38;</code> appears to LaTeX just like the second
<code>&#38;</code> in the first example above.
<p/>Get rid of the error in the way described in 
<a href="FAQ-tabcellalign.html">tabular cell alignment</a> &#8212; either use
<code>\</code><code>tabularnewline</code> explicitly, or use the <code>\</code><code>RBS</code> trick described
there.
<dl>
<dt><tt><i>array.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools.zip">macros/latex/required/tools</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/array.html">catalogue entry</a>
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=altabcr">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=altabcr</a>
</body>