3

I want to put footnote for AAAAAAAAA

\documentclass[review]{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}
\linespread{1}
\usepackage[hidelinks]{hyperref}

% packages for tables \usepackage{multirow} \usepackage[table,xcdraw]{xcolor} \usepackage{graphicx} \usepackage{graphics} \usepackage{caption} \usepackage{color,soul} \usepackage{fullpage} \usepackage[skip=1ex, font=small, labelfont=bf]{caption} % packages for tables \usepackage[table,xcdraw]{xcolor} \usepackage{multirow, tabularx} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx, varwidth} \usepackage{tablefootnote}

\usepackage{enumitem} \usepackage{lineno,hyperref} \modulolinenumbers[5] \begin{document} \renewcommand{\arraystretch}{2} \begin{table}[H] \centering \caption{Grid search leaderboard} \begin{tabular}{ccccccc} \hline Test No.& type&SeASDues & $R^2$ & PrAcessing& ML moADls& MeSDFaASFdel \ \hline 1 & Stacked & 12 & 0.96 & PCA & PolyFASres, EADR, DTR, GSDFR & LassoLarsCV\ 2 & Stacked & 14 & 0ASD3& ZeroSDnt, MinMaSDFDaler& DT, ETR, RiSFe&XGB\ 3 & Stacked & 17 & 0.96 & ZeroCASDunt,RobASDScaler&RiSDgeCV&XBG\ \textbf{4} & \textbf{Stacked} & \textbf{18}& \textbf{0SDF8}& \textbf{MinMADScaler, RobustScaler}& \textbf{GBR, PolyFeADres, LassoLarsCV} & \textbf{RSFgeCV} \ \textbf{5} & \textbf{Stacked} & \ASDA& \ASDASD9 & \textbf{TTT} & \textbf{GBR, PSDFADes, SGD, DTR} & \textbf{LassoLarsCV}\ 6 & Stacked &20 & 0SDF5 &-& RF, AAAAAAAAAA , PolyFeatSDFres &LassoLarsCV\ 7 & Stacked & 75 & 0.SD6 & -&F_regression, XGB & XGB\ 8& Stacked & 100 & 0.95 &ZeroCount, RobustScaler, MaxAbsScaler & XGB, Ridge & GBR\ \textbf{9} & \textbf{ANN} & \textbf{12}&\textbf{0.80} &\textbf{MinMaxScaler} &\textbf{[13,32,32,1]} &\textbf{-}\ 10 &ANN &16 & 0.53 & MinMaxScaler & [13,512,128,1]& - \ 11& ANN & 22 & 0.71 &MinMaxScaler& [13,64,512,1] &-\ 12& ANN & 100 & 0.77 & MinMaxScaler & [13,128,1024,16,1] &-\ \hline

\end{tabular} \end{table}

\end{document}

daleif
  • 54,450
Ahmad Turani
  • 291
  • 1
  • 13

2 Answers2

3

To long for the comment ...

  • Your document example unfortunately doesn't work. It also afzer your edits still use some undefined commands.
  • It not contain any footnote. Please add it where you like to have \footnotemark
  • Do you really need all those packages? Some of them are already loaded by other packages, some are loaded twice ... Cleanup your preamble!
  • Package hyperref should be loaded last.

For starting point you may for table xtabularx use and define forth and fifth column as L type, for which in preamble define \newcolumntype{L}{>{\raggedright\arraybackslash}X}:

\begin{table}[ht]
\centering
\caption{Grid search leaderboard}
\setlength\tabcolsep{4pt}
\small
\begin{tabularx}{\linewidth}{@{} cccl LL l @{}}
\hline
\makecell{Test\\ No.} & type & \makecell{SeAS\\Dues} & $R^2$ & PrAcessing& ML moADls& \makecell{MeSD-\\ FaASFdel} \\ \hline

By this changes, your table will fit in text block:

enter image description here

For inserting footnotes, Please first edit your question again with considering aforementioned. Then We will be able simple add desired footnote.

Zarko
  • 296,517
  • Thank you so much. there is "AAAAAAAAAA" in the middle which I want to add footnote for it. I will dit and let you know. By the way small makes font smaller? – Ahmad Turani Dec 13 '22 at 09:45
  • @AhmadTurani, well, you know where you like to have \footnotemark, just add ˙\footnote there. Yes, the command \small make font smaller. I suggest you to read some introductory text about LateX. For example https://tobi.oetiker.ch/lshort/lshort.pdf – Zarko Dec 13 '22 at 10:17
1

