Quantcast
Channel: advice and suggestions for table styles - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

advice and suggestions for table styles

$
0
0

Hi there I'm working on my thesis and looking for the best way possible to present tabular data. I don't have much experience with LaTex, hence, I though to seek for some ideas and hits on how to do it.

To be fair, neither I'm dealing with very complex tables nor there are many of them in my work; however, sometimes they present some level of nesting and often it could be helpful to resort to \diagbox to have some clues on what the two indexes stand for.

Below is one example of such tables:enter image description here

and code

\documentclass[12pt]{report}\usepackage[letterpaper,margin=1in]{geometry}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}\usepackage{subcaption}\usepackage{caption}\usepackage{amsmath}\usepackage{xcolor}\usepackage{float}\usepackage{longtable}\usepackage{booktabs}\usepackage{diagbox}\begin{document}\begin{longtable}{lcccccccccc}\caption[\textbf{Some caption}]{\textbf{Some caption.}} \\\toprule\multicolumn{1}{l}{\diagbox{stats}{IDs}} &\multicolumn{2}{c}{HG002} &\multicolumn{2}{c}{HG00514} &\multicolumn{2}{c}{HG00733} &\multicolumn{2}{c}{HG03492} &\multicolumn{2}{c}{NA19240} \\\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(lr){8-9}\cmidrule(lr){10-11}&\multicolumn{1}{c}{hap1} &\multicolumn{1}{c}{hap2} &\multicolumn{1}{c}{hap1} &\multicolumn{1}{c}{hap2} &\multicolumn{1}{c}{hap1} &\multicolumn{1}{c}{hap2} &\multicolumn{1}{c}{hap1} &\multicolumn{1}{c}{hap2} &\multicolumn{1}{c}{hap1} &\multicolumn{1}{c}{hap2} \\\midruleN50 & 45.94 & 45.02 & 20.35 & 20.12 & 45.73 & 43.81 & 17.85 & 20.16 & 12.15 & 13.00 \\L50 & 20 & 18 & 41 & 44 & 23 & 23 & 50 & 45 & 77 & 64 \\NG50\makebox[0pt][l]{$^{\ast}$} & 50.15 & 44.90 & 21.58 & 20.12 & 47.79 & 45.83 & 17.89 & 19.97 & 12.98 & 13.03 \\\midrule[\heavyrulewidth]\multicolumn{11}{l}{\footnotesize$^*$ NG50 metric is calculated considering a genome size of 3Gbp} \\\bottomrule\label{table:assemblies}\end{longtable}\end{document}

Now, what I learned so far is:

  1. simple is best and avoid vertical lines
  2. use the appropriate functions to draw table items and
  3. stick as much as possible to more conventional approaches to draw tables

Based on this I'm pretty satisfied with the output, if not for the \diagbox not looking that "great" when not joining the horizontal lines drew with \cmidrule, and probably the very big gap between \toprule and \cmidrule below the samples' IDs which I guess is somehow unavoidable because of the \diagbox.

If anyone has any alternative way to present this data and some other similar one, any help is much appreciated. Granted, I kind of like the option of being able to break tables through pages e.g.\longtable and similar, I like the idea of having a \diagbox in the first cell as long as it looks nice — I'm also interested in other option in this regard.Last but not least, it would be nice to have any form of dashed line integration as I've noticed \longtable is not very resilient to such edits.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images