TransWikia.com

Why are there so many packages dealing with tables, and how to pick the right ones?

TeX - LaTeX Asked by Rob H. on April 16, 2021

I’m using LaTeX to write technical reports and datasheets. Due to their nature, the documents often contain all kinds of tables, either big or small, text or numbers, sideways or not, values spanning multiple columns and/or multiple rows, etc. To achieve the results I want, I find I often need to include a large number of packages all for only the tables, such as booktabs, widetable, multirow, makecell, rotating, the tables option from xcolor, tabularx, ctable, longtable, threeparttable, and possible also captionof and tablefootnote. These and more for doing styling of tables only.

After deciding what I want it becomes a puzzle of sorting out which packages could do the job, and if they can be combined together in some way. More often than not there will be some clash or unexpected behaviour, meaning I will need to compromise between the style of my table and the amount of time I can spend on fixing it. I find my time spend on getting the tables right to be dis-proportionally large compared to the amount of time I spend on generating the table content. (Which is exactly the opposite of why I like LaTeX.)

So my question: Why are there so many different packages that all deal with different things you can do with tables and why are they not integrated in one comprehensive package? It would seem to me that "a table" is sufficiently constraint and sufficiently common to merit one complete solution?

Maybe there is such a package? –> Then I would like to know which it is.

Or maybe this structuring is more obvious if you know how LaTeX (and LaTeX package development) works internally? –> Then could someone explain it or maybe provide some pointers to resources that can help me make nicer tables quicker?

Edits

David Carlisle pointed out a similar question: Is there an easy-to-use, all-encompassing table package?
(I had not found that one yet.)

That question is better formatted to get a ‘good’ answer. (The question is less ‘opinion based’ than how I phrased mine right now.) The main point however remains the same: What overarching package for tables is available? But given that that question and answer is already 7 years old, maybe there are some recent developments? —> https://ctan.org/pkg/nicematrix seems to be just that. (First appearance ~early 2018)

2 Answers

If you don't need breakable tabulars nor the x of tabularx, I would suggest my package nicematrix with its environment {NiceTabular}.

Correct answer by F. Pantigny on April 16, 2021

I usually just use table and tabular. I write the tabular inside the table enviroment so I can change the position of the table using the package float. Example:

documentclass[10pt,a4paper]{article}
usepackage{float}
begin{document}
        begin{table}[H]
            centering
            begin{tabular}{lll}
                textbf{Hi} & multicolumn{1}{c}{textbf{I}} & textbf{hope} 
                textbf{my} & textbf{} & textbf{answer} 
                textbf{is} &  & textbf{helpful}
            end{tabular}
        end{table}
end{document}

you should also check this page https://www.tablesgenerator.com/ . You can either import a CSV or write in a easier way the table and it will generate the latex code you need. I hope this is helpfull

Answered by Pablo on April 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP