Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to stretch out the content of the table/tabular-environment over as many columns on the first and second page as possible. How can I achieve that?

MWE

\documentclass[
11pt
]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{
booktabs,
longtable,
multicol
}


\begin{document}
%\begin{multicols}{3}
\begin{longtable}{rr}
\toprule
Number & Letter\\
\midrule
\endhead
\bottomrule
\endfoot
1     & A \\
2     & B \\
3     & C \\
4     & A \\
5     & B \\
6     & C \\
7     & A \\
8     & B \\
9     & C \\
10    & A \\
11    & B \\
12    & C \\
13    & A \\
14    & B \\
15    & C \\
16    & A \\
17    & B \\
18    & C \\
19    & A \\
20    & B \\
21    & C \\
22    & A \\
23    & B \\
24    & C \\
25    & A \\
26    & B \\
27    & C \\
28    & A \\
29    & B \\
30    & C \\
31    & A \\
32    & B \\
33    & C \\
34    & A \\
35    & B \\
36    & C \\
37    & A \\
38    & B \\
39    & C \\
40    & A \\
41    & B \\
42    & C \\
43    & A \\
44    & B \\
45    & C \\
46    & A \\
47    & B \\
48    & C \\
49    & A \\
50    & B \\
51    & C \\
52    & A \\
53    & B \\
54    & C \\
55    & A \\
56    & B \\
57    & C \\
58    & A \\
59    & B \\
60    & C \\
61    & A \\
62    & B \\
63    & C \\
64    & A \\
65    & B \\
66    & C \\
67    & A \\
68    & B \\
69    & C \\
70    & A \\
71    & B \\
72    & C \\
73    & A \\
74    & B \\
75    & C \\
76    & A \\
77    & B \\
78    & C \\
79    & A \\
80    & B \\
81    & C \\
82    & A \\
83    & B \\
84    & C \\
85    & A \\
86    & B \\
87    & C \\
88    & A \\
89    & B \\
90    & C \\
91    & A \\
92    & B \\
93    & C \\
94    & A \\
95    & B \\
96    & C \\
97    & A \\
98    & B \\
99    & C \\
100   & A \\
101   & B \\
102   & C \\
103   & A \\
104   & B \\
105   & C \\
106   & A \\
107   & B \\
108   & C \\
109   & A \\
110   & B \\
111   & C \\
112   & A \\
113   & B \\
114   & C \\
115   & A \\
116   & B \\
117   & C \\
118   & A \\
119   & B \\
120   & C \\
121   & A \\
122   & B \\
123   & C \\
124   & A \\
125   & B \\
126   & C \\
127   & A \\
128   & B \\
129   & C \\
130   & A \\
131   & B \\
132   & C \\
133   & A \\
134   & B \\
135   & C \\
136   & A \\
\end{longtable}
%\end{multicols}
\end{document}

The Goal (quickly edited in Gimp, thus very low quality)

enter image description here

share|improve this question
    
Unfortunately, it does not: screenshot. –  henry Aug 20 '13 at 6:57
    
Doesn't work neither. Screenshot. Also, putting this code bit in the preamble, doesn't this affect all longtable-environments? –  henry Aug 20 '13 at 7:18
    
Done. Edited the op. :) Just to make sure: I would like the other longtables to be processed normally. –  henry Aug 20 '13 at 7:46

1 Answer 1

up vote 2 down vote accepted

This "brute force" solution uses some code stolen from this answer of David Carlisle.

MWE

\documentclass[
11pt
]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{
booktabs,
longtable,
multicol
}

\newsavebox\ltmcbox


\begin{document}
\begin{multicols}{4}
\setbox\ltmcbox\vbox{
\makeatletter\col@number\@ne
\begin{longtable}{rr}
\toprule
Number & Letter\\
\midrule
1     & A \\
2     & B \\
3     & C \\
4     & A \\
5     & B \\
6     & C \\
7     & A \\
8     & B \\
9     & C \\
10    & A \\
11    & B \\
12    & C \\
13    & A \\
14    & B \\
15    & C \\
16    & A \\
17    & B \\
18    & C \\
19    & A \\
20    & B \\
21    & C \\
22    & A \\
23    & B \\
24    & C \\
25    & A \\
26    & B \\
27    & C \\
28    & A \\
29    & B \\
30    & C \\
31    & A \\
32    & B \\
33    & C \\
34    & A \\
35    & B \\
36    & C \\
37    & A \\
38    & B \\
39    & C \\
40    & A \\
\bottomrule
\\[3pt]
\toprule
Number & Letter\\
\midrule
41    & B \\
42    & C \\
43    & A \\
44    & B \\
45    & C \\
46    & A \\
47    & B \\
48    & C \\
49    & A \\
50    & B \\
51    & C \\
52    & A \\
53    & B \\
54    & C \\
55    & A \\
56    & B \\
57    & C \\
58    & A \\
59    & B \\
60    & C \\
61    & A \\
62    & B \\
63    & C \\
64    & A \\
65    & B \\
66    & C \\
67    & A \\
68    & B \\
69    & C \\
70    & A \\
71    & B \\
72    & C \\
73    & A \\
74    & B \\
75    & C \\
76    & A \\
77    & B \\
78    & C \\
79    & A \\
80    & B \\
\bottomrule
\\[3pt]
\toprule
Number & Letter\\
\midrule
81    & C \\
82    & A \\
83    & B \\
84    & C \\
85    & A \\
86    & B \\
87    & C \\
88    & A \\
89    & B \\
90    & C \\
91    & A \\
92    & B \\
93    & C \\
94    & A \\
95    & B \\
96    & C \\
97    & A \\
98    & B \\
99    & C \\
100   & A \\
101   & B \\
102   & C \\
103   & A \\
104   & B \\
105   & C \\
106   & A \\
107   & B \\
108   & C \\
109   & A \\
110   & B \\
111   & C \\
112   & A \\
113   & B \\
114   & C \\
115   & A \\
116   & B \\
117   & C \\
118   & A \\
119   & B \\
120   & C \\
\bottomrule
\\[3pt]
\toprule
Number & Letter\\
\midrule
121   & A \\
122   & B \\
123   & C \\
124   & A \\
125   & B \\
126   & C \\
127   & A \\
128   & B \\
129   & C \\
130   & A \\
131   & B \\
132   & C \\
133   & A \\
134   & B \\
135   & C \\
136   & A \\
\bottomrule
\\[3pt]
\pagebreak
\end{longtable}
\unskip
\unpenalty
\unpenalty}

\unvbox\ltmcbox
\end{multicols}
\end{document} 

Output

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.