Monday, July 16, 2012

Making Awesome Latex Tables

Yep, still disserating... thus all the posts are more about the process of writing than actual science research.  Here is a post about how to make awesome looking tables using latex and deluxetable.

I like using the deluxetable style in latex because the tables look nicer than normal latex tables, and you have more flexibility.  Below is an example of a cool table with come nice features that I made for my thesis:



Latex Code:

\begin{deluxetable}{cccccccc}
\tabletypesize{\footnotesize}
\tablecolumns{8} 
\tablewidth{0pt}
\tablecaption{ Cross-correlation Fit Details
\label{tab:lumresults1}}
\tablehead{
\colhead{QSO} \vspace{-0.2cm}& \colhead{$R$ Range} &  & & &  &\colhead{Separation} & \colhead{Result}\\ \vspace{-0.2cm}
& & \colhead{$\langle f \rangle$} & \colhead{$r_0$} &  \colhead{$\gamma$}& $W$ & & \\
\colhead{Division} & \colhead{(Mpc/h)} & \colhead{} & \colhead{} & \colhead{}&& \colhead{(\%)} & \colhead{Strength}} 
\startdata 
\vspace{-0.2cm} \nicefrac{1}{3} Bright &  & $4.24 \cdot 10^{-4}$ & 6.19 && 96.97 & &\\ \vspace{-0.2cm}
& [0.3,3] & & & 1.77 & &  96.7 & 1.9$\sigma$ \\ 
 \nicefrac{2}{3} Dim & & $4.26 \cdot 10^{-4}$ & 4.48 & & 52.77
\enddata
\vspace{-0.8cm}
\tablecomments{Luminosity dependent quasar clustering using a cross-correlation technique between CS82 galaxies ($M < 23.5$) and SDSS, BOSS, and 2SLAQ quasars \hbox{($0.5$)}}
\end{deluxetable}


Note that you need the file deluxetable.sty from here.

6 comments:

  1. Hi Jessica, I am actually working on my MS thesis and I'm using the aastex document class. I love the way \deluxetable does tables, but I cannot for the life of me figure out how to automate adding references to tables. I would love for latex to convert table references into numbers (beginning with 1) within the \deluxetable environment and then automatically filling out the table's reference section with the corresponding references spelled out. Right now, the only way I know of accomplishing this is "manually" using excel. Any thoughts or solutions? Thanks!

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi Jessica. You are missing "$)}}" at the end of the \tablecomments command.

    ReplyDelete
  4. Deluxe table begins in new page no matter what, how fix this?

    ReplyDelete
  5. How can you prepare deluxetable as a one column format for a two-column document?

    ReplyDelete