0

I am having a problem with my table environment and the section headings. In particular, I'm not sure why my table and figures section seem to be placed together without the table to split them. This is my code as follows:

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[margin=1.25in,top=1in,bottom=1in]{geometry}
\makeatletter
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{ragged2e}
\newcolumntype{L}{ >{\RaggedRight}X }
\usepackage{siunitx}
\usepackage{makecell}
\renewcommand\theadfont{\normalfont\bfseries}
\newcolumntype{Y}{ >{\Centering}X}
\usepackage[justification=centering]{caption}
\setlength\parindent{0pt}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\renewcommand\theadfont{\normalfont\bfseries}
\newcommand\mc[1]{\multicolumn{2}{c}{#1}}
\setlength\parindent{0pt}
\usepackage[round,sort]{natbib}
    \usepackage{indentfirst}
    \usepackage{amsmath}
    \usepackage{siunitx}
    \usepackage{setspace}
    \setlength{\parindent}{0.5cm}
    \usepackage{csquotes}
    \usepackage{hyperref}
    \usepackage{moreverb}
    \usepackage{babel}
    \linespread{2}
    \usepackage{graphicx}
    \usepackage[toc,page]{appendix}
\begin{document}
\section{Tables}
\listoftables

\begin{table}[p]
\caption{Summary Statistics}
\label{table: table1}
\begin{tabularx}{\textwidth}{@{} l L *{5}{S[table-format=-1.2]} @{}}
    \toprule   
\thead[lc]{Category }& \thead{Strategies}& {\thead{Annualized \\ Mean}} & {\thead{Volatility}} & {\thead{Skew}} & {\thead{kurtosis}} & {\thead{Sharpe \\ Ratio}} \\
    \midrule   
    \multirow{1}{*}{ Momentum } & TSMOM(8,12) & 62.93 & 16.59 & -0.08 & 12.62 & 1.04  \\ \addlinespace    
\bottomrule
\end{tabularx}
\end{table}

\section{Figures}
\listoffigures

\begin{figure}[h]
\caption{Annualized Mean Return For All TSMOM Strategies}
\label{fig:Fig1}
\centering
\includegraphics[width=1\textwidth,height=1\textheight,keepaspectratio]{Surfaceplotmean}

\end{figure}
\end{document}

Which produces the section Tables, list of tables, and then the section figures and list of figures while the next page shows my first table. How could I rearrange this so that the figures section appears after my table ?

Thank you

5
  • \clearpage before the \section Mar 13, 2016 at 20:33
  • none of the tables here should be set using tabularx. Mar 13, 2016 at 20:35
  • @DavidCarlisle That worked well. Which tabular environment should I be using ? Would it be tabular* ? I have received advice to used tabularx but what is the disadvantage here ? Thank you Mar 13, 2016 at 20:44
  • just tabular tabularx is designed to adjust the table width by affecting line breaking within the columns so for numeric tables that don't have paragraphs of text it's just the wrong tool really. Mar 13, 2016 at 20:54
  • @DavidCarlisle Thank you for the explanation, I will try to understand tabular and use it next time. Mar 14, 2016 at 6:02

1 Answer 1

1

As I understand it:

\documentclass[12pt]{article}
%preamble as shown above

\begin{document}

\section{Tables}
\listoftables

\begin{table}[h!]
    \caption{Summary Statistics}
    \label{table: table1}
    \begin{tabularx}{\textwidth}{@{} l L *{5}{S[table-format=-1.2]} @{}}
        \toprule   
        \thead[lc]{Category }& \thead{Strategies}& {\thead{Annualized \\ Mean}} & {\thead{Volatility}} & {\thead{Skew}} & {\thead{kurtosis}} & {\thead{Sharpe \\ Ratio}} \\
        \midrule   
        \multirow{1}{*}{ Momentum } & TSMOM(8,12) & 62.93 & 16.59 & -0.08 & 12.62 & 1.04  \\ \addlinespace    
        \bottomrule
    \end{tabularx}
\end{table}

\section{Figures}
\listoffigures

\end{document}

The use of [h!] is highly disapproved in the LaTeX community though. It limits the compiler to exactly place the table "here". If the space is insufficient the table could be placed at the end of the document.


table between listof

2
  • Thank you, this problem seems to persist if I have a lengthier table. For instance if this table was 12 rows long, then it appears that \begin{table}[h!] does not quite do the job. Unless is this quite normal for latex to do so until I have enough tables such that the figures will automatically appear after all my tables (when I have 6-7 tables) ? Or should I just use a section titled tables and figures (i think I may just have to settle with this then) Mar 13, 2016 at 20:21
  • 1
    normally [h!] will generate a warning that it is being changed to [ht!] Mar 13, 2016 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .