I want a caption of two lines, with the second line not centered but aligned to the left.
This is the result of the following code, \captionsetup{justification=raggedright}
doesn't seem to work. What am I doing wrong?
\documentclass[a4paper,twoside,12pt]{scrreprt}
\usepackage{fontspec}
\usepackage{caption}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\captionsetup{justification=raggedright}
\begin{tabular}{cc}
\toprule
A & B
\\ \midrule
11111111111111111 & 1111111111111111\\
22222222222222222 & 2222222222222222\\
33333333333333333 & 3333333333333333\\
44444444444444444 & 4444444444444444\\
55555555555555555 & 5555555555555555\\
66666666666666666 & 6666666666666666\\
\bottomrule
\end{tabular}
\caption{Caption caption caption caption\\
caption caption}
\end{table}
\end{document}
Best Answer
If you use a
threeparttable
environment, it computes the width of your table, and it works either with theplain
or thehang
formats:Note that it doesn't seem to work with the
ThreePartTable
environment (fromthreeparttablex
), so that you can't break your tables through pages.