.png)
다음과 같은 문제가 있습니다.
테이블 위의 캡션이 공백이 아닌 왼쪽으로 플러시되기 시작하고 싶습니다. 내 프로젝트의 MWE 복사 붙여넣기는 다음과 같습니다.
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
\usepackage{graphicx}
\begin{document}
\maketitle
\begin{table*}[pos=t]
\caption{Observed results of the user study.}
\label{tab:Result_time}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lllllllllllll}
\toprule
& & \textbf{P1} & \textbf{P2} & \textbf{P3} & \textbf{P4} & \textbf{P5} & \textbf{P6} & \textbf{P7} & \textbf{P8} & \textbf{P9} & \textbf{P10} & \textbf{P11} \\ \midrule
\multicolumn{1}{c}{\multirow{3}{*}{\textbf{Scenario 1}}} & Accuracy & 100\% & 50\% & 100\% & 0\% & 100\% & 100\% & 100\% & 0\% & 100\% & 50\% & 100\% \\
\multicolumn{1}{c}{} & Time Taken & 18:13 & 15:40 & 16:26 & 20:32 & 17:10 & 18:08 & 16:22 & 18:50 & 12:18 & 16:27 & 15:41 \\
\multicolumn{1}{c}{} & Number of queries & 18 & 10 & 11 & 15 & 7 & 12 & 16 & 22 & 12 & 10 & 15 \\ \midrule
\textbf{Scenario 2} & Time Taken & 7:35 & 8:39 & 10:20 & 10:41 & 9:47 & 14:28 & 12:24 & 18:28 & 8:29 & 9:11 & 8:24 \\ \midrule
\textbf{Scenario 3} & Time Taken & 6:21 & 4:50 & 5:42 & 7:18 & 4:30 & 4:52 & 4:27 & 5:15 & 5:04 & 6:12 & 5:48
\\
\bottomrule
\end{tabular}
}
\end{table*}
\end{document}
추가하려고 시도했지만 \captionsetup{justification=justified}
소용이 없습니다.
답변1
els-cas
클래스를 로드할 때 일부 변수(이 경우 캡션 상자의 너비를 유지하는 변수)를 초기화합니다. 이 작업은 페이지 기하학을 설정하기 전에 발생하므로 캡션은 텍스트 너비가 변경되었음을 알 수 없습니다(다른 버그입니다 ) .
\textwidth
2열 테이블을 사용할 때 너비가 를 사용하고 있음을 명시적으로 말해야 \begin{table*}[width=\textwidth]
하지만 프리앰블에서 다음을 사용하여 전역적으로 설정할 수 있습니다.
\AtBeginDocument{\setlength{\FullWidth}{\textwidth}}
els-cas
이렇게 하면 의 값이 수정됩니다 \textwidth
(지적해 주신 egreg에게 감사드립니다). 또한 테이블의 크기를 조정하지 마세요. 기간.
문서에서:
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
\usepackage{graphicx}
\AtBeginDocument{\setlength{\FullWidth}{\textwidth}}
\begin{document}
\maketitle
\begin{table*}[pos=t,width=\textwidth]
\caption{Observed results of the user study.}
\label{tab:Result_time}
\begin{tabular}{@{}*{13}{l}@{}}
\toprule
& & \textbf{P1} & \textbf{P2} & \textbf{P3} & \textbf{P4} & \textbf{P5} & \textbf{P6} & \textbf{P7} & \textbf{P8} & \textbf{P9} & \textbf{P10} & \textbf{P11} \\ \midrule
\multicolumn{1}{@{}c}{\multirow{3}{*}{\textbf{Scenario 1}}} & Accuracy & 100\% & 50\% & 100\% & 0\% & 100\% & 100\% & 100\% & 0\% & 100\% & 50\% & 100\% \\
\multicolumn{1}{@{}c}{} & Time Taken & 18:13 & 15:40 & 16:26 & 20:32 & 17:10 & 18:08 & 16:22 & 18:50 & 12:18 & 16:27 & 15:41 \\
\multicolumn{1}{@{}c}{} & Number of queries & 18 & 10 & 11 & 15 & 7 & 12 & 16 & 22 & 12 & 10 & 15 \\ \midrule
\textbf{Scenario 2} & Time Taken & 7:35 & 8:39 & 10:20 & 10:41 & 9:47 & 14:28 & 12:24 & 18:28 & 8:29 & 9:11 & 8:24 \\ \midrule
\textbf{Scenario 3} & Time Taken & 6:21 & 4:50 & 5:42 & 7:18 & 4:30 & 4:52 & 4:27 & 5:15 & 5:04 & 6:12 & 5:48
\\
\bottomrule
\end{tabular}
\end{table*}
\end{document}
답변2
주제를 벗어:
- 테이블을 텍스트 너비에 맞추기 위해 축척 상자를 사용하지 마십시오. 오히려 LaTeX에
\tabcolsep
맡겨 크기를 계산하고@{\extracolsep{\fill}}
필요한 경우 테이블에 사용되는 글꼴 크기를 줄입니다(귀하의 경우에는 필요하지 않습니다). - MWE에서는 하나의 열 문서가 있으므로 간단한
table
환경을 사용할 수 있습니다. 아직 문제를 보고하지 않았습니다.
\documentclass[a4paper,fleqn]{cas-dc}
\usepackage[numbers]{natbib}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}
\begin{document}
\lipsum[11]
\begin{table}[pos=ht]
\caption{Observed results of the user study. \lipsum[66]}
\label{tab:Result_time}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} lllllllllllll }
\toprule
& & \textbf{P1} & \textbf{P2} & \textbf{P3} & \textbf{P4} & \textbf{P5}
& \textbf{P6} & \textbf{P7} & \textbf{P8} & \textbf{P9} & \textbf{P10}
& \textbf{P11} \\ \midrule
\multicolumn{1}{c}{\multirow{3}{*}{\textbf{Scenario 1}}}
& Accuracy
& 100\% & 50\% & 100\% & 0\% & 100\%
& 100\% & 100\% & 0\% & 100\% & 50\%
& 100\% \\
& Time Taken
& 18:13 & 15:40 & 16:26 & 20:32 & 17:10
& 18:08 & 16:22 & 18:50 & 12:18 & 16:27
& 15:41 \\
& Number of queries
& 18 & 10 & 11 & 15 & 7
& 12 & 16 & 22 & 12 & 10
& 15 \\ \midrule
\textbf{Scenario 2}
& Time Taken
& 7:35 & 8:39 & 10:20 & 10:41 & 9:47
& 14:28 & 12:24 & 18:28 & 8:29 & 9:11
& 8:24 \\ \midrule
\textbf{Scenario 3}
& Time Taken
& 6:21 & 4:50 & 5:42 & 7:18 & 4:30
& 4:52 & 4:27 & 5:15 & 5:04 & 6:12
& 5:48 \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
원하는 결과를 제공합니다.