1

I'm using the caption package which works for normal table captions.

\RequirePackage[font=small, labelfont=bf, labelsep=period]{caption}

It makes the caption look like this: Table 3.1: xyz

Unfortunately, it doesn't work for longtblr from tabularray package. I need to set the caption-tag to bold as well and I don't know how to achieve that.

My longtblr definition:

    \begin{longtblr}[ caption = {Zoological gardens websites comparison results},
      label = {tab:websites},]{
      cells={valign=m,halign=c},
      row{1}={font=\bfseries,rowsep=8pt},
      colspec={QXXX},
      hlines,
      vlines,
    }
\SetCell{} \url{https://zoo.poznan.pl/} & Apache, Reveal.js, jQuery, Platform JS, Google Plus/Twitter widgets & Clean navigation bar, integrated ticketing system & Chaotic content presentation, overwhelming design \\ 
    \end{longtblr}

Regular table's caption look like:

Regular table

While longtblr caption look this way:

Longtblr caption

I would like them to look the same.

3
  • Please add a compilable minimal working example to your question. Commented Dec 19, 2022 at 16:17
  • I've added some details. I hope it's enough. PS I love TikZducks so much!!! I've found it yesterday and I'm madly in love with it. Commented Dec 19, 2022 at 16:32
  • Oh, so nice to hear that you like them! Commented Dec 19, 2022 at 16:38

2 Answers 2

4

You can change the caption tag font like this:

\documentclass{article}

\RequirePackage[font=small, labelfont=bf, labelsep=period]{caption}
\usepackage{tabularray}

\begin{document}

\begin{table}[htbp]
\caption{normal table}
\end{table}

\NewTblrTheme{fancy}{
  \SetTblrStyle{caption-tag}{font=\bfseries\small}
}

\begin{longtblr}[  theme=fancy, caption = {Zoological gardens websites comparison results},
  label = {tab:websites},]{
  cells={valign=m,halign=c},
  row{1}={font=\bfseries,rowsep=8pt},
  colspec={QXXX},
  hlines,
  vlines,
}
test & test & test & test\\
\end{longtblr}

\end{document}

enter image description here

2
  • Thanks, this is exactly what I needed. You are awesome!!! 🦆🐥 Commented Dec 19, 2022 at 16:45
  • @kwi You're welcome! Commented Dec 19, 2022 at 16:46
1

Another way to use caption captions in longtblr and talltblr environments is with the small package tblr-extras (available in TexLive and MiKTeX since Feb 2024)

\documentclass{article}

\RequirePackage[font=small, labelfont=bf, labelsep=period]{caption}
\usepackage{tabularray}
\usepackage{tblr-extras}
\UseTblrLibrary{caption}

\begin{document}

\begin{table}[htbp]
\caption{normal table}
\end{table}

\begin{longtblr}[caption = {Zoological gardens websites comparison results},
  label = {tab:websites},]{
  cells={valign=m,halign=c},
  row{1}={font=\bfseries,rowsep=8pt},
  colspec={QXXX},
  hlines,
  vlines,
}
test & test & test & test\\
\end{longtblr}

\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.