I have the following latex code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
\label{sec:introduction}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Motivation}
\label{sec:Motivation}
\subsection{Related work}
\label{sec:Related work}
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clitaeeeeeeeeeee kasd gubergren, no sea takimata diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptuaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeamet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clitaeeeeeeeeeee kasd gubergren, no sea takimata diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptuaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeamet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clitaeeeeeeeeeee kasd gubergren, no sea takimata diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptuaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeamet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clitaeeeeeeeeeee kasd gubergren, no sea takimata diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptuaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeamet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
\begin{table*}[H]
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& \makecell{Critera 1 \\ control} & \makecell{Critera 2 \\ optimal control} & \makecell{Critera 3 \\ smart control heuristic} & \makecell{Comparison to optimal \\ and smart control} & \makecell{Use of training data \\from other buildings} \\
\hline
Author 1 et al., 2020 [1] & \cmark & \rule{0.2cm}{0.2cm} & & & \\
\hline
\end{tabular}
\caption{Comparison of relevant papers from the literature}
\label{tab:my_label}
\end{table*}
\subsection{Contribution}
\label{sec:Contribution}
with the main file
\documentclass[5p,times,twocolumn]{elsarticle}
\usepackage{physics}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{hidelinks}
\usepackage{csquotes}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{acro}
\include{sections/00_acro}
\graphicspath{{figures/}}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{float}
\usepackage{comment}
\usepackage{subcaption}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{nomencl} % Nomenclature package
\usepackage{makecell}
\journal{}
\begin{document}
\begin{frontmatter}
\title{Title}
\author[1]{Author 1}
\author[1]{Author 2}
\address[1]{Institue 1}
\begin{abstract}
\input{sections/00_abstract}
\end{abstract}
\begin{comment}
%%Graphical abstract
\begin{graphicalabstract}
\includegraphics{grabs}
\end{graphicalabstract}
%%Research highlights
\begin{highlights}
\item Research highlight 1
\item Research highlight 2
\end{highlights}
\end{comment}
\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
keyword 1 \sep keyword 2 \sep keyword 3 \sep keyword 4 \sep keyword 5
%% PACS codes here, in the form: \PACS code \sep code
%\PACS 0000 \sep 1111
%% MSC codes here, in the form: \MSC code \sep code
%% or \MSC[2008] code \sep code (2000 is the default)
%MSC 0000 \sep 1111
\end{keyword}
\end{frontmatter}
\thispagestyle{empty} % Remove page number and header/footer on the first page
%% \linenumbers
%\input{sections/00_nomecl}
\input{sections/01_intro}
\input{sections/02_results}
\input{sections/03_conclusion}
%% If you have bibdatabase file and want bibtex to generate the
%% bibitems, please use
%%
\bibliographystyle{elsarticle-num}
\bibliography{refs}
%% else use the following coding to input the bibitems directly in the
%% TeX file.
% \begin{thebibliography}{00}
% %% \bibitem{label}
% %% Text of bibliographic item
% \bibitem{}
% \end{thebibliography}
\end{document}
\endinput
%%
%% End of file `elsarticle-template-num.tex'.
The problem is that when using \begin{table*}[H]
the table disappears. When just using \begin{table*}
the table is being displayed in the middle of the next page which is not what I want. I want it to be displayed at the place where it is defined in the code. So I use the [H] but this does not work. Do you know how I can place the table at the position where it is defined?
\begin{table}
and\end{table}
and use\captionof
instead of\caption
. Then the table doesn't float, i.e., will be placed at the position where it is first seen regardless of whether there is space or not.\begin{table*}[h]
(with lower caseh
) or maybet
orb
, that might already work and is a bit less drastic than not using a float at all.float
does not support float typeH
for floats over two columns liketable*
orfigure*
. Usuallytable*
andfigure*
only support float optionst
andp
.