Graphics, Figures & TablesUnderstanding Tables and Caption Error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
zak100
Posts: 4
Joined: Sat Aug 22, 2020 5:49 pm

Understanding Tables and Caption Error

Post by zak100 »

Hi,
Following is my code:

Code: Select all

\documentclass[manuscript,screen]{acmart}
\usepackage{listings}
\input{solidity-highlighting.tex}
\usepackage[colorinlistoftodos]{todonotes} 
\AtBeginDocument{%
  \providecommand\BibTeX{{%
    \normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}


\setcopyright{acmcopyright}
\copyrightyear{2020}
\acmYear{2020}
\acmDOI{10.1145/1122445.1122456}


\begin{document}

\title{A Test of Latex}

\author{ Khan}
\email{Khan@edu}

\affiliation{}
  \institution{ University}


\renewcommand{\shortauthors}{Trovato and Tobin, et al.}


\begin{abstract}
  Testing abstract
\end{abstract}


\begin{CCSXML}
<ccs2012>
<concept>
<concept_id>10002978.10003022</concept_id>
<concept_desc>Testing and testingand privacy~ application security</concept_desc>
<concept_significance>500</concept_significance>
</concept>
<concept>
<concept_id>10002944.10011122.10002945</concept_id>
<concept_desc>General and reference~Surveys and overviews</concept_desc>
<concept_significance>500</concept_significance>
</concept>
</ccs2012>
\end{CCSXML}

\ccsdesc[500]{Security and privacy~Software and application security}
\ccsdesc[500]{General and reference~Surveys and overviews}



\maketitle

\section{Introduction}
Hello. \citet{1}, \citet{2}, \citet{3} %\cite{8} \cite{105} \cite{112} %\cite{48} \cite{87}.

\begin{lstlisting}[language=Solidity] 
contract TestList1{

}
\end{lstlisting}
begin{table}[]
   \centering
    \begin{tabular}{l|ccccc|cccc|cc|ccc|ccc|ccc}

    \end{tabular}
    \caption{Testing Table for Classification.}
   \label{tab:classification}
 \vspace{-0.1in} 
\end{table}
\bibliographystyle{ACM-Reference-Format}
\bibliography{sourcefile-bib}


\end{document}
\endinput
Following is image related to error message:
Table caption_End Table_square bracket.png
Table caption_End Table_square bracket.png (207.88 KiB) Viewed 4154 times

Code: Select all

Package caption Error: \caption outside float.
main.tex, line 191
Too many }'s.
I can't understand:
begin{table}[]???Can't understand
\label{tab:classification}???Can't understand
\vspace{-0.1in} ???Can't understand

Some body please guide me.

Zulfi.
Last edited by cgnieder on Sun Aug 23, 2020 9:18 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 367
Joined: Fri Jan 03, 2020 2:39 pm

Understanding Tables and Caption Error

Post by Bartman »

The backslash is missing in the \begin command of the table environment.
zak100
Posts: 4
Joined: Sat Aug 22, 2020 5:49 pm

Understanding Tables and Caption Error

Post by zak100 »

Hi,
Thanks a lot. Pleae tell me:


\begin{table}[]???Can't understand the purpose of '[]'
\label{tab:classification}???Can't understand
\vspace{-0.1in}???Can't understand


Please help me to understand the commands: \begin{table}[], \label{tab:classification} and \vspace{-0.1in}.

Zulfi.
Last edited by cgnieder on Sun Aug 23, 2020 9:22 pm, edited 1 time in total.
Bartman
Posts: 367
Joined: Fri Jan 03, 2020 2:39 pm

Understanding Tables and Caption Error

Post by Bartman »

The environment and the commands are basic components of latex. They should be explained in each introduction (e.g. lshort) and reference (e.g. LaTeX2e unofficial reference manual).
Post Reply