3

I am sending my paper to mdpi.com. They have their own standard of paper formatting. One of my tables is very wide and exceededs the paper's width

enter image description here

There is big space on the left side. Is there a way I can shift the table only to the left to look like this?

enter image description here

Here is my script:

    \caption{ML algorithms and evaluation methods used for clinical notes.}
    \begin{center}
        \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
            \hline
        \multirow{2}{*}{\textbf{\thead{Research}}}  
        & \multicolumn{6}{c|}{\textbf{\thead{Statistical Algorithms}}} 
        & \multicolumn{4}{c|}{\textbf{\thead{Neural Networks}}}
        & \multicolumn{5}{c|}{\textbf{\thead{Evaluation Methods}}}  
        \\
        \cline{2-16} 

        &\textbf{\thead{RF}}&\textbf{\thead{LR}}&\textbf{\thead{DT}}&\textbf{\thead{SVM}}&\textbf{\thead{NB}}&\textbf{\thead{KNN}}&\textbf{\thead{CNN}}&\textbf{\thead{RNN}}&\textbf{\thead{LSTM}}&\textbf{\thead{GRU}}
        &\textbf{\thead{Recall}}&\textbf{\thead{Precision}}&\textbf{\thead{F1\\Score}}&\textbf{\thead{Accuracy}}&\textbf{\thead{AUC}}
        \\

        \hline

        \thead{\cite{426}}
        &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} \\

        \cline{1-16}                
        \thead{\cite{473}}  
        &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} 
        &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{mygreen}{\checkmark}}    &\thead{\textcolor{red}{\ding{53}}} &\thead{\textcolor{red}{\ding{53}}} \\


        \cline{1-16}

    \end{tabular}
    \label{table_Algorithms}
\end{center}

\end{table}

Testing all these algorithms manually would require data science expertise along with a large

This is the script header

\documentclass[computers,article,submit,moreauthors,pdftex]{Definitions/mdpi} 
\maxdeadcycles=10000
\usepackage{amsmath,amssymb,pifont,amsfonts,makecell,ulem}

\usepackage{xcolor}

\usepackage{acronym}

\acrodef{AutoML}[AutoML]{automated machine learning} \acrodef{ML}[ML]{machine learning} \acrodef{AI}[AI]{artificial intelligence} \acrodef{EHR}[EHR]{electronic health record} \acrodef{NLP}[NLP]{natural language processing} \acrodef{SVM}[SVM]{support vector machine} \definecolor{mygreen}{RGB}{30, 155, 30}

\firstpage{1} \makeatletter \setcounter{page}{@firstpage} \makeatother \pubvolume{1} \issuenum{1} \articlenumber{0} \pubyear{2021} \copyrightyear{2020} %\externaleditor{Academic Editor: Firstname Lastname} \datereceived{} \dateaccepted{} \datepublished{}

Edit:

I rotated them vertically but the header text touches the line above

    \begin{table}[!htb]
        \caption{ML algorithms and evaluation methods used for clinical notes.}
    \centering  % <---
\setlength\tabcolsep{3pt}
    \begin{center}

        \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
            \hline

            \multirow{2}{*}{\textbf{\thead{Research}}}  
            &amp; \multicolumn{6}{c|}{\textbf{\thead{Statistical Algorithms}}} 
            &amp; \multicolumn{4}{c|}{\textbf{\thead{Neural Networks}}}
            &amp; \multicolumn{5}{c|}{\textbf{\thead{Evaluation Methods}}}  
            \\
            \cline{2-16} 

            &amp;\rot{\textbf{\thead{RF}}}
            &amp;\rot{\textbf{\thead{LR}}}
            &amp;\rot{\textbf{\thead{DT}}}
            &amp;\rot{\textbf{\thead{SVM}}}
            &amp;\rot{\textbf{\thead{NB}}}
            &amp;\rot{\textbf{\thead{KNN}}}
            &amp;\rot{\textbf{\thead{CNN}}}
            &amp;\rot{\textbf{\thead{RNN}}}
            &amp;\rot{\textbf{\thead{LSTM}}}
            &amp;\rot{\textbf{\thead{GRU}}}
            &amp;\rot{\textbf{\thead{Recall}}}
            &amp;\rot{\textbf{\thead{Precision}}}
            &amp;\rot{\textbf{\thead{F1 Score}}}
            &amp;\rot{\textbf{\thead{Accuracy}}}
            &amp;\rot{\textbf{\thead{AUC}}}
            \\

            \hline

            \thead{\cite{426}}
            &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{mygreen}{\checkmark}}    &amp;\thead{\textcolor{red}{\ding{53}}} 
            &amp;\thead{\textcolor{red}{\ding{53}}} 
            &amp;\thead{\textcolor{red}{\ding{53}}} 
            &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{mygreen}{\checkmark}}    &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{mygreen}{\checkmark}}    &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{mygreen}{\checkmark}}    &amp;\thead{\textcolor{red}{\ding{53}}} &amp;\thead{\textcolor{red}{\ding{53}}} \\


enter image description here

asmgx
  • 437

2 Answers2

6

You wrote,

"I cannot make [the table] narrower"

Yes you can -- by, say, getting rid of all \textbf directives and almost all \thead directives in the header cells, omitting all 17 vertical bars, setting \tabcolsep to 0pt and employing a tabular* environment, employing a \small font size directive. Separately, you could use the line-drawing macros of the booktabs package -- \toprule, \midrule, \cmidrule, \addlinespace, and \bottomrule -- instead of \hline and \cline in order to give the table a more open and inviting "look".

