答案1
参数应该\begin{tabular}
包含所需列的规范。标准合法说明符是
c
用于居中列;l
对于左对齐的列;r
对于右对齐的列;|
在列之间(或表格两侧)添加垂直线;p
对于“段落”列,但它后面应该跟有宽度规范,如p{2cm}
(任何长度规范均有效);@
对于列间内容与标准间距不同的内容,例如在 后面用大括号括起来的内容@
,@{}
将删除列间间距,@{+}
将插入+
而不是 空格。
可以使用简写
*{<number>}{<specifiers>}
用于将一组列说明符重复给定次数。在您的例子中,您需要 18 组c|
以单个 开头的形式|
,因此
\begin{tabular}{ | *{18}{c|} }
比同等的更容易阅读
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
您的代码中会出现大量以下形式的错误
! LaTeX Error: Illegal character in array arg.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.5 ...lar}{|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|}
这些问题是由于 而引发a b d e f g h i j k m n o q
的,这是非法的(而 LaTeX 会尝试用 来恢复c
)。还有
! Missing number, treated as zero.
<to be read again>
|
l.7 ...&3& 4 &5& 6& 7& 8& 9& 10& 11& 12& 13& 14& 1
5& 16& 17 \\
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
|
l.7 ...&3& 4 &5& 6& 7& 8& 9& 10& 11& 12& 13& 14& 1
5& 16& 17 \\
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
这是因为p
后面跟着的是|
而不是括号中的长度。
由于错误恢复,有一些输出,但仅此而已。绝不忽略排版过程中的错误。