
없이는 상황이 꽤 좋아 보입니다 threeparttable
.
threeparttable 및 tablenotes의 주석 처리를 제거하면 캡션이 이전 단락까지 올라갑니다.
\documentclass{scrbook}
%
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{threeparttable}
\usepackage{lipsum}
%
\KOMAoptions{captions=topbeside}
\setcapindent*{0pt}%
\begin{document}
\chapter{Crapper}
\lipsum[1]
\begin{table}[h]%
\label{tab:psource:final-params}%
\begin{captionbeside}{This is the captions which should be top aligned}[l]%
\raisebox{\dimexpr0.5\baselineskip-0.5\totalheight\relax}{%
%\begin{threeparttable}
\begin{tabular}{cccc}
\hline
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{1} \\
Test & Test & Test & Test \\
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{2} \\
\hline
\end{tabular}
% \begin{tablenotes}
% \item[1]{Test note}
% \item[2]{Test note}
% \end{tablenotes}
%\end{threeparttable}%
}%
\end{captionbeside}
\end{table}
\end{document}
답변1
필요하지 않습니다 \raisebox
. t
의 선택적 인수에 (상단 정렬)을 사용 tabular
하고 \firsthline
(에서array
패키지) 첫 번째 대신 \hline
:
\documentclass{scrbook}
%
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{threeparttable,array}
\usepackage{lipsum}
%
\KOMAoptions{captions=topbeside}
\setcapindent*{0pt}%
\begin{document}
\chapter{Test}
\lipsum[1]
\begin{table}%
\label{tab:psource:final-params}%
\begin{captionbeside}{This is the caption which is now top aligned}[l]%
\begin{threeparttable}
\begin{tabular}[t]{cccc}
\firsthline
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{1} \\
Test & Test & Test & Test \\
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{2} \\
\hline
\end{tabular}
\begin{tablenotes}
\item[1]{Test note}
\item[2]{Test note}
\end{tablenotes}
\end{threeparttable}%
\end{captionbeside}
\end{table}
\end{document}
테이블에 패키지를 사용하기로 결정한 경우 booktabs
(저는 이것을 제안합니다) 몇 가지 추가 작업을 수행해야 합니다. 다음 예에서는 및 \firsttoprule
기능을 혼합하는 명령을 정의했습니다 .\firsthline
\toprule
\documentclass{scrbook}
%
\usepackage[english]{babel}
\usepackage{caption}
\usepackage{threeparttable,array,booktabs}
\usepackage{lipsum}
%
\KOMAoptions{captions=topbeside}
\setcapindent*{0pt}%
\makeatletter
\newcommand\firsttoprule{%
\multicolumn1c{%
\global\backup@length\ht\@arstrutbox
\global\advance\backup@length\dp\@arstrutbox
\global\advance\backup@length\arrayrulewidth
\raise\extratabsurround\copy\@arstrutbox
}\\[-\backup@length]\toprule
}
\makeatother
\begin{document}
\chapter{Test}
\lipsum[1]
\begin{table}[h]%
\label{tab:psource:final-params}%
\begin{captionbeside}{This is the caption which is now top aligned}[l]%
\begin{threeparttable}[t]
\begin{tabular}[t]{cccc}
\firsttoprule
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{1} \\
Test & Test & Test & Test \\
Test & Test & Test & Test \\
Test & Test & Test & Test\tnote{2} \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[1]{Test note}
\item[2]{Test note}
\end{tablenotes}
\end{threeparttable}%
\end{captionbeside}
\end{table}
\end{document}