I would like my 'figure' environments to be exported tightly cropped. If I use this:
\usepackage[floats,active,tightpage]{preview}
the caption is included. If I use this (of course, with real \includegraphics commands instead of these filler boxes):
\usepackage[graphics,active,tightpage]{preview}
each subfigure is exported separately so I lose the arrangement/connection of the subfigures.
1) Is there a way to get this float composed of subfig's to be tightly cropped excluding the caption?
2) Is there a way to get it to crop the figures horizontally as well? The vertical cropping seems to work (if I omit the caption command), but the output is always the pagewidth.
\documentclass[10pt]{article}
\usepackage[floats,active,tightpage]{preview}
\usepackage{graphicx}
\usepackage[caption=false,format=hang]{subfig}
\begin{document}
\def\FigSize{.23}
\begin{figure}[htbp!]
\subfloat[]
{
\fbox{\rule{0pt}{2in} \rule{\FigSize \linewidth}{0pt}}
}
\subfloat[]
{
\fbox{\rule{0pt}{2in} \rule{\FigSize \linewidth}{0pt}}
}
\caption{Test Caption}
\end{figure}
\end{document}
I tried putting the subfigures in a minipage, but it seems to put A directly ontop of B? And it still has not cropped the result horizontally?
\documentclass[preview]{standalone}
\usepackage{mwe}
\usepackage{subcaption}
\begin{document}
\def\FigSize{.33}
\begin{figure}
\begin{minipage}{2\FigSize \linewidth}
\begin{subfigure}[b]{\FigSize \textwidth}
\centering
\includegraphics[width=\FigSize \textwidth]{example-image-a}
\phantomcaption
\end{subfigure}
\begin{subfigure}[b]{\FigSize \textwidth}
\centering
\includegraphics[width=\FigSize \textwidth]{example-image-b}
\phantomcaption
\end{subfigure}
\end{minipage}
\end{figure}
\end{document}

preview+varwidthoptions ofstandalonepackage to crop the page horizontally: https://tex.stackexchange.com/a/622883/222496. – anton_rh Nov 17 '21 at 16:52