# A problem with table in landscape mode

I have a wide table that i wish to place in landscape mode to make it readable. Additionally, i use tabulary to autofit column width.

\begin{landscape}
\begin{table}[p]
\caption{Candidate DACs\label{tab:dac}}
\begin{tabulary}{\textwidth}{|L|L|L|L|L|L|L|L|L|}
\hline
\textbf{Manufacturer} & \textbf{Model} & \textbf{Resolution} & \textbf{Accuracy (typ./max.),} LSB & \textbf{Samples availible?}
& \textbf{Price on Mouser}& \textbf{Broadband noise}, $\unit{nV}/\sqrt{\mathrm{Hz}}$ & \textbf{Pro} & \textbf{Contra} \\
\hline
&  &  &  &  &  &  & ngmfkjig ojojo &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
\end{tabulary}

\end{table}

\end{landscape}


However, the width of the table stays as if the page was in portait mode. I tried to use \textheight as parameter to no avail. I use LuaLatex. Please help me!

• Perhaps try replacing \textwidth with \textheight – Bernard Jul 18 '17 at 12:06
• @Bernard this doesn't help, as I mentioned in the post – Andrey Pro Jul 18 '17 at 12:11
• Could you post a full compilable code? – Bernard Jul 18 '17 at 12:13
• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Reinstate Monica - M. Schröder Jul 19 '17 at 5:34

Instead of \textwidth use \linewidth:

\documentclass{article}
\usepackage{pdflscape}
\usepackage{tabulary}

\begin{document}
\begin{landscape}
\begin{table}[p]
\caption{Candidate DACs\label{tab:dac}}
\begin{tabulary}{\linewidth}% <---- changed
{|L|L|L|L|L|L|L|L|L|}
\hline
\textbf{Manufacturer} & \textbf{Model} & \textbf{Resolution} & \textbf{Accuracy (typ./max.),} LSB & \textbf{Samples availible?}
& \textbf{Price on Mouser}& \textbf{Broadband noise}, $\mathrm{nV}/\sqrt{\mathrm{Hz}}$ & \textbf{Pro} & \textbf{Contra} \\
\hline
&  &  &  &  &  &  & ngmfkjig ojojo &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
\end{tabulary}
\end{table}

\end{landscape}
\end{document}


Instead of nesting a table environment inside a landscape environment, and having to fiddle with the parameters, I suggest you load the rotating package and use its sidewaystable environment.

% !TeX program = lualatex
\documentclass{article}
\usepackage{booktabs,siunitx,tabulary,rotating}
\usepackage[skip=0.333\baselineskip]{caption}

\begin{document}
\begin{sidewaystable}
\setlength\extrarowheight{2pt} % for a more "open" look
\caption{Candidate DACs\label{tab:dac}}

\begin{tabulary}{\textwidth}{|L|l|L|L|L|L|L|L|L|}
\hline
\textbf{Manufacturer} & \textbf{Model} & \textbf{Resolution} & \textbf{Accuracy (typ.\slash max.)}, LSB & \textbf{Samples availible?}
& \textbf{Price on Mouser}& \textbf{Broadband noise},
\si{\nano\volt}/$\sqrt{\si{\hertz}}$
& \textbf{Pro} & \textbf{Contra} \\
\hline
&  &  &  &  &  &  & ngmfkjig ojojo &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
&  &  &  &  &  &  &  &  \\
\hline
\end{tabulary}

\end{sidewaystable}
\end{document}

• I know that this possible, I chose the landscape approach because the page will be properly dsiplayed in pdf then .see tex.stackexchange.com/questions/25369/… – Andrey Pro Jul 19 '17 at 14:54
• @AndreyPro - I truly do not understand the relevance of that quote you've located, either for the original posting or for your new posting. (Aside: I find that quote to be both obnoxious and ill-informed.) Whether one uses the composite landscape/table approach or the one-step sidewaystable approach, the output is a table that's turned 90 degrees in both cases. The main difference between the two approaches, then, is not in their output but in the complexity of the inputs. – Mico Jul 19 '17 at 15:33
• the difference is how it displayed on screen whe you view the pdf: sidewaystable rotates the table making the content vertical, and inconvenient to view. landscape mode rotates the page itself, so the content is displayed horizontally – Andrey Pro Jul 19 '17 at 16:42
• @AndreyPro - The way a pdf viewer shows pages onscreen depends both on the particular pdf viewer (and its default settings) and on whether the defaults were modified. It's straightforward to program Adobe Acrobat to display landscape-oriented pages onscreen in, you guessed, landscape orientation. – Mico Jul 19 '17 at 16:54