1

I'm having trouble getting my figures and tables in the proper order. They seem to be in the document in a seemingly random manner. Here is the code I am using:

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{graphicx}

\begin{document}
...

\appendix
\section*{Appendix A: Figures and Tables}
\begin{figure}[h!]
\centering
\caption{Relationship Between GDP per Capita and Mean Tariff Rates}
\includegraphics[width=0.7\linewidth]{gdpscatter}
\label{fig:gdpscatter}
\end{figure}

\begin{figure}[h!]
\centering
\caption[]{Low Income Countries Mean Tariff Rates}
\label{fig:lowinchist}
\includegraphics[width=0.7\linewidth]{lowinchist}
\end{figure}

\begin{figure}[h!]
\centering
\caption[]{High Income Countries Mean Tariff Rates}
\label{fig:upinchist}
\includegraphics[width=0.7\linewidth]{upinchist}
\end{figure}

\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Results\label{tab1}}
\begin{tabular}{l*{3}{c}}
    \hline\hline
    &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}\\
    &\multicolumn{1}{c}{LN GDP Per Cap}&\multicolumn{1}{c}{LN GDP Per Cap}&\multicolumn{1}{c}{LN GDP Per Cap}\\
    \hline
    Tariff&    0.662\sym{***}&    0.260\sym{***}&    0.232\sym{***}\\
    & (0.0250)         & (0.0234)         & (0.0227)         \\
    [1em]
    Propright&                  &    0.276\sym{***}&    0.182\sym{***}\\
    &                  & (0.0179)         & (0.0220)         \\
    [1em]
    Govtcon&                  &   -0.162\sym{***}&   -0.135\sym{***}\\
    &                  & (0.0104)         & (0.0101)         \\
    [1em]
    Forex&                  &   0.0754\sym{***}&   0.0702\sym{***}\\
    &                  &(0.00611)         &(0.00586)         \\
    [1em]
    Moneygrowth    &                  &   0.0344\sym{*}  &  0.00939         \\
    &                  & (0.0145)         & (0.0144)         \\
    [1em]
    Bribes&                  &    0.120\sym{***}&    0.269\sym{***}\\
    &                  & (0.0177)         & (0.0228)         \\
    [1em]
    Constant        &    2.999\sym{***}&    4.368\sym{***}&    4.010\sym{***}\\
    &  (0.206)         &  (0.220)         &  (0.238)         \\
    Fixed Effects & No & No & Yes\\
    \hline
    Observations    &     2033         &     1753         &     1753         \\
    \hline\hline
    \multicolumn{4}{l}{\footnotesize Standard errors in parentheses}\\
    \multicolumn{4}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
\end{table}

\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Results by Country Income Level\label{tab2}}
\begin{tabular}{l*{4}{c}}
    \hline\hline
    &\multicolumn{1}{c}{(Low)}&\multicolumn{1}{c}{(Low-Middle)}&\multicolumn{1}{c}{(Upper-Middle)}&\multicolumn{1}{c}{(Upper)}\\
    &\multicolumn{1}{c}{LN GDP Per Cap}&\multicolumn{1}{c}{LN GDP Per Cap}&\multicolumn{1}{c}{LN GDP Per Cap}&\multicolumn{1}{c}{LN GDP Per Cap}\\
    \hline
    Tariff&    0.110\sym{***}&   0.0652\sym{**} &  0.00176         &  -0.0184         \\
    & (0.0299)         & (0.0203)         & (0.0180)         & (0.0375)         \\
    [1em]
    Propright&   0.0397         &   0.0297         &   0.0375         &    0.193\sym{***}\\
    & (0.0291)         & (0.0229)         & (0.0192)         & (0.0232)         \\
    [1em]
    Govtcon&   0.0237         &  0.00742         &  -0.0250\sym{*}  &  -0.0365\sym{***}\\
    & (0.0155)         & (0.0107)         &(0.00980)         &(0.00801)         \\
    [1em]
    Forex& -0.00707         &-0.000292         &   0.0203\sym{***}&  -0.0135         \\
    &(0.00682)         &(0.00502)         &(0.00499)         & (0.0109)         \\
    [1em]
    Moneygrowth    &   0.0184         &  -0.0248         &  -0.0221         &   0.0119         \\
    & (0.0149)         & (0.0135)         & (0.0122)         & (0.0199)         \\
    [1em]
    Bribes&  -0.0184         &    0.162\sym{***}& -0.00570         &   0.0747\sym{***}\\
    & (0.0312)         & (0.0244)         & (0.0227)         & (0.0208)         \\
    [1em]
    Constant        &    5.431\sym{***}&    6.282\sym{***}&    8.758\sym{***}&    8.307\sym{***}\\
    &  (0.323)         &  (0.240)         &  (0.201)         &  (0.367)         \\
    \hline
    Observations    &      297         &      457         &      416         &      583         \\
    \hline\hline
    \multicolumn{5}{l}{\footnotesize Standard errors in parentheses}\\
    \multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
