![¿Cómo puedo forzar que los títulos de las subtablas comiencen desde (a)?](https://rvso.com/image/476260/%C2%BFC%C3%B3mo%20puedo%20forzar%20que%20los%20t%C3%ADtulos%20de%20las%20subtablas%20comiencen%20desde%20(a)%3F.png)
Estoy escribiendo mi tesis sobre la siguiente plantilla donde las subtablas se detectan como una tabla nueva y se incrementan en 1.1
lugar de etiquetarse como (a)
y (b)
. No tengo idea de qué lo impide.
\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}
Producción:
Salida deseada:
Respuesta1
Para citar delpágina CTANdel subfigure
paquete:
El paquete [subfigure] ahora se considera obsoleto: fue reemplazado porsubfig., pero los usuarios pueden encontrar las más recientessubtítuloPaquete más satisfactorio.
En breve:Noutilizar el subfigure
paquete.
La siguiente solución emplea el subcaption
paquete. Tenga en cuenta que los entornos subtable
y de este paquete subfigure
toman uno,obligatorioargumento: el ancho previsto. Para el caso de uso que nos ocupa, le sugiero que utilice \textwidth
(o, equivalentemente, \linewidth
) como el ancho previsto.
\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}