这是我遇到问题的代码:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{colortbl}
\begin{document}
\begin{equation}
f(x) = \begin{cases}
1, &\mbox{if $x=1$} \\
2, &\mbox{if $x=2$}
\end{cases}
\end{equation}
\end{document}
当我同时使用 amsmath 和 colortbl 包时,方程式(带有 \begin{cases}...\end{cases})出现问题。当我编译文件时,它会报告“@startpbox 的使用与其定义不匹配。f(x) = \begin{cases}”和“额外 },或忘记了 \endgroup。f(x) = \begin{cases}”。但是,如果我注释掉 \usepackage{colortbl},文件就可以正常工作。有人知道如何解决这个不兼容问题吗?非常感谢!
顺便说一下,下面是完整的日志文件,附件如下:
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2014.9.3) 26 MAR 2019 21:19
entering extended mode
**Incompatibility.tex
("C:\Users\jsun1\Dropbox\Junze media bias\Part Experiment\Working paper\Technic
al LaTeX problem\Incompatibility.tex"
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\size12.clo"
File: size12.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\amsmath\amsmath.st
y"
Package: amsmath 2018/12/01 v2.17b AMS math features
\@mathmargin=\skip43
For additional information on amsmath, use the `?' option.
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\amsmath\amstext.st
y"
Package: amstext 2000/06/29 v2.01 AMS text
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty
"
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks14
\ex@=\dimen103
))
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty
"
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen104
)
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty
"
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count87
LaTeX Info: Redefining \frac on input line 223.
\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 385.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 482.
LaTeX Info: Redefining \dots on input line 485.
LaTeX Info: Redefining \cdots on input line 606.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info: Redeclaring font encoding OML on input line 729.
LaTeX Font Info: Redeclaring font encoding OMS on input line 730.
\macc@depth=\count92
\c@MaxMatrixCols=\count93
\dotsspace@=\muskip10
\c@parentequation=\count94
\dspbrk@lvl=\count95
\tag@help=\toks15
\row@=\count96
\column@=\count97
\maxfields@=\count98
\andhelp@=\toks16
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks17
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks18
LaTeX Info: Redefining \[ on input line 2844.
LaTeX Info: Redefining \] on input line 2845.
) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\colortbl\colortbl.sty"
Package: colortbl 2012/02/13 v1.0a Color table columns (DPC)
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\tools\array.sty"
Package: array 2018/11/13 v2.4j Tabular extension package (FMi)
\col@sep=\dimen112
\ar@mcellbox=\box28
\extrarowheight=\dimen113
\NC@list=\toks19
\extratabsurround=\skip46
\backup@length=\skip47
\ar@cellbox=\box29
)
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\graphics\color.sty
"
Package: color 2016/07/10 v1.1e Standard LaTeX Color (DPC)
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\graphics-cfg\color
.cfg"
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package color Info: Driver file: pdftex.def on input line 147.
("C:\Users\jsun1\AppData\Local\Programs\MiKTeX 2.9\tex\latex\graphics-def\pdfte
x.def"
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\everycr=\toks20
\minrowclearance=\skip48
)
("C:\Users\jsun1\Dropbox\Junze media bias\Part Experiment\Working paper\Technic
al LaTeX problem\Incompatibility.aux")
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count99
\scratchdimen=\dimen114
\scratchbox=\box30
\nofMPsegments=\count100
\nofMParguments=\count101
\everyMPshowfont=\toks21
\MPscratchCnt=\count102
\MPscratchDim=\dimen115
\MPnumerator=\count103
\makeMPintoPDFobject=\count104
\everyMPtoPDFconversion=\toks22
)
! Use of \@startpbox doesn't match its definition.
<inserted text> \@startpbox {
@{}l@{\quad }l@{}}
l.10 f(x) = \begin{cases}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Extra }, or forgotten \endgroup.
\@mkpream ...after \@startpbox \expandafter {#1}}}
\let \@endpbox \relax \let...
l.10 f(x) = \begin{cases}
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.
[1
{C:/Users/jsun1/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
("C:\Users\jsun1\Dropbox\Junze media bias\Part Experiment\Working paper\Technic
al LaTeX problem\Incompatibility.aux") )
Here is how much of TeX's memory you used:
1466 strings out of 493921
18853 string characters out of 3144925
68398 words of memory out of 3000000
4794 multiletter control sequences out of 15000+200000
7050 words of font info for 26 fonts, out of 3000000 for 9000
841 hyphenation exceptions out of 8191
34i,9n,20p,232b,122s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Users/jsun1/AppData/Local/Programs/
MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmex10.pfb><C:/Users/jsun1/AppData/Lo
cal/Programs/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmmi12.pfb><C:/Users/jsu
n1/AppData/Local/Programs/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr12.pfb>
Output written on Incompatibility.pdf (1 page, 26303 bytes).
PDF statistics:
18 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)