0

I was asked to create a table in LaTeX in which some citations are made inside it using the IEEE standard. Also, I was asked that the caption of that table is placed above. However, for some reason it is the only table in which I have troubles doing that. As soon as I place both the caption and the label above the rest of the code of the table, the pdf won't compile.

Code from the table

%-TABLE 8 -%
\begin{table}[]
\centering
\caption{Most used algorithms in ML for eartquakes}
\label{tab:tabla_8}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|l|c|}
\hline
\textbf{N} &
  \textbf{Algorithms} &
  \textbf{ML Methods} &
  \multicolumn{1}{c|}{\textbf{References}} &
  \textbf{Total number of articles} \\ \hline
 &
   &
  Linear SCV &
   &
  0 \\ \cline{3-5} 
 &
   &
  SGD Classifier &
   &
  0 \\ \cline{3-5} 
1 &
  Classification &
  Naïve Bayes &
  \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}\cite{source_2} \cite{source_12} \cite{source_13} \cite{source_14} \\ \cite{source_16} \cite{source_36} \\[5pt] \cite{source_45} \cite{source_49} \cite{source_54} \cite{source_71} \cite{source_73} \cite{source_77} \cite{source_83} \cite{source_89} \cite{source_105}\end{tabular}} &
  15 (12\%) \\ \cline{3-5} 
 &
   &
  KNeighborsClassifier &
   &
  0 \\ \hline
 &
   &
  MeanShift &
   &
  0 \\ \cline{3-5} 
2 &
  Clustering &
  VBGMM &
   &
  0 \\ \cline{3-5} 
 &
   &
  MiniBatch KMeans &
   &
  0 \\ \cline{3-5} 
 &
   &
  KMeans &
  \multicolumn{1}{c|}{\cite{source_55}} &
  1 (1\%) \\ \hline
 &
   &
  SGD Regressor &
   &
  0 \\ \cline{3-5} 
 &
   &
  Lasso &
  \multicolumn{1}{c|}{\cite{source_1} \cite{source_54} \cite{source_56} \cite{source_77} \cite{source_106} \\[5pt] \cite{source_4}} &
  5 (4\%) \\ \cline{3-5} 
3 &
  Regression &
  ElasticNET &
   &
  0 \\ \cline{3-5} 
 &
   &
  RidgeRegressions &
  \multicolumn{1}{c|}{\cite{source_4}} &
  1 (1\%) \\ \cline{3-5} 
 &
   &
  EnsembleRegressors &
   &
  0 \\ \hline
 &
   &
  Randomized PCA &
   &
  0 \\ \cline{3-5} 
 &
   &
  Isomap &
   &
  0 \\ \cline{3-5} 
4 &
  Dimensionality reduction &
  Spectral Embedding &
   &
  0 \\ \cline{3-5} 
 &
   &
  SEE ALSO &
  \multicolumn{1}{c|}{\cite{source_24}} &
  1 (1%) \\ \cline{3-5} 
 &
   &
  Kernel Approximation &
   &
  0 \\ \hline
\end{tabular}%
}
\end{table}

I also want to provide a link in which you can find the full article with the corresponding .bib file https://drive.google.com/file/d/1XUQuquNBvoxrQucr0ja-Qc522tychlmf/view?usp=sharing

This is quite a strange issue but I hope there's a solution to this. Thank you

3
  • 2
    Welcome to TEX.SE! Please provide a full minimal working example which reproduces the issue, starting with \documentclass{...} and ending with \end{document}. Links to external files are discouraged because your question will become meaningless when the link disappears (next week, or next year, or... ).
    – campa
    Commented Oct 28, 2023 at 15:18
  • There is more than one "IEEE standard". Please be more specific as to the documentclass and the packages you employ.
    – Mico
    Commented Oct 28, 2023 at 15:36
  • please don't use an external link that will break, make a small example in the question Commented Oct 28, 2023 at 16:12

2 Answers 2

0

Try this. This is much simpler and minimal.

\documentclass[conference,a4paper]{IEEEtran}
\usepackage{balance}
\usepackage[pdftex]{graphicx}

\usepackage{tabularray}

%****************************************



\begin{document}
      
\begin{table*}
\centering
\caption{Most used algorithms in ML for eartquakes}
\label{tab:tabla_8}
\begin{tblr}{width=\textwidth,
colspec={c X[c,m,0.75] *{3}{X[c,m]}},
hlines={solid},
vlines={solid},
row{1}={font = \bfseries}
}
    N & Algorithms & ML Methods & References & Total Number of Articles\\
    \SetCell[c=1,r=4]{m}{1} & \SetCell[c=1,r=4]{m}{Classification} & Linear SCV & & 0\\
    & & SGD Classifier & & 0 \\
    & & Naïve Bayes & \cite{source_2, source_12, source_13, source_14, source_16, source_36,source_45,source_49,source_54,source_71,source_73, source_77, source_83, source_89, source_105} & 15 (12\%)\\
    & & KNeighborsClassifier & & 0\\
    \SetCell[c=1,r=4]{m}{2} & \SetCell[c=1,r=4]{m}{Clustering} & MeanShift & & 0 \\
    & & VBGMM & & 0 \\
    & & MiniBatch KMeans & & 0\\
    & & KMeans & \cite{source_55} & 1 (\%)\\
    \SetCell[c=1,r=5]{m}{3} & \SetCell[c=1,r=5]{m}{Regression} & SGD Regressor & & 0 \\
    & & Lasso & \cite{source_1,source_54, source_56, source_77, source_106, source_4} & 5 (4\%)\\
    & & ElasticNET & & 0 \\
    & & RidgeRegressions & \cite{source_4} & 1 (1\%)\\
    & & EnsembleRegressors & & 0\\
    \SetCell[c=1,r=5]{m}{4} & \SetCell[c=1,r=5]{m}{Dimensionality reduction} & Randomized PCA & & 0\\
    & & Isomap & & 0\\
    & & Spectral Embedding & & 0\\
    & & SEE ALSO & \cite{source_24} & 1 (1\%)\\
    & & Kernel Approximation & & 0\\
