tabularx 环境错误:以括号开头时“\@argarraycr 的参数有一个额外的}”

tabularx 环境错误:以括号开头时“\@argarraycr 的参数有一个额外的}”

以下是使用以下方式创建表的 MWE tabularx

\documentclass[border=5mm]{standalone}
\usepackage{tabularx}
\begin{document}

\begin{tabularx}{1.0\linewidth}{X}
  header 1 \\
  [unit 1) \\ % Does not work.
  % (unit 1) \\ % Works.
\end{tabularx}
\end{document}

这给了我以下错误:

错误:\@argarraycr 的参数有一个多余的}。

以下是完整的日志:

Running `LaTeX' on `table_line_start' with ``pdflatex  -file-line-error   -interaction=nonstopmode "\input" table_line_start.tex''
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2017-04-15>
Babel <3.16> and hyphenation patterns for 84 language(s) loaded.
(./table_line_start.tex
(/usr/local/texlive/2017/texmf-dist/tex/latex/standalone/standalone.cls
Document Class: standalone 2015/07/15 v1.2 Class to compile TeX sub-files standalone
(/usr/local/texlive/2017/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/local/texlive/2017/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2017/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/usr/local/texlive/2017/texmf-dist/tex/latex/standalone/standalone.cfg)
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo)))
(/usr/local/texlive/2017/texmf-dist/tex/latex/tools/tabularx.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/tools/array.sty))
(./table_line_start.aux)
./table_line_start.tex:10: Argument of \@argarraycr has an extra }.
<inserted text> 
               \par 
l.10 \end{tabularx}

Runaway argument?
unit 1) \\ \endtabular 
./table_line_start.tex:10: Paragraph ended before \@argarraycr was complete.
<to be read again> 
               \par 
l.10 \end{tabularx}

...

(That makes 100 errors; please try again.)
./table_line_start.tex:10:  ==> Fatal error occurred, no output PDF file produced!
Transcript written on table_line_start.log.

TeX Output exited abnormally with code 1 at Tue Feb 20 13:50:51

当我用圆括号代替[前面的括号时,错误消失了。书写没有问题。有人能确认这是一个错误吗?unit 1([header 1

答案1

问题导致单元格中出现方括号。它必须嵌入花括号中(单独或完整内容):

\documentclass[border=5mm]{standalone}
\usepackage{tabularx}
\begin{document}

\begin{tabularx}{1.0\linewidth}{X}
  header 1 \\
  {[unit 1)}
\end{tabularx}
\end{document}

在此处输入图片描述

相关内容