I use the following template and want to place some tables exactly in a specific place using the command [H] and \usepackage{float}. However, the solution proposed HERE does not work for two-column documents, neither for the tables, nor for the algorithms.
For the algorithms, I get the following error message:
"[H] in two columns mode is not allowed for algorithms."
And for the figures, I get this error message:
"Unknown float option `H'."
For the tables, although I do not get error message, but [H] has no effect.
The tables and algorithms are actually shown in the end of document.
https://www.overleaf.com/latex/templates/elseviers-cas-latex-double-column-template/hhzpymgjmxfk
Update: As requested in comments, I add an example of the table that is currently shown in the end of document as follows. I am sure that I added the \usepackage{float}. I also tested the latex template link of Overleaf and it is available.
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{float}
\begin{document}
\begin{table}[H]
\caption{Caption.}
\label{Table_1}
\begin{tabular}{cccc}
\toprule
\shortstack{P \ R} & \shortstack{N \ C} & \shortstack{P \ Re} & \shortstack{N \ T}\
\midrule
1 & 3 & $10^{3}$ & 100\
2 & 3 & $10^{3}$ & 100\
3 & 3 & $10^{3}$ & 100\
4 & 3 & $10^{3}$ & 100\
5 & 3 & $10^{3}$ & 100\
6 & 3 & $10^{3}$ & 100\
7 & 3 & $10^{3}$ & 100\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Update: See tables 1 and 2 (page 10) in this Elsevier journal; two wide tables inserted at the top of the page, and not at the end of the document. That's exactly what I want to do : https://reader.elsevier.com/reader/sd/pii/S0164121223000225?token=A1940EF6353745EE00367916369CD219EE8C93261423E249D8A8CA73E8CFF38976F08D1A2005BBC72F6A7BDF6E47A110&originRegion=eu-west-1&originCreation=20230302121751
\begin{table*}[H]what would you expect it to do? a spanning float can only go at top or bottom of the page, you can not use h or H – David Carlisle Feb 28 '23 at 17:17\begin{figure}[H]but the same error as before... In any case, my main need is to apply float for the tables and algorithms? – Questioner Feb 28 '23 at 17:22\RenewDocumentEnvironment { table* } { O{width=\FullWidth} }so redefining these environments with a custom optional argument, as such they will be incompatible withfloatpackage. Always the same comment about publisher classes, only use them if submitting to the publisher, and then use them as specfied, redefining the macros will just make it more likely your submision is rejected. – David Carlisle Feb 28 '23 at 17:31document classand\usepackage{float}I really do not know what complementary elements you need to be added, but the latex template that is for Elsevier publisher is added to the question so you can see all the features of this temple. If you can not access the template please let me know, I tested it and the template is accessible. – Questioner Feb 28 '23 at 17:33\bibsepis undefined (a bug in the class) so added\newdimen\bibsepand an error about the spurious}on the last row which I deleted, but then it makes the expected output with no error – David Carlisle Feb 28 '23 at 17:38cas-dc.cls. Clould you please say that when exactly I should add\newdimen\bibsepto fix the error? Thanks – Questioner Feb 28 '23 at 18:05cas-dc.clsis in texlive. So in a local installation, or on overleaf, you can simply use\documentclass[a4paper,fleqn]{cas-dc}just as you can use\documentclass[a4paper,fleqn]{article}you do not need to install any extra files downloaded from Elsevier or ctan. – David Carlisle Mar 01 '23 at 11:56\documentclass[a4paper,fleqn]{cas-dc}as before and by using\begin{table*}[H]the table is still shown at the end of the document. (I put*because the table is wide.) – Questioner Mar 01 '23 at 12:12[H], the table is not placedHere, but yet at the end of the document. And also, withbegin{table*}[H]it is not shown at the top of the page, but at the end of the document. – Questioner Mar 01 '23 at 14:59\begin{table*}[h]you are preventing top floats (not) and as you can not havehyou are forcing the figure to the end of the document. Just use\begin{table*}and move it early enough in the source file that it lands on the page you want. – David Carlisle Mar 02 '23 at 12:38