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 need to put three lists of data into three columns. After putting the first set of data this happened: Table

But I need all the data to be in the FIRST column only, the next sets of data will go in column 2 and 3 respectively. So far I have this LaTeX code:

\usepackage{multicol}
\begin{multicols}{3}
Article 1 Sorted by Frequency:\\
e: 323    FREQ:  0.12737\\
t: 242    FREQ:  0.09543\\
o: 232    FREQ:  0.09148\\
...
\end{multicols}

What do i write to put the data into 3 columns?

share|improve this question
4  
There's a starred variant of the multicols environment that doesn't balance the columns. There is also the \columnbreak macro which ends one column and lets you start the next. Having said that I also think that a table might be better suited for the task. –  cgnieder Jan 27 '13 at 22:56
    
you need to separate the data that goes into the column by the symbol &. So if you want "e: 323" in the first column and FREQ: 0.12737 in the second column, you need to write: e: 323 & FREQ: 0.12737\\ . If the first line should only contain entry in one cell, you can do that like this: Title&\\ (the second cell will contain nothing in this case). When you start specifying the content of column2&3 you should automatically see that the data you have entered so far, will only appear in column1. –  myrtille Jan 28 '13 at 1:35
add comment

1 Answer 1

up vote 3 down vote accepted

You can use the package longtable. The only drawback for you probably is that you have to input the data by lines, not by columns, but I dunno.

Remark: Everything with lipsum in name is there only to provide some dummy text.

Remark 2: \endfirsthead ends the code used for the head on page one. Similar commands \endlastfoot (foot on last page of the table) and \endhead and \endfoot exist (for the "running" heads and foots). They are placed after the piece of code to be the head/foot.

Remark 3: You can format the table similarly as tabular (adding lines, centering columns etc.)

\documentclass{article}

\usepackage{longtable}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{longtable}{lll}
Col 1 head & Col 2 head & Col 3 head \\\endfirsthead
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 \\
c1 & c2 & c3 
\end{longtable}

\lipsum[2]

\end{document}
share|improve this answer
add comment

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.