enter image description here

\documentclass[computers,article,submit,moreauthors,pdftex]{Definitions/mdpi}

%% [preamble]

%% new: \usepackage{booktabs,lipsum} \newcommand\redcross{\textcolor{red}{\footnotesize\ding{53}}} \newcommand\greencheck{\textcolor{mygreen}{\checkmark}}

\begin{document}

\begin{table} \setlength\tabcolsep{0pt} \caption{ML algorithms and evaluation methods used for clinical notes.} \label{table_Algorithms}

\small
    \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l *{15}{c} }
        \toprule

        Research
        &amp; \multicolumn{6}{c}{Statistical Algorithms} 
        &amp; \multicolumn{4}{c}{Neural Networks}
        &amp; \multicolumn{5}{c}{Evaluation Methods}  
        \\
        \cmidrule{2-7} \cmidrule{8-11} \cmidrule{12-16} 
        &amp;RF&amp;LR&amp;DT&amp;SVM&amp;NB&amp;KNN
        &amp;CNN&amp;RNN&amp;LSTM&amp;GRU
        &amp;Recall&amp;Prec.&amp;\thead{F1\\Score}&amp;Acc.&amp;AUC
        \\
        \midrule
        \cite{426}
        &amp; \redcross &amp; \greencheck &amp; \redcross   &amp; \redcross   &amp; \redcross 
        &amp; \redcross &amp; \greencheck &amp; \redcross   &amp; \greencheck &amp; \redcross 
        &amp; \redcross &amp; \redcross   &amp; \greencheck &amp; \redcross   &amp; \redcross \\
        \addlinespace                 
        \cite{473} 
        &amp; \redcross &amp; \redcross   &amp; \redcross   &amp; \greencheck &amp; \redcross   
        &amp; \redcross &amp; \greencheck &amp; \greencheck &amp; \greencheck &amp; \redcross    
        &amp; \redcross &amp; \redcross   &amp; \greencheck &amp; \redcross   &amp; \redcross \\     
        \bottomrule           
    \end{tabular*}

\end{table}

\lipsum[2] % filler text \end{document}

Mico
  • 506,678
4

See, if the following suit to your needs:

\documentclass{article}
\usepackage{geometry}

\usepackage{amsmath,amssymb,pifont,ulem} \newcommand\Yes{\textcolor{red}{\ding{53}}} % <--- \newcommand\No{\textcolor{teal}{\checkmark}} % <--- \usepackage{makecell, multirow, rotating} % <--- \renewcommand\theadfont{\bfseries} % <--- \renewcommand\theadgape{} % <--- \usepackage{xcolor}

\begin{document} \begin{table} \caption{ML algorithms and evaluation methods used for clinical notes.} \centering % <--- \setlength\tabcolsep{3pt} % <--- \settowidth\rotheadsize{\theadfont Accuracy} \begin{tabular}{|c| {15}{>{\centering\arraybackslash}p{1.8em}|} } \hline \multirow{2}{}{\thead{Research}} & \multicolumn{6}{c|}{\thead{Statistical Algorithms}} & \multicolumn{4}{c|}{\thead{Neural Networks}} & \multicolumn{5}{c|}{\thead{Evaluation Methods}} \ \cline{2-16}

        &amp; \rothead{RF}      &amp; \rothead{LR}  &amp; \rothead{DT}      &amp; \rothead{SVM}
        &amp; \rothead{NB}      &amp; \rothead{KNN} &amp; \rothead{CNN}     &amp; \rothead{RNN}
        &amp; \rothead{LSTM}    &amp; \rothead{GRU} &amp; \rothead{Recall}  &amp;\rothead{Precision} &amp;\rothead{F1 Score} &amp;\rothead{Accuracy}     &amp; \rothead{AUC}   \\
        \hline
        \thead{\cite{426}}
        &amp; \No   &amp; \Yes  &amp; \No   &amp; \No   &amp; \No   &amp; \No   &amp; \Yes  &amp; \No
        &amp; \Yes  &amp; \No   &amp; \No   &amp; \No   &amp; \Yes  &amp; \No   &amp; \No   \\

        \cline{1-16}
        \thead{\cite{473}}
        &amp; \No   &amp; \No   &amp; \No   &amp; \Yes  &amp; \No   &amp; \No   &amp; \Yes  &amp; \Yes
        &amp; \Yes  &amp; \No   &amp; \No   &amp; \No   &amp; \Yes  &amp; \No   &amp; \No   \\
        \cline{1-16}
    \end{tabular}
    \label{table_Algorithms}

\end{table} \end{document}

First two rows in above MWQE I use because I haven't used \documentclass. If table is still to wide, than try to reduce font size to \small:

enter image description here

Zarko
  • 296,517
  • Thanks, I used rotated header which indeed helped with reducing the table's width.. the only problem i have now is the space, coz the Accuracy word touching the line on top. I will edit my question – asmgx Feb 10 '21 at 16:11
  • 1
    @asmgx, if you consider my answer as it is, you would'n t have your troubles ;-). In your MWE you forgot on the following code line from my MWE: \settowidth\rotheadsize{\theadfont Accuracy}. BTW, consider to remove all clutter in your MWE. For comparison see MWE in received answers. – Zarko Feb 10 '21 at 16:21