我对 Latex 的了解很少。我正在尝试传输此代码片段:
\documentclass{article}
%\documentclass[leqno]{uicthesi}
\usepackage{amsmath}
\usepackage[initials]{amsrefs}
\usepackage[inline]{showlabels}
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{epsfig}
\usepackage{siunitx}
\usepackage{url}
\usepackage{enumitem}
\usepackage{float}
\usepackage{subfig, mathtools}
\usepackage[usenames,dvipsnames]{color}
\usepackage{array,color}
\begin{document}
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline
$H$ & $h$ &$||u-u_h||_{H^1}$ & rate & $||u-u^h||_{H^1}$ & rate & two-grid time & Newton time\\ \hline
$1/2^0$ & $1/2^2$ &2.19 $10^{-2}$ & - & 3.12 $10^{-1}$ & - & 2.80 $10^{-2}$& 4.90 $10^{-2}$ \\ \hline
$1/2^1$ &$1/2^3$ & 5.55 $10^{-3}$ & 1.98 & 3.22 $10^{-2}$ & 3.28 & 7.10 $10^{-2}$ & 1.67 $10^{-1}$ \\ \hline
$1/2^2$ &$1/2^4$ &1.39 $10^{-3}$ &2.00 & 3.69 $10^{-3}$ & 3.12 & 2.37 $10^{-1}$ &8.58 $10^{-1}$\\ \hline
$1/2^3$ & $1/2^5$ &3.48 $10^{-4}$ & 2.00 & 6.34 $10^{-4}$ & 2.54 & 9.92 $10^{-1}$&3.25 $10^{0}$\\ \hline
$1/2^4$ & $1/2^6$ & 8.70 $10^{-5}$ & 2.00& 1.48 $10^{-4}$ & 2.10 & 4.15 $10^{0}$ & 1.31 $10^{1}$\\ \hline
$1/2^5$ & $1/2^7$ & 2.18 $10^{-5}$ &2.00 & 3.65 $10^{-5}$ & 2.02 & 1.87 $10^{1}$& 5.59 $10^{1}$\\ \hline
$1/2^6$ & $1/2^8$ & 5.44 $10^{-6}$ & 2.00 & 9.11 $10^{-6}$ & 2.00 &8.57 $10^{1}$& 2.73 $10^{2}$\\ \hline
%$1/2^7$ & $1/2^9$ & N/A & N/A & 2.24$10^{-3}$ & 1.03 &3.60 $10^{4}$ & N/A\\ \hline
%7 &1.8956 $10^{-6}$ & 1.7983 $10^{-5}$ &4.8870 $10^{-4}$ \\ \hline
%8 & & & \\ \hline
%Rate & $10^{2.3278}$ $d^{-9.4276}$& $10^{3.0318}$ $d^{-9.0347}$& $10^{3.4794}$ $d^{-7.8305}$ \\ \hline
\end{tabular}
\caption{ $P_2;~ \lambda=1+ \frac{2 \ln 2}{\ln h} $} \label{tab1}
\end{table}
\end{document}
放入一个新文件中,并在 Texworks 中收到此错误:
Overfull \hbox (9.48213pt too wide) in paragraph at lines 4784--4800
\OT1/cmr/m/n/10.95 max-i-mum it-er-a-tions to 10 and we im-pose that the al-go-
rithm ter-mi-nates when $\OMS/cmsy/m/n/10.95 jj\OML/cmm/m/it/10.95 u[]\OMS/cmsy
/m/n/10.95 jj[]\OML/cmm/m/it/10.95 =\OMS/cmsy/m/n/10.95 jj\OML/cmm/m/it/10.95 u
[]\OMS/cmsy/m/n/10.95 jj[]
! Too many }'s.
\color@endbox ->\color@endgroup \egroup
l.4847 \end{table}
?
答案1
你有使用该类?自 1996 年以来它就没有更新过!而且它大多早于 LaTex2e,与 LaTeX 中的颜色使用不兼容。
一个快速的解决方法是
\makeatletter
\let\zz@xfloat\@xfloat
\makeatother
\documentclass[leqno]{uicthesi}
\makeatletter
\let\@xfloat\zz@xfloat
\makeatother
\usepackage{amsmath}
\usepackage[initials]{amsrefs}
\usepackage[inline]{showlabels}
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{epsfig}
\usepackage{siunitx}
\usepackage{url}
\usepackage{enumitem}
\usepackage{float}
\usepackage{subfig, mathtools}
\usepackage[usenames,dvipsnames]{color}
\usepackage{array,color}
\begin{document}
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline
$H$ & $h$ &$||u-u_h||_{H^1}$ & rate & $||u-u^h||_{H^1}$ & rate & two-grid time & Newton time\\ \hline
$1/2^0$ & $1/2^2$ &2.19 $10^{-2}$ & - & 3.12 $10^{-1}$ & - & 2.80 $10^{-2}$& 4.90 $10^{-2}$ \\ \hline
$1/2^1$ &$1/2^3$ & 5.55 $10^{-3}$ & 1.98 & 3.22 $10^{-2}$ & 3.28 & 7.10 $10^{-2}$ & 1.67 $10^{-1}$ \\ \hline
$1/2^2$ &$1/2^4$ &1.39 $10^{-3}$ &2.00 & 3.69 $10^{-3}$ & 3.12 & 2.37 $10^{-1}$ &8.58 $10^{-1}$\\ \hline
$1/2^3$ & $1/2^5$ &3.48 $10^{-4}$ & 2.00 & 6.34 $10^{-4}$ & 2.54 & 9.92 $10^{-1}$&3.25 $10^{0}$\\ \hline
$1/2^4$ & $1/2^6$ & 8.70 $10^{-5}$ & 2.00& 1.48 $10^{-4}$ & 2.10 & 4.15 $10^{0}$ & 1.31 $10^{1}$\\ \hline
$1/2^5$ & $1/2^7$ & 2.18 $10^{-5}$ &2.00 & 3.65 $10^{-5}$ & 2.02 & 1.87 $10^{1}$& 5.59 $10^{1}$\\ \hline
$1/2^6$ & $1/2^8$ & 5.44 $10^{-6}$ & 2.00 & 9.11 $10^{-6}$ & 2.00 &8.57 $10^{1}$& 2.73 $10^{2}$\\ \hline
%$1/2^7$ & $1/2^9$ & N/A & N/A & 2.24$10^{-3}$ & 1.03 &3.60 $10^{4}$ & N/A\\ \hline
%7 &1.8956 $10^{-6}$ & 1.7983 $10^{-5}$ &4.8870 $10^{-4}$ \\ \hline
%8 & & & \\ \hline
%Rate & $10^{2.3278}$ $d^{-9.4276}$& $10^{3.0318}$ $d^{-9.0347}$& $10^{3.4794}$ $d^{-7.8305}$ \\ \hline
\end{tabular}
\caption{ $P_2;~ \lambda=1+ \frac{2 \ln 2}{\ln h} $} \label{tab1}
\end{table}
\end{document}