0

I want to change the line spacing or baselinestretch in captions generated using tabularray talltblr and longtblr environment, to mimic the "stretch" option of the caption package.

However using \onehalfspacing doesn't work neither if I use in the TblrTemplate or in the caption-text and caption-tag options

MWE:

\documentclass{article}
\usepackage[spanish,mexico]{babel}
\usepackage{tabularray}
\usepackage{caption}
\usepackage{graphicx} % Required for inserting images

\captionsetup[table]{% format=plain, labelsep = newline, singlelinecheck = false, labelfont = bf, textfont = it, font = {small,doublespacing}, position = above, }%

\DefTblrTemplate{conthead-text}{default}{(Continuación)} \DefTblrTemplate{contfoot-text}{default}{Continúa en la siguiente página} \DefTblrTemplate{caption-tag}{default}{\bfseries\small Tabla\hspace{0.25em}\thetable} \DefTblrTemplate{caption-sep}{default}{.} \DefTblrTemplate{caption-text}{default}{\itshape\small \InsertTblrText{caption}}

\DefTblrTemplate{caption}{default}{ \doublespacing \UseTblrTemplate{caption-tag}{default}% \UseTblrTemplate{caption-sep}{default}\par% \UseTblrTemplate{caption-text}{default}% }

\DefTblrTemplate{capcont}{default}{% \doublespacing \UseTblrTemplate{caption-tag}{default}% \UseTblrTemplate{caption-sep}{default}\par% \UseTblrTemplate{caption-text}{default} \UseTblrTemplate{conthead-text}{default}% }

\begin{document}

\section{Introduction}

\begin{table}[htbp] \centering \captionsetup{width=5cm} \caption{Example of a table with caption using tabular and caption package} \begin{tabular}{|c|c|c|c|} \hline a & b & filler text & filler text\ \hline a & b & filler text & filler text\ \hline a & b & filler text & filler text\ \hline a & b & filler text & filler text\ \hline \end{tabular} \label{tab:my_label} \end{table}

\begin{table}[htbp] \centering \begin{tblr}[tall, caption={Example of a table with caption using tabularray package}]{colspec={cccc},hlines,vlines} a & b & filler text & filler text\ a & b & filler text & filler text\ a & b & filler text & filler text\ a & b & filler text & filler text\ \end{tblr} \end{table}

\end{document}

Results

Mane32
  • 1,252
  • Please show us your result in your question ... – Mensch Jun 28 '23 at 20:00
  • @Mensch done. I want to reproduce caption results with tabularray. – Mane32 Jun 28 '23 at 21:46
  • 1
    See if https://tex.stackexchange.com/questions/628900/how-to-auto-copy-the-formatting-from-usepackagecaption-to-the-caption-of-tabu/628973#628973 can help you. – Zarko Jun 29 '23 at 05:19

0 Answers0