Graphics, Figures & TablesA syntax error with my table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sorourzehtabiyan
Posts: 1
Joined: Sat May 25, 2019 9:50 pm

A syntax error with my table

Post by sorourzehtabiyan »

Hello Every one, there is a syntax error with my table code but I can not find it. The compiler compiles the table correctly but the text of next pages of my PDF gets out of edges. Can anyone help me with that? I could not find any similar problem among the topics.
\begin{table}[h]
\centering
\caption{(For T=2) LNS heuristic results for low-demand instances with varying fleet size}
\begin{tabular}{|c|cccccc|}
\hline
\multirow{2}{*}{Instance}  &  \multicolumn{6}{c|}{LNS Heuristic}\\
&   OBJ   & CPU(s)   & $|S^{\text{(u)}}|$  & C_{max}(h) & C_{avg}(h) & TD\\
\hline
L-M02R02S21 & 54.31 & 125 & 11 & 1.98 & 1.09 & 108.4 \\
L-M03R02S21 & 40.98 & 117 & 7 & 1.85 & 0.81 & 115.8 \\
L-M04R02S21 & 33.63 & 114 & 4 & 1.93 & 0.81 & 172.8 \\
L-M05R02S21 & 26.86 & 108 & 1 & 1.99 & 0.83 & 205.9 \\
L-M06R02S21 & 21.45 & 102 & 0 & 1.71 & 0.72 & 213.9 \\
L-M07R02S21 & 19.9 & 105 & 0 & 1.5 & 0.66 & 231.2 \\
L-M08R02S21 & 18.53 & 102 & 0 & 1.34 & 0.62 & 226.8 \\
L-M09R02S21 & 17.08 & 102 & 0 & 1.26 & 0.57 & 213.7 \\
L-M10R02S21 & 16.41 & 102 & 0 & 1.26 & 0.54 & 211.6 \\
L-M11R02S21 & 101 & 105 & 0 & 1.26 & 0.5 & 201.6 \\
L-M12R02S21 & 14.92 & 108 & 0 & 1.032 & 0.48 & 199.9 \\
L-M13R02S21 & 14.37 & 104 & 0 & 0.86 & 0.46 & 202.8 \\
L-M14R02S21 & 13.95 & 111 & 0 & 0.94 & 0.44 & 198.7 \\
\hline
\end{tabular}
\label{FleetSizeLowT2}
\end{table}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

A syntax error with my table

Post by Ijon Tichy »

The only syntax errors that I can find are reported by LaTeX: You've used _ outside math mode. But this should not result in the problem you've described. Nevertheless you should change C_{max}(h) and C_{avg}(h), e.g., into $C_{\text{max}}(h)$ and $C_{\text{avg}}(h)$.

Please show us a Infominimal working example that allows us to reproduce the problem.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

A syntax error with my table

Post by thomasb »

Ijon's correction works :
DeepinScreenshot_select-area_20190526230845.png
DeepinScreenshot_select-area_20190526230845.png (53.85 KiB) Viewed 1583 times
Post Reply