我想创建具有多行的子图,并激活预览模式。将子图并排放置效果很好:
\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{pagecolor}
\usepackage[active,tightpage,floats]{preview}
\begin{document}
\pagecolor{yellow!30!orange}
\begin{figure}%
\begin{subfigure}[b]{0.25\textwidth}
\centering
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 1};
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{0.25\textwidth}
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 2};
\end{tikzpicture}
\end{subfigure}
\end{figure}
\end{document}
但是,当插入任何类型的换行符以换入下一行时,它会在右侧创建一个空格:
\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{pagecolor}
\usepackage[active,tightpage,floats]{preview}
\begin{document}
\pagecolor{yellow!30!orange}
\begin{figure}%
\begin{subfigure}[b]{0.25\textwidth}
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 1};
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{0.25\textwidth}
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 2};
\end{tikzpicture}
\end{subfigure}
\vskip\baselineskip %<-- LINE BREAK
\begin{subfigure}[b]{0.25\textwidth}
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 3};
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{0.25\textwidth}
\begin{tikzpicture}
\node[fill=red, inner sep=1cm]{Node 4};
\end{tikzpicture}
\end{subfigure}
\end{figure}
\end{document}
预览模式似乎通常不接受任何形式的换行符。但也许有人有解决方案或破解方法?真的能帮到我!