\end{table}
\end{document}

However, in the document itself, it shows the first two figures, then the tables, and then the final figure. I want it to go all figures and then all tables. I tried making it two seperate appendices, but that just created more formatting issues (at the end of Figure 3, on the same page, it would begin Appendix B, but then there was a lot of awkward white space since the table wouldn't fit and I couldn't get rid of it to save my life).

  • In appendix you have only floats (figures, tables). They appear in order as they are inserted in text. However, between them is probably more white space. This is consequence of LaTeX expectation, that 1/3 of a page contain text ... – Zarko Jul 24 '17 at 0:54
  • 1
    How large (tall) are the figures? Do they tend to be fairly short? The article document class, by default, imposes a limit (3, given by the counter totalnumber, of which only 2 are allowed to be top-aligned) of how many floats of type figure and table are allowed to be on any given page. Have you tried (a) increasing the values of the counter variables (via \setcounter{topnumber}[8} and \setcounter{totalnumber}{10}) and (b) inserting a \clearpage instruction between the groups of figure and table environments? – Mico Jul 24 '17 at 5:10
  • Thanks for your help everyone. What I ended up doing was removing the [h!] from all but the first figure. That got the formatting exactly the way I wanted. – Jon Murphy Jul 25 '17 at 14:56
0
  • you provide not enough information that we be able to reproduce your problem with your MWE. See Mico comment above.
  • with use example-image fromgraphicx` package in your MWE I cant reproduce your problem. Images and tables are always in the same order as they are inserted in your document
  • off-topic: your table will looks nicer if you will use booktabs package for table horizontal rules and S column type from siunitx for aligning numbers at decimal points

    Considering aforementioned suggestion I change your MWE. See, if this is acceptable to you and if with its help you can construct MWE which will demonstrate your problem (for example, with defining example images' heights)

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{siunitx}            % added
\sisetup{input-symbols = {()},
         table-space-text-post=\sym{***},%
         table-align-text-post=false,
         }

\usepackage{booktabs}           % added
\usepackage[skip=1ex]{caption}  % added

\begin{document}
...

\appendix
\section*{Appendix A: Figures and Tables}
    \begin{figure}[htp]  % changed
\centering
\caption{Relationship Between GDP per Capita and Mean Tariff Rates}
\includegraphics[width=1\linewidth]{example-image-a}
\label{fig:gdpscatter}
    \end{figure}

    \begin{figure}[htp]  % changed
\centering
\caption[]{Low Income Countries Mean Tariff Rates}
\label{fig:lowinchist}
\includegraphics[width=1\linewidth]{example-image-b}
    \end{figure}

    \begin{figure}[htp]  % changed
\centering
\caption[]{High Income Countries Mean Tariff Rates}
\label{fig:upinchist}
\includegraphics[width=1\linewidth]{example-image-c}
    \end{figure}


    \begin{table}[htp]\centering  % changed
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Results\label{tab1}}
\begin{tabular}{l*{3}{S[table-format=1.4]}}  % changed
    \toprule
        &   \multicolumn{3}{c}{LN GDP Per Cap}                      \\
    \cmidrule(lr){2-4}
        &   {(1)}                   &   {(2)}           &  {(3)}    \\
    \midrule
Tariff  &   0.662\sym{***}  &   0.260\sym{***}  &   0.232\sym{***}  \\
        &   (0.0250)        &   (0.0234)        &   (0.0227)        \\
    \addlinespace
Propright   &               &    0.276\sym{***} &   0.182\sym{***}  \\
            &               &   (0.0179)        &   (0.0220)        \\
    \addlinespace
Govtcon     &               &   -0.162\sym{***} &    -0.135\sym{***}\\
            &               &   (0.0104)        &   (0.0101)        \\
    \addlinespace
Forex       &               &   0.0754\sym{***} &   0.0702\sym{***} \\
            &               &   (0.00611)       &   (0.00586)       \\
    \addlinespace
Moneygrowth &               &   0.0344\sym{*}   &   0.00939         \\
            &               &   (0.0145)        &   (0.0144)        \\
    \addlinespace
Bribes      &               &   0.120\sym{***}  &   0.269\sym{***}  \\
            &               &   (0.0177)        & (0.0228)          \\
    \addlinespace
Constant    &   2.999\sym{***}  &   4.368\sym{***}  &   4.010\sym{***}  \\
            &  (0.206)          &  (0.220)          &  (0.238)          \\
Fixed Effects   &   {No}    &   {No}            &   {Yes}           \\
    \midrule
Observations    &   {2033}  &   {1753}          &   {1753}          \\
    \bottomrule
    \multicolumn{4}{l}{\footnotesize Standard errors in parentheses}              \\
    \multicolumn{4}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}
\end{tabular}
    \end{table}

    \begin{table}[htp]\centering  % changed
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Results by Country Income Level\label{tab2}}
\begin{tabular}{l*{4}{S[table-format=-1.5]}}  % changed
    \toprule
        &   \multicolumn{4}{c}{LN GDP Per Cap}                                          \\
    \cmidrule(lr){2-5}
    \cmidrule(lr){2-4}
        &   {(1)}           &   {(2)}           &   {(3)}           &   {(4)}           \\
    \midrule
Tariff  &   0.110\sym{***}  &   0.0652\sym{**}  &   0.00176         &   -0.0184         \\
        &   (0.0299)        &   (0.0203)        &   (0.0180)        &   (0.0375)        \\
    \addlinespace
Propright
        &   0.0397          &   0.0297          &   0.0375          &   0.193\sym{***}  \\
        &   (0.0291)        &   (0.0229)        &   (0.0192)        &   (0.0232)        \\
    \addlinespace
Govtcon &   0.0237          &   0.00742         &  -0.0250\sym{*}   &   -0.0365\sym{***}\\
        &   (0.0155)        &   (0.0107)        &   (0.00980)       &   (0.00801)       \\
    \addlinespace
Forex   &   -0.00707        &   -0.000292       &   0.0203\sym{***} &  -0.0135          \\
        &   (0.00682)       &   (0.00502)       &   (0.00499)       &   (0.0109)        \\
    \addlinespace
Moneygrowth
        &   0.0184          &  -0.0248          &   -0.0221         &   0.0119          \\
        &   (0.0149)        &   (0.0135)        &   (0.0122)        &   (0.0199)        \\
    \addlinespace
Bribes  &   -0.0184         &   0.162\sym{***}  &   -0.00570        &   0.0747\sym{***} \\
        &   (0.0312)        &   (0.0244)        &   (0.0227)        &   (0.0208)        \\
    \addlinespace
Constant&   5.431\sym{***}  &   6.282\sym{***}  &   8.758\sym{***}  &   8.307\sym{***}  \\
        &  (0.323)          &   (0.240)         &   (0.201)         &   (0.367)         \\
    \midrule
Observations
        &   {297}           &   {457}           &   {416}           &   {583}           \\
    \bottomrule
    \multicolumn{5}{l}{\footnotesize Standard errors in parentheses}\\
    \multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
    \end{table}
\end{document}

Above MWE generate five pages long document. The first three contain images, last two tables.

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.