2

I would like to add a sixth column in my table, this column should be the total of the predictions Tp, Np and Ep. However, I don't really know how to do that and still have the table looking good since my table already seems to occupy most of the two columns of my page as shown in this picture enter image description here

 \documentclass[10pt,conference]{IEEEtran} 
\IEEEoverridecommandlockouts

\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{changepage}



\usepackage{lipsum}
\usepackage{ctable}% http://ctan.org/pkg/ctable
\usepackage{color, colortbl}
\newcommand{\var}{\textit}
\newcommand{\proc}{\textbf}
\newcommand{\prop}{\texttt}
\newcommand{\plusplus}{{+}{+}}% Other options: 
\newcommand*\ita[1]{\textit{#1}}
\usepackage{array, booktabs, makecell, multirow}% new
\definecolor{Gray}{gray}{0.9}
\usepackage{textcomp}

\usepackage{textcomp}
\usepackage{booktabs, makecell, multirow, tabularx}
\setcellgapes{2pt}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\usepackage{stfloats}

\usepackage{lipsum}
\usepackage{booktabs}
\newcommand\mytab[1]{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}
\newcommand\mc[2]{\multicolumn{#1}{c}{#2}}
\renewcommand{\algorithmiccomment}[1]{//#1}



\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}

\title{An Automated Approach for Refining Coarse-Grained Requirement-to-Code 
Traces\\

}
\begin{table*}[htb]
\centering
\caption{Precision/recall and completeness of the requirement-to-method 
traces output by our approach}
\label{Results}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l*{16}{c}}
    \toprule
    \multirow{2}{*}{\mytab{1-\\ Program}} 
    & \multirow{2}{*}{\mytab{2-\\ Step}} 
    & \mc{3}{\mytab{Cumulative\\ Predictions}} & \mc{3}{\mytab{Cumulative \\ Output\\ Completeness}}
    & \mc{5}{\mytab{Cumulative Precision \\ and Recall}} 
    & \mc{2}{\mytab{Cumulative \\ Output \\ Precision}} 
    & \mc{2}{\mytab{Cumulative\\ Output \\ Recall}} \\
    \cmidrule{3-5} \cmidrule{6-8} \cmidrule{9-13}
    \cmidrule{14-15} \cmidrule{16-17}
    &
    & \mytab{3-\\ T\textsubscript{p} (\#)}
    & \mytab{4-\\ N\textsubscript{p} (\#)}
    & \mytab{5-\\ E\textsubscript{p} (\#)}
    & \mytab{6-\\ T (\%)}
    & \mytab{7-\\ N (\%)}
    & \mytab{8-\\ E (\%)}
    & \mytab{9-\\ TP}
    & \mytab{10-\\ TN}
    & \mytab{11-\\ FP}
    & \mytab{12-\\ FN}
    & \mytab{13-\\ E}
    & \mytab{14-\\ T (\%)}
    & \mytab{15-\\ N (\%)}
    & \mytab{16-\\ T (\%)}
    & \mytab{17-\\ N (\%)} \\
    \midrule
    Chess & 1 & 0 & 2063 & 3953 & 0 & 34.29 & 65.71 & 0 & 1612 & 0 & 0 & 4404 & NA & 100 & NA & 100 \\

    & 2 & 0 & 3227 & 2789 & 0 & 53.64 & 46.36 & 0 & 1841 & 0 & 49 & 4126 & NA & 97.41 & 0 & 100 \\

    & 3 & 908 & 3227 & 1881 & 15.09 & 53.64 & 31.27 & 415 & 1841 & 378 & 49 & 3333 & 52.33 & 97.41 & 89.44 & 82.97 \\

    & 4 & \textbf{1464} & \textbf{3227}
    & \textbf{1325} & \textbf{24.34} & \textbf{53.64}
    & \textbf{22.02} & \textbf{471} & \textbf{1841}
    & \textbf{438} & \textbf{49} & \textbf{3217}
    & \textbf{51.82} & \textbf{97.41} & \textbf{90.58}
    & \textbf{80.78} \\
    \addlinespace
    Gantt & 1 & 0 & 55535 & 34699 & 0 & 61.55 & 38.45 & 0 & 22365 & 0 & 0 & 67869 & NA & 100 & NA & 100 \\
    & 2 & 0 & 69880 & 20354 & 0 & 77.44 & 22.56 & 0 & 22707 & 0 & 94 & 67433 & NA & 99.59 & 0 & 100 \\

    & 3 & 677 & 69880 & 19677 & 0.75 & 77.44 & 21.81 & 84 & 22707 & 85 & 94 & 67264 & 49.70 & 99.59 & 47.19 & 99.63 \\
    & 4 & \textbf{1143} & \textbf{69880} & \textbf{19211} & \textbf{1.27} & \textbf{77.44} & \textbf{21.29} & \textbf{136} & \textbf{22707} & \textbf{136} & \textbf{94} & \textbf{67161} & \textbf{50.00} & \textbf{99.59} & \textbf{59.13} & \textbf{99.40} \\
    \addlinespace
    iTrust & 1 & 0 & 17573 & 149265 & 0 & 10.53 & 89.47 & 0 & 6572 & 0 & 0 & 160266 & NA & 100 & NA & 100 \\
    & 2 & 0 & 28660 & 138178 & 0 & 17.18 & 82.82 & 0 & 6685 & 0 & 9 & 160144 & NA & 99.87 & 0 & 100 \\

    & 3 & 290 & 28660 & 137888 & 0.17 & 17.18 & 82.65 & 81 & 6685 & 27 & 9 & 160036 & 75.00 & 99.87 & 90.00 & 99.60 \\

    & 4 & \textbf{1074} & \textbf{28660} & \textbf{137104} & \textbf{0.64} & \textbf{17.18} & \textbf{82.18} & \textbf{93} & \textbf{6685} & \textbf{28} & \textbf{9} & \textbf{160023} & \textbf{76.86} & \textbf{99.87} & \textbf{91.18} & \textbf{99.58} \\
    \addlinespace
    JHotDraw & 1 & 0 & 116787 & 20133 & 0 & 85.30 & 14.70 & 0 & 12013 & 0 & 0 & 124907 & NA & 100 & NA & 100 \\

    & 2 & 0 & 128756 & 8164 & 0 & 94.04 & 5.96 & 0 & 12134 & 0 & 208 & 124578 & NA & 98.31 & 0 & 100 \\

    & 3 & 1279 & 128756 & 6885 & 0.93 & 94.04 & 5.03 & 63 & 12134 & 20 & 208 & 124495 & 75.90 & 98.31 & 23.25 & 99.84 \\

    & 4 & \textbf{2000} & \textbf{128756} & \textbf{6164} & \textbf{1.46} & \textbf{94.04} & \textbf{4.50} & \textbf{95} & \textbf{12134} & \textbf{32} & \textbf{208} & \textbf{124451} & \textbf{74.80} & \textbf{98.31} & \textbf{31.35} & \textbf{99.74} \\
    \addlinespace

    %   \rowcolor{lightgray}
    Average & 4 & \textbf{1420} & \textbf{57631} & \textbf{40951} & \textbf{6.93} & \textbf{60.57} & \textbf{32.50} & \textbf{199} & \textbf{10842} & \textbf{159} & \textbf{90} & \textbf{88713} & \textbf{63.37} & \textbf{98.79} & \textbf{68.06} & \textbf{94.88} \\
    \bottomrule

\end{tabular*}
\end{table*}
 \end{document}
5
  • 4
    please provide a full small test document, currently you are asking people to make the table fit without telling them how wide the page is, and your fragment uses many commands not defined by default \mytab ?? so no one can use it at all. May 13, 2019 at 12:40
  • sorry about that I just did May 13, 2019 at 12:50
  • @user3406764: Did you already try to just add another column? Maybe it will fit into the remaining space. If not, please tell us how wide its contents will be. Apart from that, you could decrease the fontsize. Alternatively, you can remove the first column and replace it with a heading similar to the one in the following image: i.stack.imgur.com/8dblS.png
    – leandriis
    May 13, 2019 at 12:55
  • 1
    you mean 6th group of columns, meaning three columns more? just write this column at the end of existed. however, it seems that after than you will need a wizard who will squeeze this table into text width (table will become almost unreadable due to small fonts).
    – Zarko
    May 13, 2019 at 14:19
  • It's physically impossible to add other 3 columns an leave the table vertical. Just divide it into two vertical sub-tables.
    – CarLaTeX
    May 18, 2019 at 9:21

1 Answer 1

1

Use sidewaystable. You still need to stick in the column with numbers though.

\documentclass[10pt,conference]{IEEEtran} 
\IEEEoverridecommandlockouts

\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{changepage}



\usepackage{lipsum}
\usepackage{ctable}% http://ctan.org/pkg/ctable
\usepackage{color, colortbl}
\newcommand{\var}{\textit}
\newcommand{\proc}{\textbf}
\newcommand{\prop}{\texttt}
\newcommand{\plusplus}{{+}{+}}% Other options: 
\newcommand*\ita[1]{\textit{#1}}
\usepackage{array, booktabs, makecell, multirow}% new
\definecolor{Gray}{gray}{0.9}
\usepackage{textcomp}

\usepackage{textcomp}
\usepackage{booktabs, makecell, multirow, tabularx,rotating}
\setcellgapes{2pt}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\usepackage{stfloats}

\usepackage{lipsum}
\usepackage{booktabs}
\newcommand\mytab[1]{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}
\newcommand\mc[2]{\multicolumn{#1}{c}{#2}}
\renewcommand{\algorithmiccomment}[1]{//#1}



\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}

\title{An Automated Approach for Refining Coarse-Grained Requirement-to-Code 
Traces\\
}
\begin{sidewaystable*}[htb]
\centering
\caption{Precision/recall and completeness of the requirement-to-method 
traces output by our approach}
\label{Results}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}l*{17}{c}}
    \toprule
    \multirow{2}{*}{\mytab{1-\\ Program}} 
    & \multirow{2}{*}{\mytab{2-\\ Step}} 
    & \mc{4}{\mytab{Cumulative\\ Predictions}} & \mc{3}{\mytab{Cumulative \\ Output\\ Completeness}}
    & \mc{5}{\mytab{Cumulative Precision \\ and Recall}} 
    & \mc{2}{\mytab{Cumulative \\ Output \\ Precision}}
    & \mc{2}{\mytab{Cumulative\\ Output \\ Recall}} \\
    \cmidrule{3-5} \cmidrule{6-8} \cmidrule{9-13}
    \cmidrule{14-15} \cmidrule{16-17}
    &
    & \mytab{3-\\ T\textsubscript{p} (\#)}
    & \mytab{4-\\ N\textsubscript{p} (\#)}
    & \mytab{5-\\ E\textsubscript{p} (\#)}
    & \mytab{5.5-\\Sum of stuff}
    & \mytab{6-\\ T (\%)}
    & \mytab{7-\\ N (\%)}
    & \mytab{8-\\ E (\%)}
    & \mytab{9-\\ TP}
    & \mytab{10-\\ TN}
    & \mytab{11-\\ FP}
    & \mytab{12-\\ FN}
    & \mytab{13-\\ E}
    & \mytab{14-\\ T (\%)}
    & \mytab{15-\\ N (\%)}
    & \mytab{16-\\ T (\%)}
    & \mytab{17-\\ N (\%)} \\
    \midrule
    Chess & 1 & 0 & 2063 & 3953 & 0 & 34.29 & 65.71 & 0 & 1612 & 0 & 0 & 4404 & NA & 100 & NA & 100 \\

    & 2 & 0 & 3227 & 2789 & 0 & 53.64 & 46.36 & 0 & 1841 & 0 & 49 & 4126 & NA & 97.41 & 0 & 100 \\

    & 3 & 908 & 3227 & 1881 & 15.09 & 53.64 & 31.27 & 415 & 1841 & 378 & 49 & 3333 & 52.33 & 97.41 & 89.44 & 82.97 \\

    & 4 & \textbf{1464} & \textbf{3227}
    & \textbf{1325} & \textbf{24.34} & \textbf{53.64}
    & \textbf{22.02} & \textbf{471} & \textbf{1841}
    & \textbf{438} & \textbf{49} & \textbf{3217}
    & \textbf{51.82} & \textbf{97.41} & \textbf{90.58}
    & \textbf{80.78} \\
    \addlinespace
    Gantt & 1 & 0 & 55535 & 34699 & 0 & 61.55 & 38.45 & 0 & 22365 & 0 & 0 & 67869 & NA & 100 & NA & 100 \\
    & 2 & 0 & 69880 & 20354 & 0 & 77.44 & 22.56 & 0 & 22707 & 0 & 94 & 67433 & NA & 99.59 & 0 & 100 \\

    & 3 & 677 & 69880 & 19677 & 0.75 & 77.44 & 21.81 & 84 & 22707 & 85 & 94 & 67264 & 49.70 & 99.59 & 47.19 & 99.63 \\
    & 4 & \textbf{1143} & \textbf{69880} & \textbf{19211} & \textbf{1.27} & \textbf{77.44} & \textbf{21.29} & \textbf{136} & \textbf{22707} & \textbf{136} & \textbf{94} & \textbf{67161} & \textbf{50.00} & \textbf{99.59} & \textbf{59.13} & \textbf{99.40} \\
    \addlinespace
    iTrust & 1 & 0 & 17573 & 149265 & 0 & 10.53 & 89.47 & 0 & 6572 & 0 & 0 & 160266 & NA & 100 & NA & 100 \\
    & 2 & 0 & 28660 & 138178 & 0 & 17.18 & 82.82 & 0 & 6685 & 0 & 9 & 160144 & NA & 99.87 & 0 & 100 \\

    & 3 & 290 & 28660 & 137888 & 0.17 & 17.18 & 82.65 & 81 & 6685 & 27 & 9 & 160036 & 75.00 & 99.87 & 90.00 & 99.60 \\

    & 4 & \textbf{1074} & \textbf{28660} & \textbf{137104} & \textbf{0.64} & \textbf{17.18} & \textbf{82.18} & \textbf{93} & \textbf{6685} & \textbf{28} & \textbf{9} & \textbf{160023} & \textbf{76.86} & \textbf{99.87} & \textbf{91.18} & \textbf{99.58} \\
    \addlinespace
    JHotDraw & 1 & 0 & 116787 & 20133 & 0 & 85.30 & 14.70 & 0 & 12013 & 0 & 0 & 124907 & NA & 100 & NA & 100 \\

    & 2 & 0 & 128756 & 8164 & 0 & 94.04 & 5.96 & 0 & 12134 & 0 & 208 & 124578 & NA & 98.31 & 0 & 100 \\

    & 3 & 1279 & 128756 & 6885 & 0.93 & 94.04 & 5.03 & 63 & 12134 & 20 & 208 & 124495 & 75.90 & 98.31 & 23.25 & 99.84 \\

    & 4 & \textbf{2000} & \textbf{128756} & \textbf{6164} & \textbf{1.46} & \textbf{94.04} & \textbf{4.50} & \textbf{95} & \textbf{12134} & \textbf{32} & \textbf{208} & \textbf{124451} & \textbf{74.80} & \textbf{98.31} & \textbf{31.35} & \textbf{99.74} \\
    \addlinespace

    %   \rowcolor{lightgray}
    Average & 4 & \textbf{1420} & \textbf{57631} & \textbf{40951} & \textbf{6.93} & \textbf{60.57} & \textbf{32.50} & \textbf{199} & \textbf{10842} & \textbf{159} & \textbf{90} & \textbf{88713} & \textbf{63.37} & \textbf{98.79} & \textbf{68.06} & \textbf{94.88} \\
    \bottomrule

\end{tabular*}
\end{sidewaystable*}
 \end{document}
2
  • I still want my table looking vertical and spanning over the two columns so this solution is not adequate May 13, 2019 at 13:08
  • 3
    Would have been nice to know.....
    – JPi
    May 13, 2019 at 13:23

You must log in to answer this question.

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