0

enter image description hereMy table width was too much but anyhow I could handle that. Now the length is too much it is going out of margin. What should I do?

\documentclass[review]{elsarticle}
%\documentclass[1p]{elsarticle}
\usepackage{geometry}
\usepackage{epsfig}
\usepackage{latexsym}
\usepackage[font={normalsize}]{caption}
\usepackage[para,flushleft]{threeparttable}
\renewcommand{\TPTtagStyle}{\textit}
\usepackage{booktabs}
%\usepackage{nicematrix}
\usepackage{amsmath}
\usepackage{fullpage}
\usepackage{setspace}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{float}
\usepackage{indentfirst}
\usepackage{changepage}
\usepackage{adjustbox}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{subcaption}
\usepackage{rotating}
%\usepackage{subfigure}

% packages for tables \usepackage{multirow} \usepackage[table,xcdraw]{xcolor} \usepackage{graphicx} \usepackage{graphics} \usepackage{caption} \usepackage{adjustbox}

%\usepackage[normalem]{ulem} %\usepackage[usenames, dvipsnames]{color}

%\usepackage{nomencl} %\usepackage{cite}

\usepackage{natbib}

%\usepackage[numbers,super]{natbib} %\setcitestyle{numbers,super}

\usepackage{enumitem}

\usepackage{lineno,hyperref} \modulolinenumbers[5]

