0

I'm trying to include a table from an external data document which I have as a .csv file. I'm using

\begin{sidewaystable} 
    \begin{table} [H]
    \csvautotabular{nameofcsvfile.csv}
    \end{table}
\end{sidewaystable}

to try and get the table in my document but rotate by a 90° angle. I keep getting the error

LaTeX Error: Not in outer par mode.

and I do not know how to solve it.

1 Answer 1

2

In your code, you don't need the table environment. This should work just fine:

\documentclass{article}
\usepackage{rotating}
\usepackage{csvsimple}

\begin{document}

\begin{sidewaystable} 
    \csvautotabular{test-table.csv}
\end{sidewaystable}

\end{document}

Alternatively, to rotate a table, you can use the adjustbox environment from the adjustbox package:

\documentclass[a4paper,12pt]{article}
\usepackage{adjustbox}
\usepackage{csvsimple}

\begin{document}

\begin{adjustbox}{angle=0}
    \csvautotabular{test-table.csv}
\end{adjustbox}


\begin{adjustbox}{angle=90}
    \csvautotabular{test-table.csv}
\end{adjustbox}

\end{document}

here is the result:
enter image description here

1
  • Thank you very much. This has helped! Feb 16, 2022 at 11:47

You must log in to answer this question.

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