
내 텍스트에서 하위 표를 참조하고 싶습니다. 그런데 명령어를 사용하면 ref
테이블 번호와 하위 테이블 번호가 구분 없이 표시됩니다. 두 숫자 사이에 점이나 공백이 있기를 바랍니다. 예를 들어 표시되기를 바랍니다."표 I.(a)"오히려"표 Ia". 그렇다면 이 문제를 해결할 수 있는 가능한 해결책이 있습니까?
\ref{tab:week2}
\begin{table}[h]
\begin{subtable}[h]{0.45\textwidth}
\centering
\begin{tabular}{l | l | l}
Day & Max Temp & Min Temp \\
\hline \hline
Mon & 20 & 13\\
Tue & 22 & 14\\
\end{tabular}
\caption{First Week}
\label{tab:week1}
\end{subtable}
\hfill
\begin{subtable}[h]{0.45\textwidth}
\centering
\begin{tabular}{l | l | l}
Day & Max Temp & Min Temp \\
\hline \hline
Mon & 17 & 11\\
Tue & 16 & 10\\
\end{tabular}
\caption{Second Week}
\label{tab:week2}
\end{subtable}
\caption{Max and min temps recorded in the first two weeks of July}
\label{tab:temps}
\end{table}
답변1
제공했어야 했는데전체 MWE.
그러나 해결책은 다음과 같습니다.
\documentclass{article}
\usepackage[labelformat=simple]{subcaption} % packages subfigure and subfig are obsolete
\renewcommand\thesubtable{(\alph{subtable})}
\makeatletter
\renewcommand\p@subtable{\thetable.}
\makeatother
\begin{document}
\ref{tab:week2}
\begin{table}[h]
\begin{subtable}[h]{0.45\textwidth}
\centering
\begin{tabular}{l | l | l}
Day & Max Temp & Min Temp \\
\hline \hline
Mon & 20 & 13\\
Tue & 22 & 14\\
\end{tabular}
\caption{First Week}
\label{tab:week1}
\end{subtable}
\hfill
\begin{subtable}[h]{0.45\textwidth}
\centering
\begin{tabular}{l | l | l}
Day & Max Temp & Min Temp \\
\hline \hline
Mon & 17 & 11\\
Tue & 16 & 10\\
\end{tabular}
\caption{Second Week}
\label{tab:week2}
\end{subtable}
\caption{Max and min temps recorded in the first two weeks of July}
\label{tab:temps}
\end{table}
\end{document}