2

I want to rotate a table of tabularray environment by rotating package in LaTeX. When I tested, I found that there is an error about tabularray. For example:

\documentclass{article}
\usepackage{tabularray}

\usepackage{rotating} % <-- HERE

\begin{document} \begin{turn}{180} blabla dummy text \begin{table} \begin{talltblr}[ caption={1}, label={tab:1} ]{ colsep=0.3pt } Hello \end{talltblr} \end{table} \end{turn} \end{document}

And the error is: enter image description here

Is there a way to combine rotation with tabularray?

L.J.R.
  • 10,932
Y. zeng
  • 1,885

1 Answers1

5

Just remove the table environment.

%! TEX program = lualatex
\documentclass{article}
\usepackage{tabularray}

\usepackage{rotating} % <-- HERE

\begin{document} \begin{turn}{180} blabla dummy text \begin{talltblr}[ caption={1}, label={tab:1} ]{ colsep=0.3pt } Hello \end{talltblr} \end{turn} \end{document}

Explanation: looking up what the error message means you can easily come across ! LaTeX Error: Not in outer par mode ...

then it's written in e.g. LaTeX unofficial reference manual that table is a floating environment. So you can't use table inside turn.

Alternatively, you can turn the table itself while keeping it floating by putting the turn environment inside the table environment.

%! TEX program = lualatex
\documentclass{article}
\usepackage{tabularray}

\usepackage{rotating} % <-- HERE

\begin{document} blabla dummy text

\begin{table} \begin{turn}{180} \begin{talltblr}[ caption={1}, label={tab:1} ]{ colsep=0.3pt } Hello Hello Hello Hello \end{talltblr} \end{turn} \end{table} \end{document}

alternative 1 output

Another alternative is to put both the text and the table inside the floating environment.

alternative 2 output

user202729
  • 7,143