3

I would like to have a single table that automatically breaks when it does not fit on the page. Is it possible? I have manually made an example illustragin the desired behavior. I created multiple tabulars inside a minipage. See the Figure and Code bellow.

table example

\begin{minipage}{\textwidth}

\begin{tabular}{|p{3cm}|c|c|c|c|c|c|c|c|c|c|}
\hline
letter & a & e & o & s & r & i & d & m & t & n \\ 
\hline
freq.\footnote{frequencia relativa de ocorrência} (\%) & 14.634 & 11.570 & 9.735 & 6.805 & 6.530 & 6.186 & 4.992 & 4.738 & 4.736 & 4.046 \\
\hline
\end{tabular}

\vspace{0.3cm}

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
c & u & l & p & v & g & q & b & f & h & \~a & \^o & \^a \\
\hline
3.882 & 3.634 & 2.779 & 2.523 & 1.575 & 1.303 & 1.204 & 1.043 & 1.023 & 0.781 & 0.733 & 0.635 & 0.562 \\
\hline
\end{tabular}

\vspace{0.3cm}

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\'c & z & \^e & j & \'e & \'o & x & \'u & \'i & \'a & \`a & w & \"u \\
\hline
0.530 & 0.470 & 0.450 & 0.397 & 0.337 & 0.296 & 0.253 & 0.207 & 0.132 & 0.118 &   0.072 & 0.037 & 0.026  \\
\hline
\end{tabular}

\vspace{0.3cm}

\begin{tabular}{|c|c|}
\hline
k & y \\
\hline
0.015 & 0.006 \\
\hline
\end{tabular}
\end{minipage}
LEo
  • 772

1 Answers1

7

I removed the footnote and the rules as they make it harder:-) Also the amount of lines to backspace could be more automatic...

\documentclass{article}
\def\foo{\setbox0\vbox\bgroup
\tabcolsep4em plus 1fill
\let\\\cr
\halign\bgroup&\strut\hfil\ \ignorespaces##\unskip\ \hfil\cr}

\def\endfoo{%
\crcr\egroup
\par
\unpenalty\unskip
\global\setbox1\lastbox
\unpenalty\unskip
\global\setbox3\lastbox
\egroup

\raggedright
{\baselineskip=4\baselineskip
\noindent\unhbox3\par}

\vspace{-15\baselineskip}
\vspace{-\parskip}
{\baselineskip=4\baselineskip
\noindent\unhbox1\par}


}


\begin{document}


\begin{foo}
letter & a & e & o & s & r & i & d & m & t & n &
c & u & l & p & v & g & q & b & f & h & \~a & \^o & \^a &
\'c & z & \^e & j & \'e & \'o & x & \'u & \'i & \'a & \`a & w & \"u &
k & y \\
freq. (\%) & 14.634 & 11.570 & 9.735 & 6.805 & 6.530 & 6.186 & 4.992 & 4.738 & 4.736 & 4.046 &
3.882 & 3.634 & 2.779 & 2.523 & 1.575 & 1.303 & 1.204 & 1.043 & 1.023 & 0.781 & 0.733 & 0.635 & 0.562 &
0.530 & 0.470 & 0.450 & 0.397 & 0.337 & 0.296 & 0.253 & 0.207 & 0.132 & 0.118 &   0.072 & 0.037 & 0.026 &
0.015 & 0.006 
\end{foo}


\end{document}
David Carlisle
  • 757,742