summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-altabcr.html
blob: 5c3ce9b95d40d5e18ea23f72c6511725b1ca7bfa (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
<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>&amp;</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>
could arise from a simple typo, such as:
<blockquote>
<pre>
\begin{tabular}{ll}
  hello   & there & jim \\
  goodbye & now
\end{tabular}
</pre>
</blockquote>
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 - an extra
"<code>l</code>" in that solves the problem.  (As a result of the error,
"<code>jim</code>" will be moved to a row of his own.)
<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&gt;{\raggedright}p{2in}}
here & we are again \\
happy & as can be
\end{tabular}
</pre>
</blockquote>
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>&amp;</code> appears to LaTeX just like the second
<code>&amp;</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>