TeX - LaTeX Asked by Chris 28 on February 8, 2021
I want to rotate two tables including their captions and display them on the same page.
I tried using sideways tables but there each table is forced on a new page.
I currently use adjustbox with {angle=90}
I want the tables to be placed as follows but I want the captions to rotate too.
Thanks!
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{adjustbox}
begin{document}
begin{table}
begin{adjustbox}{angle=90}
centering
begin{tabular}{llll}
a & b & c & d
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
end{tabular}
end{adjustbox}
caption{Caption}
label{tab:table1}
begin{adjustbox}{angle=90}
centering
begin{tabular}{llll}
a & b & c & d
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
end{tabular}
end{adjustbox}
caption{Caption}
label{tab:table2}
end{table}
end{document}
Here's a code with the landscape
environment:
documentclass[12pt]{article}
usepackage{adjustbox}
usepackage{lscape}
begin{document}
begin{landscape}
begin{table}
centering
begin{tabular}{*{8}{l}}
a & b & c & d & e & f & g & h
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
end{tabular}
caption{Caption}
label{tab:table1}
vskip 1cm
begin{tabular}{*{5}{l}}
a & b & c & d & e
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
end{tabular}
caption{Caption}
label{tab:table2}
end{table}
end{landscape}
end{document}
Edit: A variant code, using the floatrow
package, for tables above each other, w.r.t. the normal page orientation:
begin{landscape}
begin{table}
centering
begin{floatrow}{2}
ttabbox{caption{Caption}label{tab:table1}}{begin{tabular}{*{8}{l}}
a & b & c & d & e & f & g & h
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
... & ... & ... & ... & ... & ... & ... & ...
end{tabular}}
ttabbox{caption{Caption}label{tab:table2}}{begin{tabular}{*{5}{l}}
a & b & c & d & e
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
... & ... & ... & ... & ...
end{tabular}}
end{floatrow}
end{table}
end{landscape}
Answered by Bernard on February 8, 2021
One can place 2 minipage
environments, each with a tabular
environment and caption
and label
directives, side by side inside a sidewaystable
environment.
documentclass{article}
usepackage[T1]{fontenc}
usepackage{rotating} % for 'sidewaystable' env.
begin{document}
begin{sidewaystable}
begin{minipage}{0.5textwidth}
centering
begin{tabular}{llll}
a & b & c & d
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
end{tabular}
caption{Caption}
label{tab:table1}
end{minipage}%
begin{minipage}{0.5textwidth}
centering
begin{tabular}{llll}
a & b & c & d
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
... & ... & ... & ...
end{tabular}
caption{Caption}
label{tab:table2}
end{minipage}
end{sidewaystable}
end{document}
Answered by Mico on February 8, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP