
As coisas parecem muito boas sem threeparttable
.
Remova o comentário de três partes e notas de tabela e a legenda subirá para o parágrafo anterior.
\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}
Responder1
Não há necessidade de \raisebox
; use t
(alinhamento superior) no argumento opcional de tabular
e \firsthline
(doarray
pacote) em vez do primeiro \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}
Se você decidir usar o booktabs
pacote para suas tabelas (e eu sugiro isso), então algum trabalho extra terá que ser feito: no exemplo a seguir defini um comando \firsttoprule
que mistura os recursos de \firsthline
e \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}