从 Excel2Latex 安装的表格存在问题

从 Excel2Latex 安装的表格存在问题

我正在为我的毕业论文写一篇论文,我遇到了一个反复出现的错误“LaTeX 错误:包 xcolor 的选项冲突。请参阅 LaTeX 手册或 LaTeX Companion 了解解释。输入 H 即可获得即时帮助。... l.6 \usepackage{booktabs}”我的序言如下:

\documentclass[openany, oneside]{book}
\usepackage{grad_proseminar}
\usepackage{hyperref}
\usepackage{fixltx2e}
\usepackage[table]{xcolor}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tabularx}
\usepackage{setspace}
\usepackage[super]{nth}
\usepackage{url} 

\usepackage{indentfirst}
\usepackage[page,titletoc,title]{appendix}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=magenta,      
    urlcolor=cyan,  
}

这是我从 Excel2Latex 中提取的代码:

\begin{table}[htbp]
  \centering
  \caption{Descriptive Statistics}
    \begin{tabular}{|p{10.93em}|p{6.215em}|p{6.855em}|}
    \rowcolor[rgb]{ .384,  .706,  .776} \textcolor[rgb]{ 1,  1,  1}{\textbf{Variable}} & \textcolor[rgb]{ 1,  1,  1}{\textbf{Frequency}} & \multicolumn{1}{p{6.855em}}{\textcolor[rgb]{ 1,  1,  1}{\textbf{Percentage}}} \\
\cmidrule{2-3}    \rowcolor[rgb]{ .827,  .898,  .918} Binge Drinker            Not Binge Drinker       Binge Drinker &                                       1147             2982 &                                                27.8                 72.2 \\
    \midrule
    \rowcolor[rgb]{ .918,  .949,  .961} Education                    Freshman               Sophomore/Junior    Senior/Grad &                      1169        1897           1063 &                          28.3               45.9                25.7      \\
    \midrule
    \rowcolor[rgb]{ .827,  .898,  .918} Income                        Poverty       Low/Middle Class     Middle Class              High Class             &                    810            1267          633            1419 &                       19.6           30.7             15.3           34.4 \\
    \midrule
    \rowcolor[rgb]{ .918,  .949,  .961} Race           White(Non-Hispanic)  Black(Non-Hispanic)  Hispanic                Other &                 2525            480            714           410 &                         61.2                 11.6            17.3                9.9 \\
    \midrule
    \rowcolor[rgb]{ .827,  .898,  .918} Sex                              Male                     Female &                   1800             2329 &                        43.6                 56.4 \\
    \midrule
    \rowcolor[rgb]{ .918,  .949,  .961} Marijuana Use      Never Used             Used Before\newline{}\newline{}   &                 2369         1760 & \cellcolor[rgb]{ .827,  .898,  .918}                       57.4                 42.6 \\
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%

相关内容