tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

width of note-tag

Open Zarko1234 opened this issue 4 years ago • 3 comments

Is it possible to define default width of note-tag so that it will adopt itself to the width of (longer) note tag. For example to width of ***. So far, in similar case tag overlap note text. For example:

\documentclass[border=3.141592]{standalone}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{talltblr}[
caption = {Caption title},
  label = {tab:???},
note{***} = {some explanation},
                    ]{hlines,vlines,
                      colspec = {l S[table-format=1.9{***}]},
                     % measure = vbox
                     }
assets  & 0.123456789\TblrNote{***}   \\
    \end{talltblr}
\end{document}

gives:

image

Zarko1234 avatar Jan 04 '22 14:01 Zarko1234

I may fix the overlap in the future. But here is a better solution with enumitem package:

\documentclass[border=3.141592]{standalone}

\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\usepackage{enumitem}

\DefTblrTemplate{note}{default}{%
  \setlength{\linewidth}{\tablewidth}%
  \begin{enumerate}[nosep]
    \MapTblrNotes {
      \item[\UseTblrTemplate{note-tag}{default}]
        \UseTblrTemplate{note-target}{default}
        \UseTblrTemplate{note-text}{default}
    }
  \end{enumerate}
}

\begin{document}

\begin{talltblr}[
  caption = {Caption title},
  label = {tab:???},
  note{*} = {First explanation.},
  note{**} = {Second explanation.},
  note{***} = {Third explanation.},
]{
  hlines,vlines,
  colspec = {l S[table-format=1.9{***}]},
}
  assets  & 0.123456789\TblrNote{*} \\
  assets  & 0.123456789\TblrNote{**} \\
  assets  & 0.123456789\TblrNote{***} \\
\end{talltblr}

\end{document}

image

lvjr avatar Jan 05 '22 11:01 lvjr

Thank you very much for response and solution! Actually, I looking for this solution (too) :-)

Now I have another big wish: please add description of this possibilities to documentation of the next realize of this nice and versatile package!

Zarko1234 avatar Jan 05 '22 13:01 Zarko1234

After this commit https://github.com/lvjr/tabularray/commit/d3cf829120c8eeaae2923687812560df5342b804, you don't need to write

\setlength{\linewidth}{\tablewidth}

in the above example.

lvjr avatar Jan 19 '22 04:01 lvjr