2

I want to wrap two tables in latex. My code is the following:

\usepackage{caption}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{floatrow}


\begin{wraptable}{l}
\begin{table}{H}
\begin{tabular}{|c|c|}
\hline
Topology - Distance function & ARI \\ \hline
Hextop - dist                &  0  \\
Hextop - mandist             &  0   \\
Randtop - dist               &  0   \\
Randtop - mandist            &  0   \\ \hline
\end{tabular}
\begin{tabular}{|c|c|}
\hline
Topology - Distance function & ARI \\ \hline
Hextop - dist                &  0   \\
Hextop - mandist             &  0   \\
Randtop - dist               &   0  \\
Randtop - mandist            &  0   \\ \hline
\end{tabular}
\caption{Comparison of ARI score for grid 10 x 10 and 70 maximal number of epochs (left) and grid 61 x 61 and 10 maximal number of epochs (right)}
\end{table} 
\end{wraptable}

With the result of:

enter image description here

As you can see its wrapped correctly, however on the left side on the page there is sign table[H] and there is no caption in the table. I'm not sure how to improve it, I tried to build this table without using \begin{table} but I'm not sure how can I do it. Can I ask you for a hand in doing so?

3
  • You definitely need to drop the use of the table environment, since you're not planning on having the table float around.
    – Werner
    Dec 2, 2021 at 19:57
  • 1
    you can not have a table enviornment in a wraptable (or any box) but please fix your example so that people can run it and see the issue and test answers. It is an incomplete fragment at present Dec 2, 2021 at 20:04
  • 1
    you say it is "wrapped correctly" but you show no wrapping at all. The "wrap" in wraptable refers to wrapping an outer paragraph of text, making a "cut-out" for the table, unlike a standard table that comes between lines of text. You show no text at all outside the table so no possibility of it wrapping. see how the paragraph Nam dui... is cut out to wrap around the table here tex.stackexchange.com/a/361829/1090 Dec 2, 2021 at 20:51

1 Answer 1

2

I think what you want is two tabulars next to each other inside a table environment. So just get rid of the wraptable, and correct the table syntax.

\documentclass{article}
\usepackage{caption}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{floatrow}

\begin{document}
\begin{table}[H]
\begin{tabular}{|c|c|}
\hline
Topology - Distance function & ARI \\ \hline
Hextop - dist                &  0  \\
Hextop - mandist             &  0   \\
Randtop - dist               &  0   \\
Randtop - mandist            &  0   \\ \hline
\end{tabular}
\begin{tabular}{|c|c|}
\hline
Topology - Distance function & ARI \\ \hline
Hextop - dist                &  0   \\
Hextop - mandist             &  0   \\
Randtop - dist               &   0  \\
Randtop - mandist            &  0   \\ \hline
\end{tabular}
\caption{Comparison of ARI score for grid 10 x 10 and 70 maximal number of epochs (left) and grid 61 x 61 and 10 maximal number of epochs (right)}
\end{table} 
\end{document}

enter image description here

You must log in to answer this question.

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