Is it possible to have longtable and tabulary together in a table for autofit and Auto continuation of table in next page
Below is my code
\documentclass{article}
\usepackage{longtable,tabulary,capt-of,dcolumn}
\usepackage{booktabs}
\usepackage{showframe}
\makeatletter
\def\ltabulary{%
\def\endfirsthead{\\}%
\def\endhead{\\}%
\def\endfoot{\\}%
\def\endlastfoot{\\}%
\def\tabulary{%
\def\TY@final{%
\def\endfirsthead{\LT@end@hd@ft\LT@firsthead}%
\def\endhead{\LT@end@hd@ft\LT@head}%
\def\endfoot{\LT@end@hd@ft\LT@foot}%
\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot}%
\longtable}%
\let\endTY@final\endlongtable
\TY@tabular}%
\dimen@\columnwidth
\advance\dimen@-\LTleft
\advance\dimen@-\LTright
\tabulary\dimen@}
\def\endltabulary{\endtabulary}
\makeatother
\begin{document}
\begin{table}
\captionof{table}{Sample Table 1 }\label{table_specrot}
\begin{ltabulary}{LLD..{1.3}}
x&y&1.1\\
x&y&1.244\\
x&y&1.3\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&y&1.2\\
x&yaaaa&1.2\\
\end{ltabulary}
\end{table}
\end{document}
\captionof{table}{Sample Table 1 }\label{table_specrot}before (not inside) the\begin{ltabulary}(and use the capt-of package) – David Carlisle Jul 14 '16 at 10:35tableenvironment they never split see the linked question. Just remove the begin{table} end{table} – David Carlisle Jul 14 '16 at 11:07