1

I am doing my thesis and want to have all table consistently centered on the page, and \footnotesize text. For some reason one table decides to left justify when I make it footnote size (or any other size):

\begin{table}[H]
    \caption{Variants in genes with AF $< 0.01$ in Individual II1, Family A.}
    \label{table:BBS_var} 
\begin{footnotesize}
    \centering
    \begin{tabular}{llllrr}
    \hline
    \textbf{Gene} & \textbf{Nucleotide} & \textbf{Amino-acid} & \textbf{Transcript} &  \textbf{ESP} & \textbf{GERP}\\
        &   \textbf{change} & \textbf{change} & \textbf{ID} & \textbf{AF} &\textbf{++} \\
    \hline
    \textit{Lorem}  & . & . & Lorem  & 0.00186 & 5.4  \\
    \textit{Lorem} & . & . & Lorem            & .        & 2.25 \\
    \textit{Lorem}  & .  & . & Lorem          & .        & 5.67 \\
    \textit{Lorem}  & .  & . & Lorem             & 0.000116 & 5.67 \\
    \hline
    \end{tabular}
\end{footnotesize}
\end{table}

If I remove the \footnotsize lines then it centres the table fine, but is the wrong size text obviously.

I can also use \begin{centre} within the table environment, but then this adds a large gap between the caption and table, which is also undesired.

I have another almost identical table (aside from the data) which reduces size without issue. I have tried copying this table and repopulating it for the data for this table, but then the issue magically manifests again.

Any ideas? It's starting to make me feel I'm going a little bit insane now....

PS. Using Pdflatex 2013.9.11, preamble is:

%% General layout
\documentclass[12pt,a4paper,oneside]{book}
\usepackage{fullpage}
\usepackage{tikz}
\usepackage{microtype}
\usepackage[onehalfspacing]{setspace}
\usepackage[bindingoffset=2cm,margin=2cm]{geometry}
\usepackage[utf8]{inputenc} % UTF8 encoding solves issuse in references with obscure characters
\usepackage{fixltx2e} % adds subscript command
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage[toc,page]{appendix}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage{color}
\usepackage{subfigure}
%Figure layout
\usepackage{graphicx}
\usepackage{float}
\usepackage[margin=12pt,font=footnotesize,labelfont=bf,labelsep=colon]{caption}
\graphicspath{{./figures/}}

%PDF bookmarks
\usepackage[bookmarks=true,hidelinks]{hyperref}
\usepackage{bookmark}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{0 pt}
  • try putting the \centering outside the footnotesize environment. – Steven B. Segletes Mar 29 '14 at 19:53
  • Cheers, his has fixed the problem for this table. I'm very confused as to why this wasn't a problem for the other table though, oh well. – Reuben John Pengelly Mar 29 '14 at 20:26
3

Commands that set paragraph parameters, \centering, \footnotesize, \raggedright, etc. have to be in scope at the end of the paragraph as the final values are used to set the paragraph. So you either need to not have a group (which is made by using the environment form of \footnotesize or you need to include a blank line before the end of the environment. In this example the problem was mostly apparent in \centering which went out of scope before the paragraph ended, but also the footnotesize didn't really work either as the baselineskip reverted to normalsize. There was only one "line" (the tabular) in this paragraph so it didn't matter so much, but in general font size changes need the paragraph break.

3

There is no footnotesize environment. Just write

\centering\footnotesize

instead. By the way, the subfigurepackage is obsolete and no more maintained. Use subfig or subcaption (part of the captionpackage) or floatrow, which has a subfloatrow environment.

Result, compiled with the showframe option of geometry:

enter image description here

  • This did the trick too. And I'll look into the other non deprecated packages, thanks for the heads-up. – Reuben John Pengelly Mar 29 '14 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.