# Trouble transferring code snippets (table)

My latex knowledge is poor. I am trying to transfer this code snippet:

\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}


into a new file, and am getting this error in 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} ?  • that may be due to a change in the array package conflicting with some package that you have not shown, but please provide a complete small document that reproduces the problem. – David Carlisle Jan 11 at 21:41 • I made your fragment in to a complete document, and it runs without error so the error is in code you have not shown, please edit it (probably just adding some other package) so that it generates the error you get. Otherwise it is impossible to help as the error is in code we can not see. – David Carlisle Jan 11 at 21:44 • I have added the package preamble parts; do you need to see "commands" "newcommands" etc? – Nights Jan 11 at 21:50 • we need a document that we can run that shows the error so it can be debugged, disconnected fragments are not as helpful, also to mark code highlight it then use the {} button which indents by 4 spaces – David Carlisle Jan 11 at 21:52 • The document as it is now still runs without error, so presumably the error is in your local thesis class uicthesi.cls is that availabel anywhere? (unrelated but do not use the epsfig package for any documents written this century:-) – David Carlisle Jan 11 at 21:55 ## 1 Answer Do you have to use that class? It has not been updated since 1996! and mostly it predates LaTex2e, It is incompatible with colour use in LaTeX. A quick workaround is \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}

• It's a department dissertation class; it seems I have no choice. I will look into your workaround, thanks. – Nights Jan 11 at 22:14