表格:使用表格来分隔小页面中的图形

表格:使用表格来分隔小页面中的图形
\documentclass[demo]{article}
\usepackage{tabu}
\usepackage{tikz}
\usepackage{capt-of}
\usepackage{subfig}
\captionsetup[subfigure]{labelformat = parens}
%\usepackage[demo]{graphicx}                                                        
\begin{document}
\begin{minipage}{\linewidth}
  \centering
  \begin{tabular}{c@{\hspace{.5em}}c}
    \includegraphics[width = 2.5in]{something}
    \captionof{figure}[short]{figure 1}
    \label{one} &
    \begin{tikzpicture}
      \draw (0,0) -- (2,0);
    \end{tikzpicture}
    \captionof{figure}[short]{figure 2}
    \label{two}
  \end{tabular}
  \caption[short]{figures}
  \label{three}
\end{minipage}
\end{document}

我想将eps文件和TikZ图片并排放置,如subfiguresaa minipage,但无论我怎么尝试都行不通。我也尝试过包含图片TikZ\includestandalone但也失败了。我该怎么做?


贡萨洛·梅迪纳

有一个问题,如何避免字幕运行过度并且看起来很混乱?

在此处输入图片描述

答案1

你可以嵌套minipage

\documentclass[demo]{article}
\usepackage{tabu}
\usepackage{tikz}
\usepackage{capt-of}
\usepackage{subfig}
\captionsetup[subfigure]{labelformat = parens}

\begin{document}

\noindent\begin{minipage}{\linewidth}
  \hfill\begin{minipage}[b]{.45\linewidth}
  \centering
    \includegraphics[width = 2in]{something}
    \captionof{subfigure}[short]{A subfigure with a long caption spanning several lines}
    \label{one}
    \end{minipage}\hfill%
  \begin{minipage}[b]{.45\linewidth}
  \centering
    \begin{tikzpicture}
      \draw (0,0) -- (2,0);
    \end{tikzpicture}
    \captionof{subfigure}[short]{Another subfigure with a long caption spanning several lines}
    \label{two}
    \end{minipage}
  \captionof{figure}{A \LaTeX\ figure with two subfigures}
  \label{three}
\end{minipage}\hfill\null

\end{document}

在此处输入图片描述

相关内容