I wrote a loop to pull in a bunch of output files to create tikzpictures. Basically they are "time stamps" of output so I can see what is going on in my optimization model. If I don't try to put them in figures or subfigures, they generate just fine. The minute I try to use figures (individually) or subfigures (so, all time stamps for one facility are subfigures of one big figure) it doesn't work. It gets through the four subfigures then doesn't like the end figure.
My preamble has a LOT of packages in it and I realize that this COULD be some kind of incompatibility thing. But oddly enough, if I only input ONE .tex file in my main document, that works fine. So SOMETHING I am doing in this short file is causing the issue.
I think these are the main packages I use plus those "associated with" figures:
% Packages
\usepackage{graphicx,amsmath,epsf, amssymb, wasysym}
\usepackage{setspace}
\usepackage{color}
\usepackage{lineno}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{fancyvrb}
\usepackage{url}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{floatrow}
\usepackage{lipsum} %nonsense text for testing
\usepackage{adjustbox}
\usepackage[acronym,toc,nonumberlist]{glossaries}
\usepackage [english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage [autostyle, english = american]{csquotes}
\usepackage{enumitem}
\usepackage{relsize}
\usepackage{verbatim} % Allows for comment environment
\usepackage{standalone}
\usepackage[font=footnotesize]{subcaption}
Here is the file I am trying to compile. My REAL code calls other files via \input{}, but again, that doesn't seem to be the issue so to avoid having to explain the multiple custom nodes, I subbed four lines of the code from the input file instead.
\documentclass[crop=false]{standalone}
\usepackage{import}
\usepackage{preamble}
\newcommand{\MaxTP}{4}
\begin{document}
% No "figures" WORKS
\foreach \b in {{FA},{FB},{FC}}
{
\foreach \c in {1,2,...,\MaxTP}
{
\begin{tikzpicture} [font=\sffamily]
\node (t) [left=of f1] {From Tap/Tie-in};
\node (w) [below=of f3, yshift=-0.5cm]{To Injection Well(s)};
\node (s) [right=of f3] {To Pipeline};
\node (d) [above=of f1] {From Pipeline};
\end{tikzpicture}
}
}
% Add "figures"....does not work
\foreach \b in {{FA},{FB},{FC}}
{
\begin{figure}
\centering
\foreach \c in {1,2,...,\MaxTP}
{
\subcaptionbox {Time Period: \c}
{\begin{tikzpicture} [font=\sffamily]
\node (t) [left=of f1] {From Tap/Tie-in};
\node (w) [below=of f3, yshift=-0.5cm]{To Injection Well(s)};
\node (s) [right=of f3] {To Pipeline};
\node (d) [above=of f1] {From Pipeline};
\end{tikzpicture}
}
}
\caption{Facility: \b}
\end{figure}
}
\end{document}