I'm experimenting with landscape tables.
I came accross this question, and I'm trying to modify it to get fancier tables.
I would like to use commands like \toprule, to draw horizontal lines.
Here's my take:
\documentclass{article}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage{lipsum}% dummy text
\begin{document}
\lipsum % Text before
\afterpage{%
\clearpage% Flush earlier floats (otherwise order might not be correct)
\thispagestyle{empty}% empty page style (?)
\begin{landscape}% Landscape page
\centering % Center table
\begin{tabular}{llll}
\toprule
A & B & C & D \\
\bottomrule
\end{tabular}
\captionof{table}{Table caption}% Add 'table' caption
\end{landscape}
\clearpage% Flush page
}
\lipsum % Text after
\end{document}
Which unfortunately does not compile.
I get the following error:
{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2]
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 25.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 25.
! Undefined control sequence.
\AP@ ...centering \begin {tabular}{llll} \toprule
A & B & C & D \\ \bottomru...
l.25 \end
{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<recently read> \bottomrule
l.25 \end
{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Any idea tosolve this? I also would like to use tabularx package in a similar fashion.
Best, Andrea

booktabspackage to the preamble, the code compiles just fine on my computer. – leandriis Mar 30 '20 at 19:32