From CSV to single page PDF

  • LaTeX
  • Thread starter zunf
  • Start date
  • #1
8
2
Hi,
I have a really simple CSV with some data that needs to be visualized all together in a single page .

The CSV content is basically 4 columns wide with short names and small numbers in the cells so I need to create a layout where the list goes from the up left corner of the page to the bottom right one .

I don't need separators, I don't need to print lines or headers, I want a clean and minimal solution . I Just need to print the content of the CSV: the data itself .

I would like to take control over the margins of the page and the font size to not waste any space on the paper, if there is a software will automatically adjust everything based on how many entries there will be in the CSV it will be even better .

I tried csv2latex and the result is very comparable to the results that I have obtained with the csvsimple package for latex, which means that it doesn't respond to my needs and I can't achieve what I want .

Since this CSV > PDF conversion will happen once in a while I'm open to all kinds of solutions, even ones that requires softwares with a GUI.

Thanks .
 

Answers and Replies

  • #2
14,364
11,682
Hi,
I have a really simple CSV with some data that needs to be visualized all together in a single page .

The CSV content is basically 4 columns wide with short names and small numbers in the cells so I need to create a layout where the list goes from the up left corner of the page to the bottom right one .

I don't need separators, I don't need to print lines or headers, I want a clean and minimal solution . I Just need to print the content of the CSV: the data itself .

I would like to take control over the margins of the page and the font size to not waste any space on the paper, if there is a software will automatically adjust everything based on how many entries there will be in the CSV it will be even better .

I tried csv2latex and the result is very comparable to the results that I have obtained with the csvsimple package for latex, which means that it doesn't respond to my needs and I can't achieve what I want .

Since this CSV > PDF conversion will happen once in a while I'm open to all kinds of solutions, even ones that requires softwares with a GUI.

Thanks .
I often loaded csv files into excel and went on from there. This gave me additional formats: from screenshot to word. This way you could first create a doc file by copy and paste and then a pdf out of it.
 
  • #3
8
2
I have at least 4 softwares to do just that, including LibreOffice since I'm on Linux, the real problem is to reflow everything on a single page and make it a single-page pdf file .

I can even create a Postscript document or a DVI file with the data on it, but since I don't have this kind of know-how with Latex or more evolved solutions I don't know how to solve this .
 
  • #4
14,364
11,682
Difficult to tell from far. OO should do the same, it was just shorter to type excel and word and simultaneously transport the meaning. But once you have it as spreadsheet, can't you simply manipulate it there until it fits at least the size.

Another approach is to use global search and replace commands, preferably on a copy of the csv (I like textpad for those purposes), and transform it into a tex version. Here are examples of matrices and tables: https://www.physicsforums.com/help/latexhelp/

I downloaded texstudio to create tex files. They automatically produce a pdf and you have full control about sizes, lists or tables and fonts.
 
  • #5
8
2
I'm still looking for the right solution or any solution whatsoever .

The point is having something that auto-fits itself and gives me the freedom to tune just the right amount of margins and fonts .

I'm still amazed by the fact that there is no tex package that auto-manages tabular data in a simple multi-column style A4 paper .

I didn't had much time to try new things lately but I found some plugins/scripts for scribus, maybe this will do the trick.
 
  • #6
14,364
11,682
a,b,c,d,e;
1,2,3,4,5;
,,,,;

(textpad) ---> F8 ("," ---> "&") F8 (";" ---> "\\ \hline")

a&b&c&d&e\\ \hline
1&2&3&4&5\\ \hline
&&&&\\ \hline

Ctrl+A Ctrl+C

(texstudio)

\begin{tabular}{columns} <--- specs
Ctrl+V
\end{tabular}
--->
\begin{tabular}{c|c|c|c|c}
a&b&c&d&e\\ \hline
1&2&3&4&5\\ \hline
&&&&\\ \hline
\end{tabular}

upload_2018-8-18_16-50-27.png


F5 ---> .pdf
 

Attachments

  • #7
robphy
Science Advisor
Homework Helper
Insights Author
Gold Member
5,778
1,078
You might be able to use the ideas from these python scripts
https://stackoverflow.com/questions/48863462/writing-full-csv-table-to-pdf-in-python
https://stackoverflow.com/questions/48795854/writing-csv-table-to-pdf-report
or perl
https://stackoverflow.com/questions/43641594/how-to-convert-csv-data-to-pdf-table-using-pdftable

By counting the height and width of your tabled csv file in units of characters,
you can probably come up with a formula for the optimal font size and column spacing for your paper size.
 
  • #8
DrDu
Science Advisor
6,099
805

Related Threads on From CSV to single page PDF

Replies
0
Views
1K
Replies
3
Views
3K
Replies
1
Views
2K
Replies
3
Views
96K
Replies
5
Views
813
Replies
6
Views
4K
Replies
3
Views
490
Replies
4
Views
11K
  • Last Post
Replies
1
Views
29K
Replies
5
Views
10K
Top