I am unable to find a method to place the caption of a table to the right or left of this specific table. Does anyone know if there is a way to do this in plain TEX or Koma Script (eventually in conjunction with the tabularx environment)?
[Tex/LaTex] Table caption to the left or right of table
captionshorizontal alignment
Related Solutions
Here is a solution that uses the caption
and the floatrow
packages. Your commenttable
command has to be put in the first argument of the ttabbox
command, just after caption{…}
. To have a correct vertical spacing, I had to modify it slighly.
\documentclass[captions=tableheading]{scrbook}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage[figuresright]{rotating}
\usepackage[format=hang,justification=justified,singlelinecheck=false]{caption}[2004/07/16]
\usepackage{blindtext}
\usepackage{pdflscape}
\newcommand{\commenttable}[1]{\vskip2ex\par{\itshape #1}}%\par\vskip 2mm
\usepackage[tracking]{microtype}
\usepackage{floatrow}
\DeclareCaptionFormat{leftmargin}{\captionsetup{textfont={small, md, up}, labelfont={small, sf, md, up}, labelsep=space, position = above, slc = off}\textls*[150]{\MakeUppercase{#1 #2}}#3}%
\captionsetup{format = leftmargin}
\begin{document}
\begin{landscape}
\centering
\begin{table}
\centering
\ttabbox[\FBwidth]{\caption{A table caption with a really fancy and ridiculously long description of what could and also should be said in just a few words\commenttable{Hello. \blindtext.}}}
{%
\begin{tabular}{SSSSSSSSSSSSS}
\toprule
{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}\\
\midrule
12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34&12.34&12.34 \\
12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34&12.34&12.34 \\
\bottomrule
\end{tabular}}%
\end{table}
\end{landscape}
\begin{landscape}
\centering
\begin{table}
\ttabbox{\caption{A table caption with a really fancy and ridiculously long description of what could and also should be said in just a few words\commenttable{Hello. \blindtext.}}}%
{%
\begin{tabular}{SSSSSSSSSS}
\toprule
{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}&{column}\\
\midrule
12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 \\
12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 &12.34 \\
\bottomrule
\end{tabular}}%
\end{table}
\end{landscape}
\end{document}
use
\captionsetup[table]{
labelsep = newline,
textfont = sc,
name = TABLE,
justification=justified,
singlelinecheck=false,%%%%%%% a single line is centered by default
labelsep=colon,%%%%%%
skip = \medskipamount}
Best Answer
You can use the floatrow package: choose something like
in the preamble, and use this syntax for a particular figure to have a side caption:
See § 1.1.1 and §§ 3.1.3 to 3.1.7 of the doc for further details about captions.