3

I'm trying to create the table using the below script and its giving this error

"! Missing $ inserted.<inserted text> $ l.689 \end{tabularx}" 
\begin{table*}[t]
\centering\setlength{\tabcolsep}{.3\tabcolsep}
\begin{tabularx}{\linewidth}{|*2{>{\centering\hsize=1.6666\hsize}X|}*8{>{\centering\arraybackslash\hsize=.83333\hsize}X|}}
\hline
{\bf Point of Comparison} & {\bf X} & {\bf Y} & {\bf Z} & {\bf Average_entropy} & {\bf TC & {\bf RT}\\

\hline
\end{tabularx}
\caption{specs}
\label{tab:template}
\end{table*}
ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
Tak
  • 2,346
  • 4
  • 20
  • 33
  • 2
    Remove the empty line before \hline and add the missing closing bracket after {\bf TC. That should help. As well, please don't use \bf: all two-letter font commands have been obsolate for years. Use \bfseries instead. – yo' Oct 31 '13 at 14:58
  • 2
    Actually, the true problem is the _ in Average_entropy. Change it to Average entropy. The problems I mentioned before would show up later, so you need to correct them as well. – yo' Oct 31 '13 at 15:01
  • 2
    See http://tex.stackexchange.com/questions/48632/underscore-in-words – yo' Oct 31 '13 at 15:02
  • @tohecz thanks this really helped me! I just have one more question. Now the columns width is not well organized, where some coloumns has small number of letters in but its width is big and others has couple of words and its width is small which makes it use an extra line. So, if you could advise how to organize the width of the columns to fit the text in and also still be in the \linewidth ? Many Thanks in advance – Tak Nov 01 '13 at 01:06

1 Answers1

1

Is this what you seek? How many columns do you have? 7 or 10. I do 10 in the final output. For 7 columns, you need to redo the \hsize calculation. The missing dollar sign error is due to this Average_entropy. I have changed it to a single dash.

enter image description here

Code

\documentclass[]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{tabularx}

\begin{document}
\begin{table*}[t]
\centering\setlength{\tabcolsep}{.3\tabcolsep}
\begin{tabularx}{\linewidth}{|*2{>{\centering\hsize=1.6666\hsize}X|}*8{>{\centering\arraybackslash\hsize=.83333\hsize}X|}}
\hline\hline
{\bf Point of Comparison} & {\bf X} & {\bf Y} & {\bf Z} & {\bf Average-entropy} & {\bf TC} & {\bf RT} &&&\\
\hline
\end{tabularx}
\caption{specs}
\label{tab:template}
\end{table*}
\end{document}
David Carlisle
  • 757,742
Jesse
  • 29,686