Since your code loads the threeparttable package, you might as well make use of it to generate the desired footnote. Please see the code below for an example of how to employ \tnote directives and the tablenotes environment.

To make the table fit inside the width of the text block, I suggest you employ a tabularx environment and employ the X column type for columns 5 and 6.

enter image description here

\documentclass[review]{elsarticle}
\usepackage{geometry}
%%\usepackage{epsfig}
%%\usepackage{latexsym} % latexsym was superseded by amssymb in 1994
\usepackage{amssymb}
%%\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{caption,subcaption} \captionsetup{skip=1ex, font=small, labelfont=bf} % are you sure about "font=small"? \usepackage{rotating} %\usepackage{subfigure} \linespread{1} \usepackage[hidelinks]{hyperref}

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

% packages for tables \usepackage[table,xcdraw]{xcolor} \usepackage{multirow} %%%, tabularx} \usepackage{tabularray} \UseTblrLibrary{booktabs, siunitx, varwidth} %%\usepackage{tablefootnote}

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

%% new code: \usepackage{lipsum} \newcolumntype{L}{>{\raggedright\arraybackslash}X}

\begin{document} %\renewcommand{\arraystretch}{2} % seems excessive \begin{table}[ht] %%\centering % not needed \begin{threeparttable} \caption{Grid search leaderboard} \label{GridASDASDh} % Allow automatic line breaks in columns 5 and 6: \begin{tabularx}{\textwidth}{@{} l ccc LL l @{}} \toprule %\hline Test No.& type & SeASDues & $R^2$ & PrAcessing & ML moADls & MeSDFaASFdel \ \midrule %\hline 1 & Stacked & 12 & 0.96 & PCA & PolyFASres, EADR, DTR, GSDFR & LassoLarsCV\ \addlinespace 2 & Stacked & 14 & 0ASD3& ZeroSDnt, MinMaSDFDaler& DT, ETR, RiSFe&XGB\ \addlinespace 3 & Stacked & 17 & 0.96 & ZeroCASDunt, RobASDScaler & RiSDgeCV & XBG\ \addlinespace \textbf{4} & \textbf{Stacked} & \textbf{18} & \textbf{0SDF8} & \textbf{MinMADScaler, RobustScaler}& \textbf{GBR, PolyFeADres, LassoLarsCV} & \textbf{RSFgeCV} \ \addlinespace \textbf{5} & \textbf{Stacked} & ASDA & ASDASD9 & \textbf{TTT} & \textbf{GBR, PSDFADes, SGD, DTR} & \textbf{LassoLarsCV}\ \addlinespace 6 & Stacked & 20 & 0SDF5 & -- & RF, AAAAAAAAAA,\tnote{a} PolyFeatSDFres &LassoLarsCV\ \addlinespace 7 & Stacked & 75 & 0.SD6 & -- & F_regression, XGB & XGB\ \addlinespace 8 & Stacked & 100& 0.95 & ZeroCount, RobustScaler, MaxAbsScaler & XGB, Ridge & GBR\ \addlinespace \textbf{9} & \textbf{ANN} & \textbf{12} & \textbf{0.80} & \textbf{MinMaxScaler} & \textbf{[13,32,32,1]} & \textbf{--}\ \addlinespace 10& ANN & 16 & 0.53 & MinMaxScaler & [13,512,128,1] & -- \ \addlinespace 11& ANN & 22 & 0.71 & MinMaxScaler & [13,64,512,1] & -- \ \addlinespace 12& ANN & 100& 0.77 & MinMaxScaler & [13,128,1024,16,1] & -- \ \bottomrule %\hline \end{tabularx}

\smallskip\footnotesize \begin{tablenotes} \item[a] Some footnote text. \end{tablenotes} \end{threeparttable}

\end{table}

\lipsum[1-5] % filler text

\end{document}

Mico
  • 506,678
  • 1
    Thanks @Mico. there is many sentences added i dont know where they come from !! Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus adipiscing semper elit. Proin fermentum massa ac quam. Sed diam turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia. Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt purus vel – Ahmad Turani Dec 13 '22 at 10:29
  • 1
    @AhmadTurani - That's strictly optional filler text, generated by the directive \lipsum[1-5]. The main purpose of the filler text is to illustrate the width of the text block. In your own code, you should obviously not include \lipsum directives. – Mico Dec 13 '22 at 10:32
  • Thank you. unfortunately due to my other packages I think my table is not consistent like yours – Ahmad Turani Dec 13 '22 at 13:26
  • @AhmadTurani - Not sure what to say. The code I provided employs the same document class and loads the same packages as you say your code does. – Mico Dec 13 '22 at 14:54