What I would like to do : put table captions directly above my tables without space between the caption and the table
I am using the floatrow
, subfig
and caption
package and I am writing in the report class
What I don't understand :
Why my table captions are by default below the tables ? I thought Latex usually put table captions above ? So I have to specify it with the
floatrow
package by\floatstyle[table]{capposition=top}
However, with thecaption
package, the command\captionsetup[table]{position=above}
does not seem to work.Why can not I remove the space between caption and table ? with the
floatrow
package, the command\floatstyle[table]{captionskip=0pt}
seems to have an impact but not as expected whereas with the caption package, it does not work (\captionsetup[table]{skip=0pt}
).
Is there any package conflicts I am not aware of ?
Here is a simplified code with truncated tables :
\documentclass[12pt,a4paper,oneside]{report}
\usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage{floatrow}
\usepackage{multirow,bigdelim}
\usepackage{booktabs}
\usepackage{textgreek}
\usepackage{gensymb}
\usepackage[label font=bf,labelformat=simple]{subfig}%using for my other figures
\usepackage[font=footnotesize,labelfont=bf]{caption}%also using for my other figures
\floatsetup[table]{capposition=top,captionskip=0pt}
\usepackage[table]{xcolor}
\definecolor{GrayTable}{gray}{0.90}
\definecolor{GrayText}{gray}{0.55}
\definecolor{BlueTable}{rgb}{0.0,0.6,0.9}
\begin{document}
\begin{table}[!htb]
\caption{Mix PCR pour vérifier la présence des LCT}
\rowcolors{2}{GrayTable}{white}
\resizebox{\textwidth}{!}{% Using this command because the table is large
\begin{tabular}{ccccc}
\toprule
\rowcolor{BlueTable} LCT & Séquence SU & Taille de l'amplicon (pb) & Température d'hybridation (\degree C) & Concentration en MgCl$_{2}$ \\
\midrule
LCT\_0071 & AAAAGAGCGTGTTATTTTAGGCA & 200 & 60 & 2 \\
LCT\_0078 & TGGCCACCTTCTCTTTCCAT & 143 & 60 & 2 \\
LCT\_0090 & ACGGCTTTGCTTTCAGTTGT & 160 & 60 & 2 \\
\bottomrule
\end{tabular}}
\end{table}
\begin{table}[!htb]
\singlespacing
\caption{Mix PCR pour vérifier la présence des LCT}
\begin{tabular}{ccccc}
\toprule
\rowcolor{BlueTable} Réactifs & Concentration initiale & Concentration finale & Volume pour 1 tube (\textmu L) \\
\midrule
Buffer & 5X & 1X & 5\\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Thanks !
\singlespacing
command from the second table. Apart from that, you might want to use a package likemhchem
for chemical formulae (\ce{MgCl2}
). Also I'd recommend to not useresizebox
on a table as it will lead to inconsistent and very small font sizes. You could introduce linebreaks in the column headers instead. Personally, I'd also not use colors for table headers as this will decrease the contrast between the text and the background and therefor decrease readability.