3

I use the tabularray package to create the table. But I see that the vertical space between the table and the text above and below the table is small. I used headsep but it didn't work. How can I increase that distance. I don't want to use vspace more than once, because in my document there are many similar tables.

MWE

\documentclass[12pt,a4paper]{article}
\usepackage{tabularray-2021,lipsum}
\begin{document}
    \lipsum[2]
    
    \begin{tblr}{colspec={XXX},hlines,vlines}
        a & b & c\\
        c & d & e
    \end{tblr}

    \lipsum[2]
\end{document}

enter image description here

3 Answers 3

4

You can use the option \SetTblrOuter, using e.g. \SetTblrOuter{long}.

\documentclass[12pt,a4paper]{article}
\usepackage{tabularray-2021,lipsum}
\SetTblrOuter{long}

\begin{document}
    \lipsum[2]
    
    \begin{tblr}{colspec={XXX},hlines,vlines}
        a & b & c\\
        c & d & e
    \end{tblr}

    \lipsum[2]
\end{document}

enter image description here

3
  • 1
    +1, this is the correct answer. No need hacking with \bigskip.
    – CarLaTeX
    Feb 10, 2023 at 16:22
  • This is not a fairly correct answer because this basically converts any table into using tabularray long table template.
    – Andre
    Apr 3 at 19:18
  • Isn't that what the OP asked for? "I don't want to use vspace more than once, because in my document there are many similar tables." Apr 4 at 20:31
4

Hope this is helpful to you, and the MWE is:

\documentclass[12pt,a4paper]{article}
\usepackage{tabularray-2021,lipsum}

\begin{document}
\AtBeginEnvironment{tblr}{\bigskip}
\AtEndEnvironment{tblr}{\bigskip}
    \lipsum[2]
    
    \begin{tblr}{colspec={XXX},hlines,vlines}
        a & b & c\\
        c & d & e
    \end{tblr}

    \lipsum[2]
\end{document}

enter image description here

4
  • 1
    This is what I needed, thanks for helping me. Feb 10, 2023 at 15:10
  • @NguyễnCảnhDũng Thanks for your kind words, if my answers suits with you, then please accept this answer by click the tick mark.
    – MadyYuvi
    Feb 10, 2023 at 15:31
  • I see a "tick" with no link. Feb 12, 2023 at 14:33
  • Just click it and see
    – MadyYuvi
    Feb 12, 2023 at 14:45
2

You can use \bigskip to increase the distance.

\documentclass[12pt,a4paper]{article}
\usepackage{tabularray-2021,lipsum}
\begin{document}
    \lipsum[2]
    
    \bigskip
    \begin{tblr}{colspec={XXX},hlines,vlines}
        a & b & c\\
        c & d & e
    \end{tblr}
    
   \bigskip
    \lipsum[2]
\end{document} 

enter image description here

1
  • 1
    Initially, I too thought to apply \bigskip, but later, I've changed my mind, ha ha ha. :-D
    – MadyYuvi
    Feb 10, 2023 at 13:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .