I am having difficulties with what I assume to be a simple issue. I'm in the process of learning LaTeX, and currently having STATA output most of my LaTeX code, which I then insert into TeXworks in order to generate PDFs.
Whenever I try to output this specific code, I receive the error:
"File ended while scanning use of \multicolumn."
Here is the code I am using:
\documentclass{article}
\begin{document}
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Closing Date Effects}
\begin{tabular}{l*{1}{cc}}
\hline\hline
&\multicolumn{2}{c}{(1)} \\
&\multicolumn{2}{c}{Voter Turnout (%)}\\
\hline
Registration Closing Date& -0.226\sym{**} & (0.001)\\
Southern State & -8.900 & (0.142)\\
Close x South (Interaction)& 0.0928 & (0.674)\\
Constant & 77.20\sym{***}& (0.000)\\
\hline
Observations & 51 & \\
\hline\hline
\multicolumn{3}{l}{\footnotesize \textit{p}-values in parentheses}\\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \ (p<0.001\)}\\
\end{tabular}
\end{table}
\end{document}
My best guess has been that I'm missing some braces in the \multicolumn sections, but I can't find where. I thought perhaps on the last line:
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \ (p<0.001\)}\\
But no matter the number of braces I use, it still errors out.


%is a comment (to end of line) so TeX never saw the closing}here%)}\\you need\%to typeset a%– David Carlisle Apr 03 '14 at 22:03%as output in your document. You need to escape it via\%. See Escape character in LaTeX. – Werner Apr 03 '14 at 22:07%in the second line (which is the immediate cause of your error). That, once corrected, throws up another couple of errors: a stray backslash at the end of the penultimate line (the p values line), and a bad delimiter in the following line because you have space between\(. – Paul Stanley Apr 03 '14 at 22:10