1

I need to generate a latex table using data from a csv file. The table has only two columns with about 500 rows. I would like to make best use of the space and continue the table on the same page, before moving onto the next page. Any directions please?

Thanks, Sam

  • 5
    Maybe print on a roll of papyrus :o) You won't be limited. Seriously, how do you want a single sheet of paper to contain 500 lines? – Bernard Jun 7 '16 at 12:28
  • Question is not so clear. Do you want directions on how to make a basic table? use csv for your table? Or just to make an extra, extra long page for your table to be placed? If you have made any concrete attempts thus far, please share your code in your answer using the code block tools to highlight them in gray. No judgment here as to why you might want to do this ;) – A Feldman Jun 7 '16 at 17:22
2

There are examples of how to split a long narrow table into two (Automatic way to break narrow tables into two columns?), but I don't know if that would work so well in your case.

Depending on exactly what you need in terms of layout, you could possibly use a simple itemize list in a multicols environment, in combination with e.g. datatool.

For example:

\documentclass{article}
\usepackage{datatool}
\DTLloaddb{data}{500.txt}
\usepackage{multicol}
\setlength{\columnseprule}{0.4pt}
\begin{document}
\begin{multicols}{4}
\begin{itemize}
\DTLforeach{data}{\a=a,\b=b}{\item[\a]\quad \b}
\end{itemize}
\end{multicols}
\end{document}

where 500.txt goes like

a,b
0,0
1,1
2,4
3,9
4,16
5,25

and so on for 500 lines.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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