Estou escrevendo minha tese sobre o seguinte modelo, onde as subtabelas são detectadas como uma nova tabela e incrementadas 1.1
em vez de rotuladas como (a)
e (b)
. Não tenho ideia do que impede isso.
\documentclass[a4paper,oneside,12pt]{report}
\usepackage{float}
\usepackage{multirow}
\usepackage{subfigure}
\usepackage{array}
\usepackage{subfigure} %
\usepackage{amsmath}
\usepackage{subcaption}
\begin{document}
\chapter{INTRODUCTION}
\label{chapter:introduction}
\begin{table}[!htp]
\caption{Average ...}~\label{tab:mytable}
\begin{subtable}% {1\linewidth}
\centering
\begin{tabular}{|l|c|c|c|}
\hline
\textbf{Method} & \textbf{Gas Used} & \textbf{Ethereum} & \textbf{Polygon} \\
& \textbf{(gas)} & \textbf{USD cost} & \textbf{USD cost} \\
\hline
submitJob & 264967 & 7.04 & 0.019 \\ \hline
\end{tabular}
\caption{Obtained from A environment.}
\vspace{0.5cm}
\begin{tabular}{|l|c|c|c|}
\hline
\textbf{Method} & \textbf{Gas Used} & \textbf{Ethereum} & \textbf{Polygon} \\
& \textbf{(gas)} & \textbf{USD cost} & \textbf{USD cost} \\
\hline
updateProviderInfo & 33284 & 0.88 & 0.002 \\ \hline
\end{tabular}
\caption{Obtained from B platform.}
\end{subtable}%
\end{table}
\end{document}
Saída:
Saída desejada:
Responder1
Para citar oPágina CTANdo subfigure
pacote:
O pacote [subfigure] agora é considerado obsoleto: foi substituído porsubfigura, mas os usuários podem encontrar o mais recentesublegendapacote mais satisfatório.
Resumidamente:Nãouse o subfigure
pacote.
A solução a seguir emprega o subcaption
pacote. Observe que este pacote subtable
e subfigure
ambientes levam um,obrigatórioargumento: a largura pretendida. Para o caso de uso em questão, sugiro que você use \textwidth
(ou, equivalentemente, \linewidth
) como a largura pretendida.
\documentclass[a4paper,oneside,12pt]{report}
\usepackage{array} % for 'w' column type and '\extrarowheight' length parameter
\usepackage{subcaption}
\captionsetup[table]{skip=0.333\baselineskip}
% handy utility macro:
\newcommand\mytab[1]{\smash{%
\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}}
\newlength\mylen
\begin{document}
\setcounter{chapter}{1}
\begin{table}[!htp]
\settowidth\mylen{updateProviderInfo} % calculate target width of first column
\setlength\extrarowheight{2pt} % for a less-cramped look
\caption{Average ...} \label{tab:mytable}
\begin{subtable}{\linewidth}
\centering
\begin{tabular}{|wl{\mylen}|c|c|c|}
\hline
Method & \mytab{Gas Used\\(gas)}
& \mytab{Ethereum\\USD cost}
& \mytab{Polygon\\USD cost} \\
& & & \\ \hline
submitJob & 264967 & 7.04 & 0.019 \\ \hline
\end{tabular}
\medskip
\caption{Obtained from A environment.}
\end{subtable}
\bigskip
\begin{subtable}{\linewidth}
\centering
\begin{tabular}{|wl{\mylen}|c|c|c|}
\hline
Method & \mytab{Gas Used\\(gas)}
& \mytab{Ethereum\\USD cost}
& \mytab{Polygon\\USD cost} \\
& & & \\ \hline
updateProviderInfo & 33284 & 0.88 & 0.002 \\ \hline
\end{tabular}
\medskip
\caption{Obtained from B platform.}
\end{subtable}
\end{table}
\end{document}