I'm trying to follow an example from the kaobook documentation (4.3):
The caption of a longtable is always positioned below the table, and it has the same width as the text (it doesn’t extend into the margin). However, sometimes you may need a longtable that is so wide that it trespass into the margins; in those cases, you may want to also increase the width of the caption. To do so, you’ll have to write two additional commands, one before and one after the longtable.
The example is given as:
\floatsetup[longtable]{margins=centering,LTcapwidth=table} % Add this line before the longtable to increase the caption width
\begin{longtable}{lp{8cm}p{5cm}p{2cm}}
...
\end{longtable}
\floatsetup[longtable]{margins=raggedright,LTcapwidth=\textwidth}
% Add this line after the longtable to revert the previous change
I tried to replicate this example. However, it doesn't seem to work:
\floatsetup[longtable]{margins=centering,LTcapwidth=table}
\begin{longtable}{lp{8cm}p{5cm}p{2cm}}
\hline
One & Two & Three \\
Left & Center & Center \\
\hline
\caption{\textbf{longtable}---\blindtext}
\end{longtable}
\floatsetup[longtable]{margins=raggedright,LTcapwidth=\textwidth}
I was expecting the caption to align with the table to the left and have full width.
The same applies to xltabular:
\floatsetup[xltabular]{margins=centering,LTcapwidth=table}
\begin{xltabular}{17cm}{lp{8cm}p{5cm}p{2cm}}
\hline
One & Two & Three \\
Left & Center & Center \\
\hline
\caption{\textbf{xltabular}---\blindtext}
\end{xltabular}
\floatsetup[xltabular]{margins=raggedright,LTcapwidth=\textwidth}
How can I achieve a full-width caption from an xltabular in kaobook?
\documentclass
to\end{document}
, that illustrates the problem and would enable people to help? As the comments show, the issue is not related to the code snippets that you show, so there is now way people on this site can contribute.