0

Following is the description of my table as far as I understand it. First row is the combination of two rows: First cell of 1st row is empty, 2nd cell of the 1st row is the combination of 5 columns (text=GrpNumber1), 3rd cell of 1st row column is the combination of 4 columns(text=GrpNumber2), 4th cell of 1st row is the combination of 2 columns(text=GrpNumber3), 5th , 6th and 7th cell of 1st row is the combination of 3 columns with (text=GrpNumber4), (text=GrpNumber5), (text=GrpNumber6) respectively. 2nd row has the same number of columns for each cell, only the 4th cell has the text “Task” 3rd row has the same number of columns for each cell but the text in each cell is vertically oriented from down to up Remaining rows have text in the first cell while tick mark and cross in the remaining cells and this will continue till 20 rows.

The sample image of the table is uploaded:

Sample Image in Word

I have created some text. I am able to code first and 2nd row correctly but I can't code the 3rd row which has vertically oriented text. After that I can't proceed. I have used '\rot' for printing vertically oriented text

My code is:

\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> and 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}
 \hline
        & \multicolumn{5}{c|}{\bf GrpNumber1} &     \multicolumn{4}{c|}{\bf GrpNumber2} & \multicolumn{2}{c|}{\bf GrpNumber3} & \multicolumn{3}{c|}{\bf GrpNumber4} & \multicolumn{3}{c|}{\bf GrpNumber5} & \multicolumn{3}{c}{\bf GrpNumber6} \\
        & \multicolumn{5}{c|}{\bf } &   \multicolumn{4}{c|}{\bf } & \multicolumn{2}{c|}{\bf Task} & \multicolumn{3}{c|}{\bf } & \multicolumn{3}{c|}{\bf } & \multicolumn{3}{c}{\bf } \\
    \hline

code below this line is not working fine:

& \rot{Grp1Member1} & \rot{Grp1Member2} & \rot{Grp1Member3}     & \rot{Grp1Member4}
    & \multicolumn{1}{c|}{\rot{Grp1Member5}} 
    & \rot{Grp2Member1} 
    & \rot{Grp2Member2} 
    & \rot{Grp2Member3} 
    & \multicolumn{1}{c|}{\rot{Grp2Member4}} 
    & \rot{Grp3Member1} 
    & \multicolumn{1}{c|}{\rot{Grp3Member2}} 
    & \rot{Grp4Member1} 
    & \rot{Grp4Member2} 
    & \multicolumn{1}{c|}{\rot{Grp4Member3}}
     & \rot{Grp5Member1} 
     & \rot{Grp5Member2} 
     & \multicolumn{1}{c|}{\rot{Grp5Member3}} 
     & \rot{Grp6Member1} 
     & \rot{Grp6Member2} 
     & \multicolumn{1}{c|} {\rot{Grp6Member3}} \\
     \hline
    \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

I also want to know how to print "tick mark".

Kindly show me the whole working code.

Zulfi.

3
  • 2
    (i) Please make your code compilable, (ii) whereis define \rot? (iii) I don't see, that you use longtable, (iv` reduce your document example only to your problem, i.e. let it contain just your table ...
    – Zarko
    Aug 23, 2020 at 5:50
  • Thanks for your response. This table is just a small part of my large document. If I remove all other stuff, how will I know if the table I create is compatible with my rest of document. I developed this whole table in word without using short names or acronyms. Aug 23, 2020 at 13:04
  • Intention of MWE is reproduce your problem. As you inform us, in your case this is table. In my answer I show one of possible solution how to design your table If you copy code for table and new part of preamble to your document, it should works. If document compilation will still have errors, they will not produced with my part of answer. If you not like my solution, don't use it.
    – Zarko
    Aug 23, 2020 at 13:30

1 Answer 1

1

In your document example

  • is not minimal,
  • as far as I understood, you have problems with table, so please remove all other stuff, which is not related to the table
  • are missing definitions and packages, which are necessary to compile your table
  • headers of your table is to wide that table can be fit on page; as solution can be replace their names with some abbreviation, for example "GN" as is done in MWE below and explain it in caption what it means
  • a possible MWE, focused only to table is:
\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}

%%% new packages and definitions  ------------------------------%
\usepackage{rotating}
\usepackage{array, makecell}
\renewcommand\rotheadgape{}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{>{\bfseries\small}c|}{#2}}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{lipsum}  % for dummy text
%---------------------------------------------------------------%

%\title{A Test of Latex}
%\author{Khan}
%\email{Khan@edu}
%\affiliation{}
%\institution{University}
%\renewcommand{\shortauthors}{Trovato and Tobin, et al.}

\begin{document}
%   \maketitle


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


%\begin{CCSXML}
%<ccs2012>
%<concept>
%<concept_id>10002978.10003022</concept_id>
%<concept_desc> and 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}

\lipsum[11]
\begin{table}[ht]
\settowidth\rotheadsize{Grp1Member1}
\setlength\tabcolsep{4pt}
\centering
    \begin{tabular}{|l|ccccc|cccc|cc|ccc|ccc|ccc|}
 \hline
    &   \mcc[20]{task}                      \\
    \cline{2-21}
    &   \mcc[5]{GN 1}
        &   \mcc[4]{GN 2}
            &   \mcc[2]{GN 3}
                &   \mcc[3]{GN 4}
                    &   \mcc[3]{GN 5}
                        &   \mcc[3]{GN 6}   \\
    \hline
    & \rothead{Grp1Member1} & \rothead{Grp1Member2} & \rothead{Grp1Member3} 
    & \rothead{Grp1Member4} & \rothead{Grp1Member5} & \rothead{Grp2Member1}
    & \rothead{Grp2Member2} & \rothead{Grp2Member3} & \rothead{Grp2Member4}
    & \rothead{Grp3Member1} & \rothead{Grp3Member2} & \rothead{Grp4Member1}
    & \rothead{Grp4Member2} & \rothead{Grp4Member3} & \rothead{Grp5Member1}
    & \rothead{Grp5Member2} & \rothead{Grp5Member3} & \rothead{Grp6Member1}
    & \rothead{Grp6Member2} & \rothead{Grp6Member3} \\
    \hline
    \end{tabular}
    \caption{Testing Table for Classification. GN stands for GrpNumber.}
   \label{tab:classification}
\end{table}
\end{document}

enter image description here

(red lines indicate page layout)

Note, MWE was compiled in Overleaf.

4
  • Thanks. Please guide me how to add the remaining 20 rows item1..item20. And how to display tick mark and cross characters in these reamining 20 rows. Aug 23, 2020 at 13:30
  • 1
    @user2994783, I can't do this, since I dont know what they content. Please, edit your question and add at least two (better 3) rows from your table body. Also please add in preamble missed packages, which are necessary for table compilation.
    – Zarko
    Aug 23, 2020 at 13:34
  • I have shown in the sample table, the rows related to "item1", "Item2", and "Item3". You can use any combination of "check marks" and crosses. If you can show for two rows, it would help me to do for the rest. I am thinking to create another question. But I have to use preamble which are part of my latex document. I would remove the unnecessary staff. God blesses you. Aug 23, 2020 at 15:29
  • I think it will work. I am able to add one row. Thanks. Aug 23, 2020 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .