0

I usually use a tblr oder tabularx within the table environment, but I have some long tables with (at least for me) not so easy formatting, which I place in a longtblr. If I place the longtblr within a table environment the page break is not working and the table is placed on a spot that doesn´t fit the content.

If I keep it the way I have it now, I need to adjust the formatting of my caption within tabularray (longtblr).

For table enviornment I use:

\usepackage[tableposition=top, font=small, labelfont=bf, belowskip=6pt, aboveskip=6pt]{caption} 
\setlength{\abovecaptionskip}{6pt plus 3pt minus 2pt}
\setlength{\belowcaptionskip}{6pt plus 3pt minus 2pt}

For the tabularray I have so far:

\usepackage{tabularray}
\NewDocumentCommand \TblrAlignCenter { } { \centering }
\SetTblrStyle{caption-tag}{\bfseries}

The size and skip are still not the same and I don´t find how I can adjust it. Additionally, a multiline caption is not centered but aligned left. Would be great to get some insights.

For the size the following works (although I don´t know what each line does):

\ExplSyntaxOn
\prg_generate_conditional_variant:Nnn \tl_if_empty:n { e } { TF }
\let \IfTokenListEmpty = \tl_if_empty:eTF
\ExplSyntaxOff
\DefTblrTemplate{firsthead}{default}{%
  \addtocounter{table}{-1}%
  \IfTokenListEmpty{\InsertTblrText{entry}}{%
    \captionof{table}{\InsertTblrText{caption}}%
  }{%
    \captionof{table}[\InsertTblrText{entry}]{\InsertTblrText{caption}}%
  }%
}
\DefTblrTemplate{middlehead,lasthead}{default}{%
  \addtocounter{table}{-1}%
  \captionof{table}[]{\InsertTblrText{caption}(Continued)}%
}
\SetTblrTemplate{caption-lot}{empty}

Thx in advance!

Sam R
  • 45
  • 2
    For longtblr of tabularray see https://tex.stackexchange.com/questions/628900/ – Zarko Nov 29 '22 at 03:31
  • @Zarko Thx for the Link. I added the Code to my Text and the caption is now the same size (sadly I don´t understand what each line does). The Space between caption and Table as well as Text still differs, and it would be great to get some help on that. Additionally, I saw that a multiline caption is not centered but aligned left. – Sam R Nov 29 '22 at 09:06
  • Than please provide MWE (Minimal Working Example), a small but complete document with your table which reproduce your problem, For text in it you can use ˙lipsum` package (or something similar) and table should at least mimic your real table. – Zarko Nov 29 '22 at 10:25
  • I found the command I needed (must define presep, headsep, postsep, and footsep for the longtblr otherwise the default value leads to a bigger seperation) The Space for the Figures still differs but I´m gonna use \vspace to correct it manually

    @Zarko Thanks for the help!

    – Sam R Nov 30 '22 at 10:50

0 Answers0