%\renewcommand{\thefootnote} \newcommand\degrees[1]{\ensuremath{#1^\circ}}

\newcommand\mycaption[1]{\caption{\footnotesize{#1}}}

\newcommand\myfootnote[1]{\footnote{\small{#1}}}

\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}

\renewcommand{\TPTtagStyle}{\textit}

\newcommand{\splitcell}[1]{\begin{tabular}{@{}c@{}}#1\end{tabular}}

\setlist[enumerate]{label=\arabic.}

\bibliographystyle{elsarticle-num}

\begin{document}

\begin{table}[H] \centering

%\setlength{\tabcolsep}{2pt} % <--- should be local, anyway

\caption{Summary of the relevant state of the art} \label{SART}% <--- the label refers to the caption

\begin{tabular}{@{}ccccccl@{}} \toprule % headers \splitcell{Independent \ variables} & \splitcell{Target \ variable} & \splitcell{Data \ records} & Train/test (%) & Model & Metrics & Reference \ \midrule % body \splitcell{Critical energy relexxxxte \ un-notched strength\ young modulus\ hole diameter \ width\ stackixxxxxquences} & Strength & 10000 & 90/10 & \splitcell{XGBoost\RF\Gauxxxxan Processes \ANN}& RMSE = 0.005 & Furtado et al. furtado2021methodology \ \addlinespace \splitcell{Young modulus\ Damage inxxxxstrain\ xxxtion strain\ damage curve angle} & f-pod curve & 15000 & 70/30 & \splitcell{LSTM\ANN}& RMSE=0.266 & Reiner et al. reiner2021machine \ \addlinespace \splitcell{particle size\ curinxxxe,power level\ volume fraction\ curing angle} & strength & 46 & 78/22 & \splitcell{ANFIS\ANN}& \splitcell{RMSE0.0307\ MAE=xxx.0098\ $R^2$=0.99\ RMSE=0.0827} &xxxxet al. \ \addlinespace \splitcell{crack poxxxxion\ pattern type\ loading angle\ sample thickness\cxxxxxngth} & Toughness & 2xxx0 & xx/20 & \splitcell{KNN\ DT\ RF\SVM}& RMSE=0.266 & Balcıoğlu exxxx balciouglxxxxmparison \ \addlinespace & & 4367 & & & RMSE = 3$\times$10$^{-6}$ & Sun et al.xxxxx21prediction \ \addlinespace & & 1015 & & & RMSE = 0.03 & Breuer et al. \ \addlinespace & & 30 & & & \splitcell{$R^2$ = 0xx6 \ RMSE = 0.4369 \ MAE = 0.3265} & Zhang et al. zhang2xxxxxchine \ \addlinespace & & 30 & & & \splitcell{$R^2$ = 0.99 \ RMSE = 0.08 \ MAE = 0.06} & Zhang et al. zxxxx \ \addlinespace & & 922 & & & \splitcell{RMxxxxxx.131 \ $R^2$ = 0.735} & Yin et al. yin2021machine \ \addlinespace & & 8960 & & & $R^2$ = 0.98 & This study \ \bottomrule \end{tabular}

\end{table}

Ahmad Turani
  • 291
  • 1
  • 13

2 Answers2

1

The height of the table is increased because you're using the review document class option; don't worry about it.

I would, though, be worries about the table also being too wide. The following code contains some -- actually, quite a few -- suggestions for how the situation could be improved. Mostly, I would not use \splitcell directives in the first column and, instead, allow automatic line breaking.

enter image description here

\documentclass[review]{elsarticle}
\usepackage{fullpage} % really?
\usepackage[font={normalsize}]{caption}
\usepackage[para,flushleft]{threeparttable}
\renewcommand{\TPTtagStyle}{\textit}
\usepackage{booktabs}

\usepackage{amsmath} \usepackage{setspace} \usepackage{mathtools} \usepackage{fancyhdr} \usepackage{sectsty} \usepackage{siunitx} \usepackage{tabularx} \usepackage{float} \usepackage{indentfirst} \usepackage{changepage} \usepackage{adjustbox} \usepackage{rotating} \usepackage{makecell} \usepackage{subcaption} \usepackage{rotating}

\usepackage{multirow} \usepackage[table,xcdraw]{xcolor}

%\usepackage[normalem]{ulem} %\usepackage[usenames, dvipsnames]{color} %\usepackage{nomencl} %\usepackage{cite}

\usepackage{natbib} %\usepackage[numbers,super]{natbib} %\setcitestyle{numbers,super}

\usepackage{enumitem}

\usepackage{lineno,hyperref} \modulolinenumbers[5]

%\renewcommand{\thefootnote} \newcommand\degrees[1]{\ensuremath{#1^\circ}} \newcommand\mycaption[1]{\caption{\footnotesize{#1}}} \newcommand\myfootnote[1]{\footnote{\small{#1}}} \newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}} \renewcommand{\TPTtagStyle}{\textit} \newcommand{\splitcell}[1]{\begin{tabular}[t]{@{}l@{}}#1\end{tabular}} \setlist[enumerate]{label=\arabic.}

\bibliographystyle{elsarticle-num}

%% New code: \captionsetup{skip=0.333\baselineskip} \usepackage{calc,ragged2e} \hyphenation{gauss-ian}

\begin{document}

\begin{table}[ht!]

\setlength{\tabcolsep}{1pt}

\caption{Summary of the relevant state of the art} \label{SART}% <--- \label must come afer \caption

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} >{\RaggedRight}p{0.21\textwidth} >{\RaggedRight}p{\widthof{f-pod curve}} p{\widthof{records}} >{\centering\arraybackslash}p{\widthof{Train/test}} >{\RaggedRight}p{\widthof{RF, Gauss-}} l l @{}} \toprule % headers Independent variables & Target variable & Data records & Train/test (%) & Model & Metrics & Reference \ \midrule

% body Critical energy relexxxxte, un-notched strength, young modulus, hole diameter, width, stacking sequences & Strength &
10000 & 90/10 & XGBoost, RF, Gaussian processes, ANN & RMSE: 0.005 & Furtado et al. %furtado2021methodology \ \addlinespace Young modulus, Damage initiation strain, xxxtion strain, damage curve angle & f-pod curve & 15000 & 70/30 & LSTM, ANN & RMSE: 0.266 & Reiner et al. %reiner2021machine \ \addlinespace Particle size, curinxxxe, power level, volume fraction, curing angle & strength & 46 & 78/22 & ANFIS, ANN & \splitcell{RMSE: 0.0307\ MAE: 0.0098\ $R^2$: 0.99\ RMSE: 0.0827} & Okafor et al. %\okafor2021evaluation \ \addlinespace Crack poxxxxion, pattern type, loading angle, sample thickness, cxxxxxngth & Toughness & 200 & 80/20 & KNN, DT, RF, SVM & RMSE: 0.266 & Balcıoğlu et al. %balciouglu2021comparison \ \addlinespace & & 4367 & & & RMSE: $3{\times}10^{-6}$ & Sun et al. %sun2021prediction \ \addlinespace & & 1015 & & & RMSE: 0.03 & Breuer et al. %breuer2021prediction \ \addlinespace & & 30 & & & \splitcell{$R^2$: 0xx6 \ RMSE: 0.4369 \ MAE: 0.3265} & Zhang et al. %zhang202xxchine \ \addlinespace & & 30 & & & \splitcell{$R^2$: 0.99 \ RMSE: 0.08 \ MAE: 0.06} & Zhang et al. %zhang2021machine \ \addlinespace & & 922 & & & \splitcell{RMSE: 0.131 \ $R^2$: 0.735} & Yin et al. %yin2021machine \ \addlinespace & & 8960 & & & $R^2$: 0.98 & This study \ \bottomrule \end{tabular*}

\end{table} \end{document}

Mico
  • 506,678
  • Thanks. I used the code but still I need to use \footnotesize. That is ok but still it is going somewhat outside. a little bit like attached. please help. – Ahmad Turani Feb 04 '22 at 13:38
  • can we anyhow reduce the space between rows? – Ahmad Turani Feb 04 '22 at 13:46
  • @AhmadTuranin - The space between rows will shrink automatically if you omit the review option from the \documentclass directive. – Mico Feb 04 '22 at 18:22
1

Like this:

enter image description here

Off-topic:

-You need to clean-up your document preamble: remove all twice (and more) loaded package, rethinking if you really need all packages, some of them are not needed anymore

On-topic:

  • You may consider novel table package `tabularray.

  • Using it and its X column types will significantly simplified table code

  • Since table is wide, you may consider smaller font size, for example \footnotesize as is in MWE below. If this is not an option, than possible solution is rotate table.

  • for more option see enter link description here. Edit

  • Complete table is:

\documentclass{elsarticle}
\usepackage{fullpage}
\usepackage[skip=1ex,
            font=small, labelfont=bf]{caption}
% packages for tables
\usepackage[table,xcdraw]{xcolor}
\usepackage{tabularx}
\UseTblrLibrary{booktabs, siunitx, varwidth}

\begin{document} \begin{table}[ht] \footnotesize \caption{Summary of the relevant state of the art} \label{tab: SART}% <--- the label refers to the caption

\begin{tblr}{colsep = 3pt, colspec={@{} X[1,l] X[0.5,c] Q[c,m,si={table-format=5.0}] Q[c] X[0.8,c] X[0.7,c] X[1,l] @{}}, row{1} = {font=\bfseries, m}, row{2-Y} = {rowsep=3pt}, measure=vbox } \toprule % headers {Independent\ variables} & {Target\ variable} & {{{Data\ records}}} & {Train/\ test (%)} & Model & Metrics & Reference \ \midrule % body Critical energy releted un-notched strength young modulus hole diameter width stackinq sequences & Strength & 10000 & 90/10 & XGBoost RF Gausian Processes ANN & RMSE$ = 0.005$ & Furtado et al. furtado2021methodology \ % \addlinespace Young modulus Damage in strain station strain damage curve angle & f-pod curve & 15000 & 70/30 & LSTM ANN & RMSE=0.266 & Reiner et al. reiner2021machine \ particle size curing, power level, volume fraction, curing angle & strength & 46 & 78/22 & {ANFIS\ ANN} & {RMSE0.0307\ MAE=xxx.0098\ $R^2 = 0.99$\ RMSE$ = 0.0827$} & xxxxet al. \ crack position, pattern type, loading angle, sample thickness, cxxxxxngth & Toughness & 23450 & xx/20 & {KNN DT\ RF SVM} & RMSE$=0.266$ & Balcıoğlu e balciougl comparison \ & & 4367 & & & RMSE$ = 3\times 10^{-6}$ & Sun et al.xxxxx21prediction \ & & 1015 & & & RMSE$ = 0.03$ & Breuer et al. \ & & 30 & & & {$R^2 = 0xx6$ \ RMSE$ = 0.4369$ \ MAE$ = 0.3265$} & Zhang et al. zhang2xxxxxchine \ & & 30 & & & {$R^2 = 0.99$ \ RMSE$ = 0.08$ \ MAE$ = 0.06$} & Zhang et al. zxxxx \ & & 922 & & & {RMxxxxxx.131 \ $R^2 = 0.735$} & Yin et al. yin2021machine \ & & 8960 & & & $R^2 = 0.98$ & This study \ \bottomrule \end{tblr} \end{table} \end{document}

Addendum: A try to clean-up and reorganize your document preamble. Considered are only package (since the most of your command definition considering suggested table design are not needed anymore:

\documentclass[review]{elsarticle}
% layout
\usepackage[margin=20mm]{geometry}
\usepackage{changepage}
\usepackage{setspace}
\usepackage{indentfirst}
%
\usepackage{lineno}
\modulolinenumbers[5]
%
\usepackage{fancyhdr}
\usepackage{sectsty}
%
\usepackage[normalem]{ulem}
% math
\usepackage{latexsym, mathtools}
% packages for tables
\usepackage{rotating}
\usepackage[table,xcdraw]{xcolor}
\usepackage[para,flushleft]{threeparttable}
\renewcommand{\TPTtagStyle}{\textit}
\usepackage{rotating}
\usepackage{makecell, multirow, % for %classic" tables
            tabularx}           % for %classic" tables
\usepackage{tabularray}         % novel tabler package
\usepackage{booktabs, siunitx,  % load this package
            varwidth}    
% floats and captions
\usepackage{float}
\usepackage[skip=1ex,
            font=small, labelfont=bf]{caption}
\usepackage{subcaption}
% graphic
\usepackage{adjustbox}  % it load graphicx too
% nomenclature, bib
\usepackage{nomencl}
\usepackage{cite}
\usepackage{natbib}

\usepackage{hyperref}

Zarko
  • 296,517