\end{tblr}
\end{table*}
    
\end{document}

Output is: enter image description here

2
  • If you want, you can play with colspec to obtain the desired column spacing. I would recommend reading the documentation of tabularray package. Commented Oct 29, 2023 at 14:12
  • I still need to learn a lot more about LaTeX packages. Thank you so much
    – Chris Cars
    Commented Nov 4, 2023 at 0:34
0

The issue I think is not the caption, but that your table code has errors. You forgot to add one \ to the % almost at the end of the table. Also, do not use \\ to break the line inside a multicol environment, it is also throwing an error there.

Here the table with the modifications, i.e., with the offended part commented. Since you are resizing it to the whole textwidth, I changed table to table*, to "get out" of the double column format imposed by ÌEEEtran

Output: enter image description here

Code:

\documentclass[conference,a4paper]{IEEEtran}
\usepackage{balance}
\usepackage[pdftex]{graphicx}
\usepackage{multicol, multirow}

\begin{document}
    
%-TABLE 8 -%
\begin{table*}[]
    \centering
    \caption{Most used algorithms in ML for eartquakes}
    \label{tab:tabla_8}
    \resizebox{\textwidth}{!}{%
        \begin{tabular}{|c|c|c|l|c|}
            \hline
            \textbf{N} &
            \textbf{Algorithms} &
            \textbf{ML Methods} &
            \multicolumn{1}{c|}{\textbf{References}} &
            \textbf{Total number of articles} \\ \hline
            &
            &
            Linear SCV &
            &
            0 \\ \cline{3-5} 
            &
            &
            SGD Classifier &
            &
            0 \\ \cline{3-5} 
            1 &
            Classification &
            Naïve Bayes &
            \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}\cite{source_2} \cite{source_12} \cite{source_13} \cite{source_14} %\\   % HERE!!!!
            \cite{source_16} \cite{source_36} %\\[5pt]   % HERE!!!!
            \cite{source_45} \cite{source_49} \cite{source_54} \cite{source_71} \cite{source_73} \cite{source_77} \cite{source_83} \cite{source_89} \cite{source_105}\end{tabular}} &
            15 (12\%) \\ \cline{3-5} 
            &
            &
            KNeighborsClassifier &
            &
            0 \\ \hline
            &
            &
            MeanShift &
            &
            0 \\ \cline{3-5} 
            2 &
            Clustering &
            VBGMM &
            &
            0 \\ \cline{3-5} 
            &
            &
            MiniBatch KMeans &
            &
            0 \\ \cline{3-5} 
            &
            &
            KMeans &
            \multicolumn{1}{c|}{\cite{source_55}} &
            1 (1\%) \\ \hline
            &
            &
            SGD Regressor &
            &
            0 \\ \cline{3-5} 
            &
            &
            Lasso &
            \multicolumn{1}{c|}{\cite{source_1} \cite{source_54} \cite{source_56} \cite{source_77} \cite{source_106} %\\[5pt]   % HERE!!!!
            \cite{source_4}} &
            5 (4\%) \\ \cline{3-5} 
            3 &
            Regression &
            ElasticNET &
            &
            0 \\ \cline{3-5} 
            &
            &
            RidgeRegressions &
            \multicolumn{1}{c|}{\cite{source_4}} &
            1 (1\%) \\ \cline{3-5} 
            &
            &
            EnsembleRegressors &
            &
            0 \\ \hline
            &
            &
            Randomized PCA &
            &
            0 \\ \cline{3-5} 
            &
            &
            Isomap &
            &
            0 \\ \cline{3-5} 
            4 &
            Dimensionality reduction &
            Spectral Embedding &
            &
            0 \\ \cline{3-5} 
            &
            &
            SEE ALSO &
            \multicolumn{1}{c|}{\cite{source_24}} &
            1 (1\%<) \\ \cline{3-5}  % HERE!!!! missing 
            &
            &
            Kernel Approximation &
            &
            0 \\ \hline
        \end{tabular}%
    }
\end{table*}
    
\end{document}
1
  • PS: maybe you would like to try tablesgenerator.com for other tables, it is an "excel-like" online tool to create tables in Latex, also providing export to booktabs style. I find it quite useful for such big tables!
    – Jes
    Commented Oct 29, 2023 at 10:53

You must log in to answer this question.

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