blob: b895f454cad615d9879d0d6aa8b7eee103fe48b3 (
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. “Alignment tabs” are the
<code>&</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>&</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 “<code>l</code>” in that solves the problem. (If you
continue from the error in this case, “<code>jim</code>” 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 ‘<code>\\</code>’ 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’re using alignment instructions in a “<code>p</code>” column:
<blockquote>
<pre>
\usepackage{array}
...
\begin{tabular}{l>{\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>’s definition of <code>\\</code>, so that
“<code>happy</code>” appears in a new line of the second column, and the
following <code>&</code> appears to LaTeX just like the second
<code>&</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> — 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="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.zip">macros/latex/required/tools</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/tools.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools/">browse</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>
|