![beamer、tabular* 和 array - 非法前置标记](https://linux22.com/image/371686/beamer%E3%80%81tabular*%20%E5%92%8C%20array%20-%20%E9%9D%9E%E6%B3%95%E5%89%8D%E7%BD%AE%E6%A0%87%E8%AE%B0.png)
我正在尝试将表格* 放入投影仪页面。但是,它会产生大量错误。我搜索了 stackexchange 和 google,但无法自己理解或解决问题。
您能帮助我理解并修复错误信息吗?
注 1:框架本身看起来不错,我只需要了解错误消息。注 2:序言包含我演示中其他框架所需的命令和包。
多谢!
\documentclass[xcolor=table]{beamer}
\usetheme{default}
\setbeamerfont*{frametitle}{size=\normalsize}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{lmodern, textcomp}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{booktabs, makecell, tabularx, threeparttable}
\usepackage{adjustbox}
\usepackage{natbib}
\usepackage{mathabx}
\usepackage{tikz}
\usepackage{ragged2e}
\usepackage{graphicx}
\usetikzlibrary{arrows}
\tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]
\newcommand{\beginbackup}{
\newcounter{framenumbervorappendix}
\setcounter{framenumbervorappendix}{\value{framenumber}}
\setbeamertemplate{footline}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\hspace*{2em}
\insertframenumber{} \hspace*{2ex}%
\end{beamercolorbox}}%
\vskip0pt%
}
}
\newcommand{\backupend}{
\addtocounter{framenumbervorappendix}{-\value{framenumber}}
\addtocounter{framenumber}{\value{framenumbervorappendix}}
}
\robustify{\bfseries}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcolumntype{Z}[1]{>{\centering}p{#1}}
\begin{document}
\begin{frame}{Title}
\centering
\fontsize{4}{5}\selectfont
\renewcommand\theadfont{\fontsize{4}{5}\selectfont}
\settowidth{\rotheadsize}{\fontsize{4}{5}\selectfont Total}
\renewcommand{\theadalign}{bc}
\setlength\tabcolsep{0pt} % default: 6pt
\begin{tabular*}{\hsize}{l@{\extracolsep{\fill}}
*{31}{Z{4.5ex}}
>{}S[table-format=2.0,
detect-weight]
}
\toprule
\thead{(1)} & \thead{(2)} & \thead{(3)} & \thead{(4)} & \thead{(5)} &
\thead{(6)} & \thead{(7)} & \thead{(8)} & \thead{(9)} & \thead{(10)} &
\thead{(11)} & \thead{(12)} & \thead{(13)} & \thead{(14)} & \thead{(15)} &
\thead{(16)} & \thead{(17)} & \thead{(18)} & \thead{(19)} & \thead{(20)} &
\thead{(21)} & \thead{(22)} & \thead{(23)} & \thead{(24)} & \thead{(25)} &
\thead{(26)} & \thead{(27)} & \thead{(28)} & \thead{(29)} & \thead{(30)} &
\thead{(31)} & \thead{(32)} & {\thead{(33)}}\\
\cmidrule{1-33}
\thead[lb]{XXX}
& \rothead{1985} & \rothead{1986} & \rothead{1987} & \rothead{1988}
& \rothead{1989} & \rothead{1990} & \rothead{1991} & \rothead{1992}
& \rothead{1993} & \rothead{1994} & \rothead{1995} & \rothead{1996}
& \rothead{1997} & \rothead{1998} & \rothead{1999} & \rothead{2000}
& \rothead{2001} & \rothead{2002} & \rothead{2003} & \rothead{2004}
& \rothead{2005} & \rothead{2006} & \rothead{2007} & \rothead{2008}
& \rothead{2009} & \rothead{2010} & \rothead{2011} & \rothead{2012}
& \rothead{2013} & \rothead{2014} & \rothead{2015} & {\rothead{Total}}\\
\midrule
XXX & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & \multicolumn{1}{c}{F} & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
XXX & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
XXX & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
XXX & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & \multicolumn{1}{c}{F} & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
XXX & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & \multicolumn{1}{c}{I} & & & & & & & \multicolumn{1}{c}{F} & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{3} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{0} \\
XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{0} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{II} & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{2} \\
XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
XXX & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & & \multicolumn{1}{c}{F} & & \multicolumn{1}{c}{F} & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{3} \\
\rowcolor[rgb]{ .886, .886, .886} \textbf{XXX} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{2} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{3} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{24} \\
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \\
XXX & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & & & & & & & & & & \multicolumn{1}{c}{I} & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{1} \\
XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{0} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{0} \\
\rowcolor[rgb]{ .886, .886, .886} \textbf{XXX} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{2} \\
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \\
\rowcolor[rgb]{ .949, .949, .949} XXX & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \textbf{0} \\
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \cellcolor[rgb]{ .886, .886, .886} \\
\rowcolor[rgb]{ .886, .886, .886} \textbf{XXX} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{0} & \textbf{2} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{3} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{26} \\
\bottomrule
\end{tabular*}%
\end{frame}
\end{document}
没有 siunitx 的文件列表(有 siunitx 则没有创建输出):
*File List*
beamer.cls 2017/01/23 v3.41 A class for typesetting presentations
etoolbox.sty 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
beamerbasemodes.sty
beamerbasedecode.sty
ifpdf.sty 2016/05/14 v3.1 Provides the ifpdf switch
beamerbaseoptions.sty
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
geometry.sty 2010/09/12 v5.6 Page Geometry
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7)
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2016/05/09 v1.0r Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/01/02 v1.10 sample graphics configuration
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48)
pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfsys.code.tex
pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
colortbl.sty 2012/02/13 v1.0a Color table columns (DPC)
array.sty 2014/10/28 v2.4c Tabular extension package (FMi)
pgfcore.code.tex
xxcolor.sty 2003/10/24 ver 0.1
atbegshi.sty 2016/05/16 v1.17 At begin shipout hook (HO)
hyperref.sty 2016/05/21 v6.83p Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
pdftexcmds.sty 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
pd1enc.def 2016/05/21 v6.83p Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hpdftex.def 2016/05/21 v6.83p Hyperref driver for pdfTeX
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty
beamerbasecompatibility.sty
beamerbasefont.sty
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
sansmathaccent.sty 2013/03/28
filehook.sty 2011/10/12 v0.5d Hooks for input files
beamerbasetranslator.sty
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty
beamerbasetwoscreens.sty
beamerbaseoverlay.sty
beamerbasetitle.sty
beamerbasesection.sty
beamerbaseframe.sty
beamerbaseverbatim.sty
beamerbaseframesize.sty
beamerbaseframecomponents.sty
beamerbasecolor.sty
beamerbasenotes.sty
beamerbasetoc.sty
beamerbasetemplates.sty
beamerbaseauxtemplates.sty
beamerbaseboxes.sty
beamerbaselocalstructure.sty
enumerate.sty 2015/07/23 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty
beamerbasetheorems.sty
amsmath.sty 2016/03/10 v2.15b AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
amsthm.sty 2015/03/04 v2.20.2
beamerbasethemes.sty
beamerthemedefault.sty
beamerfontthemedefault.sty
beamercolorthemedefault.sty
beamerinnerthemedefault.sty
beamerouterthemedefault.sty
babel.sty 2016/04/23 3.9r The Babel package
bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of babel
english.ldf 2012/08/20 v3.3p English support from the babel system
inputenc.sty 2015/03/17 v1.2c Input encoding file
utf8.def 2016/02/28 v1.1s UTF-8 support for inputenc
t1enc.dfu 2016/02/28 v1.1s UTF-8 support for inputenc
ot1enc.dfu 2016/02/28 v1.1s UTF-8 support for inputenc
omsenc.dfu 2016/02/28 v1.1s UTF-8 support for inputenc
times.sty 2005/04/12 PSNFSS-v9.2a (SPQR)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lmodern.sty 2009/10/30 v1.6 Latin Modern Fonts
textcomp.sty 2005/09/27 v1.99g Standard LaTeX package
ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
ts1enc.dfu 2016/02/28 v1.1s UTF-8 support for inputenc
longtable.sty 2014/10/28 v4.11 Multi-page Table package (DPC)
lscape.sty 2000/10/22 v3.01 Landscape Pages (DPC)
rotating.sty 2009/03/28 v2.16a rotated objects in LaTeX
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
multirow.sty
booktabs.sty 2005/04/14 v1.61803 publication quality tables
makecell.sty 2009/08/03 V0.1e Managing of Tab Column Heads and Cells
tabularx.sty 2016/02/03 v2.11 `tabularx' package (DPC)
threeparttable.sty 2003/06/13 v 3.0
adjustbox.sty 2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)
xkeyval.sty 2014/12/03 v2.7a package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
adjcalc.sty 2012/05/16 v1.1 Provides advanced setlength with multiple back-ends (calc, etex, pgfmath)
trimclip.sty 2012/05/16 v1.0 Trim and clip general TeX material
collectbox.sty 2012/05/17 v0.4b Collect macro arguments as boxes
tc-pdftex.def 2012/05/13 v1.0 Clipping driver for pdftex
ifoddpage.sty 2016/04/23 v1.1 Conditionals for odd/even page detection
varwidth.sty 2009/03/30 ver 0.92; Variable-width minipages
natbib.sty 2010/09/13 8.31b (PWD, AO)
mathabx.sty 2003/07/29 v0.0 Non-standard LaTeX package mathabx
tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151)
pgf.sty 2015/08/07 v3.0.1a (rcs-revision 1.15)
pgfcomp-version-0-65.sty 2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v3.0.1a (rcs-revision 1.1)
pgffor.sty 2013/12/13 v3.0.1a (rcs-revision 1.25)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
ragged2e.sty 2009/05/21 v2.1 ragged2e Package (MS)
everysel.sty 2011/10/28 v1.2 EverySelectfont Package (MS)
ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
t1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
supp-pdf.mkii
epstopdf-base.sty 2016/05/15 v2.6 Base part for package epstopdf
grfext.sty 2016/05/16 v1.2 Manage graphics extensions (HO)
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
Rigorosum.out
Rigorosum.out
translator-basic-dictionary-English.dict
translator-bibliography-dictionary-English.dict
translator-environment-dictionary-English.dict
translator-months-dictionary-English.dict
translator-numbers-dictionary-English.dict
translator-theorem-dictionary-English.dict
ot1lmss.fd 2009/10/30 v1.6 Font defs for Latin Modern
omllmm.fd 2009/10/30 v1.6 Font defs for Latin Modern
omslmsy.fd 2009/10/30 v1.6 Font defs for Latin Modern
omxlmex.fd 2009/10/30 v1.6 Font defs for Latin Modern
umsa.fd 2013/01/14 v3.01 AMS symbols A
umsb.fd 2013/01/14 v3.01 AMS symbols B
***********
答案1
请注意,使用 TeX 时,几乎总是只应查看第一的错误,后续错误(如果您滚动超过第一个)很可能是尝试恢复操作时产生的虚假错误。
这里的错误很明显
! Package array Error: Illegal pream-token (S): `c' used.
因此,您使用的令牌 SS[table-format=2.0, detect-weight]
是未知的。
添加
\usepackage{siunitx}
定义S
并且您的文档运行时不会出现错误。