The longtblr caption title does not change from "Table" to "Supplementary Table", as the table caption title does. Indeed, in the longtblr caption title, I would like to add the word "Supplementary" just before the word "Table". How can I do it?
Here following you can find a MWE, with the corresponding result, and the document class I used (that contains the command to add the word "Supplementary", i.e. \renewcommand{\fnum@table}{Supplementary \tablename~\thetable}):
MWE
\documentclass[twocolumn,fleqn,10pt,dvipsnames,table]{wlscirep_modified}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multirow, booktabs, tabularx, longtable}
\usepackage{multirow, makecell}
\usepackage{xurl}
\usepackage{booktabs}
\usepackage{xfp}
\usepackage{color}
\title{Supplementary Information for...}
\author[1]{Luke}
\affil[1]{University of }
% Add longtable and xcolor packages and define a color
\definecolor{white}{HTML}{FFFFFF}
\usepackage{multirow, makecell}
\usepackage{tikz}
\usepackage{tabularray}
\usepackage{textcomp,gensymb}
\RequirePackage[labelfont=bf, labelsep=period]{caption}
\begin{document}
\maketitle
\section{Supplementary Text}
\subsection{Notes about ...}
This is about...
\begin{table}[ht]
\centering
\begin{tabular}{|l|l|l|}
\hline
Condition & n & p \
\hline
A & 5 & 0.1 \
\hline
B & 10 & 0.01 \
\hline
\end{tabular}
\caption{\label{tab:example}Legend (350 words max). Example legend text.}
\end{table}
\rowcolors{1}{white}{white}
\NewTblrTheme{fancy}{
\SetTblrStyle{caption-tag}{font=\bfseries}
}
\begin{longtblr}[ theme=fancy, caption = {This is a summary of...},]
{
colspec={m{0.9cm} m{0.1cm} m{0.6cm} m{1cm} m{3cm} m{7.3cm} m{1.5cm}},
column{6}={preto={\minipage{\linewidth}}, appto={\endminipage}},
row{1}={font=\bfseries},
row{2,5,7-8,11-13,20-26,30,33-34,36,39-40,42}={bg=white},
hline{1,Z}=0.8pt, hline{2}=0.4pt,
hline{4,8,10,12-13,15-19,21-26,28-29,32,34,38,40}=dotted,
hline{3,5-7,9,11,14,20,27,30-31,33,35,36-37,39,41,42-43}=solid,
rowhead=1
}
Day
&
& Month
& Hours
& Event
& Description
& Further Info
\\
%-------------------------------------------------
Friday
& $6$
& February
& 08 $-$ 19
& Musical festival
&
Something here ...
& Multiple
\\
%-------------------------------------------------
\SetCell[r=2]{l} Saturday
& \SetCell[r=2]{l} 8
& \SetCell[r=2]{l} February
& 08
& Birthday
& On Saturdays...
& Multiple
\\
&
&
& 9
& Local Cup \newline
& Soemthing here...
& Single
\\
% -------------------------------------------------
\end{longtblr}
\end{document}
Result
Document Class
This is my document class, i.e. wlscirep_modified, which is a modification of \documentclass{wlscirep} (that you can find in "Template for submissions to Scientific Reports"):
%
% An unofficial LaTeX class for Scientific Report articles.
%
% Copyright Overleaf (WriteLaTeX) 2016.
%
% Based on the SelfArx document class.
%
\NeedsTeXFormat{LaTeX2e}
% \ProvidesClass{wlscirep}[18/03/2016, v1.1]
% \ProvidesClass{wlscirep}[03/11/2016, v1.2]
% \ProvidesClass{wlscirep}[27/02/2017, v1.3]
\ProvidesClass{wlscirep}[08/08/2020, v1.4]
\RequirePackage[utf8]{inputenc}
\RequirePackage[english]{babel}
\RequirePackage{ifthen}
\RequirePackage{calc}
\AtEndOfClass{\RequirePackage{microtype}}
\DeclareOption{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass{article}
\RequirePackage{amsmath,amsfonts,amssymb}
\RequirePackage{mathptmx} % Loads the Times-Roman Math Fonts
\RequirePackage{helvet}
\RequirePackage{courier}
\RequirePackage{ifpdf}
\RequirePackage{graphicx,xcolor}
\RequirePackage{booktabs}
% Settings for the author block
\RequirePackage{authblk}
\setlength{\affilsep}{1.5em}
\renewcommand\Authfont{\fontsize{12}{12}\usefont{OT1}{phv}{b}{n}}
\renewcommand\Affilfont{\fontsize{10}{12}\usefont{OT1}{phv}{m}{n}}
\RequirePackage[left=2cm,%
right=2cm,%
top=2.25cm,%
bottom=2.25cm,%
headheight=12pt,%
letterpaper]{geometry}%
\RequirePackage[labelfont={bf,sf},%
labelsep=period,%
justification=raggedright]{caption}
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
% Set up of the bibliography style
% \RequirePackage[numbers]{natbib}
\RequirePackage[superscript,biblabel,nomove]{cite}
%% Nov 3, 2016: Support DOI
\bibliographystyle{naturemag-doi}
%
% headers and footers
%
\RequirePackage{fancyhdr} % custom headers/footers
\RequirePackage{lastpage} % Number of pages in the document
\pagestyle{fancy} % Enables the custom headers/footers
% Headers
\lhead{}%
\chead{}%
\rhead{}%
% Footers
\lfoot{}%
\cfoot{}%
\rfoot{\small\sffamily\bfseries\thepage/\pageref{LastPage}}%
\renewcommand{\headrulewidth}{0pt}% % No header rule
\renewcommand{\footrulewidth}{0pt}% % No footer rule
%
% section/subsection/paragraph set-up
%
\RequirePackage[explicit]{titlesec}
\titleformat{\section}
{\color{color1}\large\sffamily\bfseries}
{\thesection}
{0.5em}
{#1}
[]
\titleformat{name=\section,numberless}
{\color{color1}\large\sffamily\bfseries}
{}
{0em}
{#1}
[]
\titleformat{\subsection}
{\sffamily\bfseries}
{\thesubsection}
{0.5em}
{#1}
[]
\titleformat{\subsubsection}
{\sffamily\small\bfseries\itshape}
{\thesubsubsection}
{0.5em}
{#1}
[]
\titleformat{\paragraph}[runin]
{\sffamily\small\bfseries}
{}
{0em}
{#1}
\titlespacing{\section}{0pc}{3ex @plus4pt @minus3pt}{5pt}
\titlespacing{\subsection}{0pc}{2.5ex @plus3pt @minus2pt}{0pt}
\titlespacing{\subsubsection}{0pc}{2ex @plus2.5pt @minus1.5pt}{0pt}
\titlespacing{\paragraph}{0pc}{1.5ex @plus2pt @minus1pt}{10pt}
%
% tableofcontents set-up
%
\usepackage{titletoc}
\contentsmargin{0cm}
\titlecontents{section}[\tocsep]
{\addvspace{4pt}\small\bfseries\sffamily}
{\contentslabel[\thecontentslabel]{\tocsep}}
{}
{\hfill\thecontentspage}
[]
\titlecontents{subsection}[\tocsep]
{\addvspace{2pt}\small\sffamily}
{\contentslabel[\thecontentslabel]{\tocsep}}
{}
{\ \titlerule[.5pc]{.}\ \thecontentspage}
[]
\titlecontents{subsubsection}[\tocsep]
{\footnotesize\sffamily}
{}
{}
{}
[\ \textbullet\ ]
\RequirePackage{enumitem}
%\setlist{nolistsep} % Uncomment to remove spacing between items in lists (enumerate, itemize)
% Remove brackets from numbering in List of References
\renewcommand{@biblabel}[1]{\bfseries\color{color1}#1.}
%
% article meta data
%
\newcommand{\keywords}[1]{\def@keywords{#1}}
% MODIFICATION 1 - comment all the abstract
% \def\xabstract{abstract}
% \long\def\abstract#1\end#2{\def\two{#2}\ifx\two\xabstract
% \long\gdef\theabstract{\ignorespaces#1}
% \def\go{\end{abstract}}\else
% \typeout{^^J^^J PLEASE DO NOT USE ANY \string\begin\space \string\end^^J
% COMMANDS WITHIN ABSTRACT^^J^^J}#1\end{#2}
% \gdef\theabstract{\vskip12pt BADLY FORMED ABSTRACT: PLEASE DO
% NOT USE {\tt\string\begin...\string\end} COMMANDS WITHIN
% THE ABSTRACT\vskip12pt}\let\go\relax\fi
% \go}
%
% custom title page
%
\renewcommand{@maketitle}{%
{%
\thispagestyle{empty}%
\vskip-36pt%
{\raggedright\sffamily\bfseries\fontsize{20}{25}\selectfont @title\par}%
\vskip10pt
{\raggedright\sffamily\fontsize{12}{16}\selectfont @author\par}
\vskip18pt%
{%
\noindent
{\parbox{\dimexpr\linewidth-2\fboxsep\relax}{\color{color1}\large\sffamily\textbf{ABSTRACT}}}
}%
\vskip10pt
{%
\noindent
\colorbox{color2}{%
\parbox{\dimexpr\linewidth-2\fboxsep\relax}{%
% \sffamily\small\textbf\\theabstract
}%
}%
% \vskip18pt%
% \noindent
% \parbox{\dimexpr\linewidth-2\fboxsep\relax}{%
% {\color{color1}\keywordname\hspace*{1em}} @keywords%
%}%
}%
\vskip25pt%
}%
}%
%-----------------------------------------------
\setlength{\columnsep}{0.55cm} % Distance between the two columns of text
\setlength{\fboxrule}{0.75pt} % Width of the border around the abstract
\definecolor{color1}{RGB}{0,0,0} % Color of section headings
\definecolor{color2}{gray}{1} % Color of the box behind the abstract
\newcommand{\keywordname}{Keywords:} % Defines the keywords heading name
\newlength{\tocsep}
\setlength\tocsep{1.5pc} % Sets the indentation of the sections in the table of contents
\setcounter{tocdepth}{3} % Show only three levels in the table of contents section: sections, subsections and subsubsections
\usepackage{lipsum} % Required to insert dummy text
%-----------------------------------------------
\let\oldbibliography\thebibliography
\renewcommand{\thebibliography}[1]{%
\addcontentsline{toc}{section}{\hspace*{-\tocsep}\refname}%
\oldbibliography{#1}%
\setlength\itemsep{0pt}%
}
%% Automatically abbreviate journal names
\RequirePackage{jabbrv}
% MODIFICATION 2 - Add the word "Supplementary"
% https://tex.stackexchange.com/questions/44115/how-can-i-change-figure-caption-label
\makeatletter
\renewcommand{\fnum@figure}{Supplementary \figurename~\thefigure}
\renewcommand{\fnum@table}{Supplementary \tablename~\thetable}
\makeatother
Compared to the original document class there are only two modifications, i.e.:
% MODIFICATION 1 - comment all the abstract
% \def\xabstract{abstract}
% \long\def\abstract#1\end#2{\def\two{#2}\ifx\two\xabstract
% \long\gdef\theabstract{\ignorespaces#1}
% \def\go{\end{abstract}}\else
% \typeout{^^J^^J PLEASE DO NOT USE ANY \string\begin\space \string\end^^J
% COMMANDS WITHIN ABSTRACT^^J^^J}#1\end{#2}
% \gdef\theabstract{\vskip12pt BADLY FORMED ABSTRACT: PLEASE DO
% NOT USE {\tt\string\begin...\string\end} COMMANDS WITHIN
% THE ABSTRACT\vskip12pt}\let\go\relax\fi
% \go}
and
% MODIFICATION 2 - Add the word "Supplementary"
% https://tex.stackexchange.com/questions/44115/how-can-i-change-figure-caption-label
\makeatletter
\renewcommand{\fnum@figure}{Supplementary \figurename~\thefigure}
\renewcommand{\fnum@table}{Supplementary \tablename~\thetable}
\makeatother
EDITED after the @Celdor's answer
Thanks a lot @Celdor! Just a doubt.. Is it normal that the Supplementary Table 2 caption title, related to \begin{longtblr}[theme = supplementary, ... is smaller than the Supplementary Table 1 caption title, related to
\begin{table}[ht]
\centering
\begin{tabular}{|l|l|l|}
\hline
Condition & n & p \\
\hline
A & 5 & 0.1 \\
\hline
B & 10 & 0.01 \\
\hline
\end{tabular}
\caption{\label{tab:example}Legend (350 words max). Example legend text.}
\end{table}
as shown in the following picture?



\DefTblrTemplate{caption}{supplementary}{...}is nearly a regular paragraph. As such, it accepts almost any formatting macro. For instance, in order to achieve right alignment, change\centeringto\raggedright.ragged2epackage defines a much improved version\RaggedRightwhich also adds hyphenations. You could also try to change\centeringto\raggedright\hangindent1.25cm\hangafter1and have a hang-out caption by 1.25cm. For more sophisticated formatting, you would need to apply boxes. – Celdor Nov 13 '23 at 14:34longtblr), which is smaller than the size of *Supplementary Table 1* caption title (related to the classicaltable).. :-) – Ommo Nov 13 '23 at 15:02\captionsetup[...]{..., font=<size>}where<size>keyword must benormalsizeorsmalletc. (see documentation for more key words). Fortabularrayuse a regular paragraph macro :\normalsizeor\smalletc. – Celdor Nov 13 '23 at 15:38