3

I want to use tabularray tables in lyx by redefining tabular environment. For this aim, I need to use \tabularnewline instead of \\ by \providecommand{\tabularnewline}{\\}. But, if I do this, the table is corrupted as in the figure. What is the reason for this, and how to tackle it?

enter image description here

\documentclass{article} \usepackage{lmodern} \usepackage{xcolor} \usepackage{tabularray} \providecommand{\tabularnewline}{\\} \begin{document} \Large{WRONG}: \begin{tblr}{|c|c|c|} \hline \SetRow{lime!20} Item 1 & Item 2 & Item 3 \tabularnewline \hline text & text & text\tabularnewline \hline \end{tblr} \vspace{1cm} \Large{RIGHT}: \begin{tblr}{|c|c|c|} \hline \SetRow{lime!20} Item 1 & Item 2 & Item 3 \\ \hline text & text & text\\ \hline \end{tblr} \end{document} 
1
  • You might be interested in a module i wrote to use tabularray in lyx. You can get it here: github.com/Udi-Fogiel/LyX-Tabularray Commented Aug 3, 2022 at 21:50

1 Answer 1

4

tabularray must see a real \\ because it uses that to split the array in rows. So you must tell it to expand \tabularnewline first with [expand=\tabularnewline].

\documentclass{article} \usepackage{lmodern} \usepackage{xcolor} \usepackage{tabularray} \providecommand{\tabularnewline}{\\} \begin{document} \Large{RIGHT}: \begin{tblr}[expand=\tabularnewline]{|c|c|c|} \hline \SetRow{lime!20} Item 1 & Item 2 & Item 3 \tabularnewline \hline text & text & text\tabularnewline \hline \end{tblr} \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.