TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Tably – Python script for converting .csv to LaTeX tables

57 pointsby narimiranover 7 years ago

7 comments

gregodover 7 years ago
If you have the csvsimple [1] latex package available this can be done as latex macro. This allows for easy integration with other latex packages (drawing stuff with tikz for example [2]).<p>Python and a makefile might perform better for larger data sets though.<p>[1] <a href="https:&#x2F;&#x2F;ctan.org&#x2F;pkg&#x2F;csvsimple" rel="nofollow">https:&#x2F;&#x2F;ctan.org&#x2F;pkg&#x2F;csvsimple</a> [2] <a href="http:&#x2F;&#x2F;www.godberit.de&#x2F;2016&#x2F;01&#x2F;31&#x2F;Keeping-documentation-up-to-date-using-LaTeX-and-Tikz.html" rel="nofollow">http:&#x2F;&#x2F;www.godberit.de&#x2F;2016&#x2F;01&#x2F;31&#x2F;Keeping-documentation-up-t...</a>
loreyover 7 years ago
If you have pandas installed, you can also use something like:<p><pre><code> pd.DataFrame.from_csv(path_csv).to_latex(path_latex) </code></pre> More information at <a href="http:&#x2F;&#x2F;pandas.pydata.org&#x2F;pandas-docs&#x2F;stable&#x2F;generated&#x2F;pandas.DataFrame.to_latex.html" rel="nofollow">http:&#x2F;&#x2F;pandas.pydata.org&#x2F;pandas-docs&#x2F;stable&#x2F;generated&#x2F;pandas...</a>
评论 #15434174 未加载
fiatjafover 7 years ago
See also <a href="http:&#x2F;&#x2F;stevecat.net&#x2F;table-magic&#x2F;" rel="nofollow">http:&#x2F;&#x2F;stevecat.net&#x2F;table-magic&#x2F;</a> for in-browser table conversion between CSV&#x2F;TSV, HTML, Markdown, SQL (the output format) and an editable table-form.
tmalsburg2over 7 years ago
In R:<p><pre><code> read_csv(&quot;file.csv&quot;) %&gt;% xtable </code></pre> p.s: I don&#x27;t want to suggest the the Python program is inferior. This is just an illustration showing how easy it is to manipulate table data in R. R is basically a language designed for that purpose.
评论 #15441858 未加载
narimiranover 7 years ago
I know this is very basic and not comparable with most of the stuff posted here, but anyway...<p>If you have some feature suggestion, bug report, or some general (coding) advice, please let me know. Thank you in advance!
评论 #15433954 未加载
horatatataover 7 years ago
either way! im going to use Latex tables more because they are so easy and so damn good lookin&#x27;
cup-of-teaover 7 years ago
Why? Is CSV easier to write than LaTeX? I prefer something like org-mode tables which are actually easy to write.
评论 #15433973 未加载
评论 #15433936 未加载