# Long Table containing figures ,equations and multicolumn

I want to make a long table (3 to 4 pages) of 5 columns containing its name, figure, equation, advantages, and disadvantages

But when I am using longtable package and other helping material from the web, I am not able to get the desired table, although various errors occurred

Here is the shortcode

\documentclass{article}

\usepackage{longtable}
% \usepackage[left=0.2cm, right=1cm, top=2cm]{geometry}
\title{A longtable example}

\begin{document}

\begin{center}
\begin{longtable}{|p{2.5cm}|p{3cm}|p{2cm}|p{2cm}|p{2cm}|}

\caption{Overview of papers including Image Compression Based On Deep
Learning Techniques} \label{tab:long} \\
\hline
\hline \multicolumn{1}{c}{\textbf{Activation }} &\multicolumn{1}{c}
{\textbf{Figure}} & \multicolumn{1}{c}{\textbf{Equation}} & \multicolumn{1}

%& \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline

\multicolumn{5}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{c}{\textbf{Equation}} & \multicolumn{1}{c}
% \hline
% & \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline

% \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
% \endfoot

\hline
\endlastfoot
\hline
% \multicolumn{2}{c}{\textbf{CNN Based Architectures}} \\
% \hline
\textbf{Sigmoid}\cite{sigmoid} 1995 & \includegraphics[width=20mm]
{sigmoid1.jpg}
& $\sigma(x)=\frac{1}{1+e^{-x}}$  & Squashes numbers in the range [0,1]
& \begin{itemize} \item Causes saturation by killing the gradients \item
Not zero centered which makes it impracticable to use \item Exponential function is a bit expensive function making it infeasible to use in practice \end{itemize} \\

end{longtable}

\end{center}
\end{document}


try the following:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[demo,               % in real document remove option "demo"
longtable}
\usepackage{enumitem}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begingroup
\small                              % for better fit text into cells
\setlength{\LTcapwidth}{\linewidth} % that caption width is equal to table width
\setlist[itemize]{  nosep,          % itemize setup
leftmargin = *,
before     = \vspace{-\baselineskip},
after      = \vspace{-\baselineskip}
}
\setcellgapes{3pt}
\makegapedcells                  % for additional vertica space around cells' contents
\setlength\tabcolsep{4pt}
\setkeys{Gin}{width=\linewidth}  % all images will have width equal to cell's widths
\begin{longtable}{|*{3}{p{\dimexpr0.16\linewidth-2\tabcolsep-1.2\arrayrulewidth}|}
*{2}{p{\dimexpr0.26\linewidth-2\tabcolsep-1.2\arrayrulewidth}|}}
\caption{Overview of papers including Image Compression Based On Deep Learning Techniques}
\label{tab:long}    \\
\hline
\hline
\caption{Overview of papers including Image Compression Based On Deep Learning (cont.)}            \\
\hline
\hline
\multicolumn{5}{r}{\footnotesize\textit{continued on the next page}}
\endfoot
\hline
\endlastfoot
\textbf{Sigmoid}\cite{sigmoid} 1995
& \includegraphics[valign=t]{sigmoid1.jpg}
& $\sigma(x)=\frac{1}{1+e^{-x}}$
& Squashes numbers in the range [0,1]
&   \begin{itemize}
\item   Causes saturation by killing the gradients
\item   Not zero centered which makes it impracticable to use
\item   Exponential function is a bit expensive function making it infeasible to use in practice
\end{itemize}           \\
\end{longtable}
\endgroup
\end{document}


(red lines indicate text borders)

• Thanks, but still figure is black, its a black box, when I tried on my own document – Dipti Mishra Apr 26 '19 at 5:17
• if you would read code carefuller, you would see usepackage[demo, % remove in real document, meaning, that demo option should not be used in real document. it generate black rectangle instead real image, which i haven't. – Zarko Apr 26 '19 at 5:21
• @DiptiMishra, you are welcome. however, if answer fulfill all your expectation, you can accept it (by clicking on the check mark at the top left side of answer.) :-) – Zarko Apr 26 '19 at 5:38
• @DiptiMishra, i add some more comments to code. they should explain what for are some code lines. – Zarko Apr 26 '19 at 5:49
• Hi, when i degined that table in separate file, it was perfect, but when i am placing that code in my original document which is following double column format, the table also come in same format ,,half of the page in every page is blank verticaly – Dipti Mishra Apr 26 '19 at 7:22