endfloat package is re-ordering my subsections

Christopher W. Ryan cryan at binghamton.edu
Thu Apr 23 16:56:30 CEST 2020


Using TexLive on Windows. I'd like to use endfloat. The latex source
file is generated by Sweave from R.  Here is a MWE, modified from the
Sweave-created one.  If you toggle using the endfloat package, hopefully
you will see my problematic results.

Any suggestions?

Thanks.

--Chris Ryan
SUNY Upstate Medical University Binghamton Clinical Campus


\documentclass{article}
\usepackage{Sweave}
\usepackage[margin = 1in]{geometry}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{draftwatermark}
\usepackage[iso]{datetime}
%% \usepackage[nolists, nomarkers]{endfloat}
\usepackage{blindtext}

\author{Christopher W. Ryan, MD, MS, MSPH, PStat}
\title{some dogs}
\date{\today \space \currenttime}

\begin{document}

\maketitle

%latex.default(symptom.table, file = "", rowname = NULL, colheads =
c("Symptom",     "Percent of cases"), caption = "some dogs were sick.",
   label = "symptomtable", where = "p")%
\begin{table}[p]
\caption{hope the dogs get better.\label{symptomtable}}
\begin{center}
\begin{tabular}{lr}
\hline\hline
\multicolumn{1}{c}{Symptom}&\multicolumn{1}{c}{Percent of
cases}\tabularnewline
\hline
foo &$58.8$\tabularnewline
bar &$58.8$\tabularnewline
\hline
\end{tabular}\end{center}
\end{table}


\section{Brief summary}



\section{Background and Methods}
\label{bam}

\blindtext

\section{Detailed results}

\blindtext

\subsection{this should be subsection 3.1}

\blindtext

%latex.default(labtable, file = "", rowname = NULL, rowlabel = FALSE,
 col.heads = c("Lab", "Number of results", "Percent of all results"),
 caption = "We sent some "lab" tests! Labs used fewer than 10 times are
omitted.",     label = "LabTable", where = "hp")%
\begin{table}[hp]
\caption{foo\label{LabTable}}
\begin{center}
\begin{tabular}{lrl}
\hline\hline
\multicolumn{1}{c}{lab}&\multicolumn{1}{c}{n}&\multicolumn{1}{c}{percent}\tabularnewline
\hline
A &$785$&49\%\tabularnewline
B &$589$&37\%\tabularnewline
\hline
\end{tabular}\end{center}
\end{table}

\begin{figure}\centering
  \includegraphics{dog}
  \caption{here is a dog}\label{LabResultSummary}
  \end{figure}




\begin{figure}\centering
  \includegraphics{anotherdog}
  \caption{here is another dog }\label{TurnAroundGraph}
  \end{figure}
%   \end{figure}

\subsection{this should be subsection 3.2}
\blindtext

\begin{figure}\centering
\includegraphics{dog}
\caption{first dog again}\label{epicurve}
\end{figure}

\begin{figure}\centering
\includegraphics{anotherdog}
\caption{second dog again--the cute one}\label{onsettotestlag}
\end{figure}


\subsection{this should be subsection 3.3}

\blindtext

\begin{figure}\centering
\includegraphics{dog}
\caption{first dog again. He's cute too.}\label{ems}
\end{figure}

\end{document}


More information about the texhax mailing list.