16

以下を作成したいと思います。

      a       b
    xxxxx   xxxxx
 1  xxxxx   xxxxx
    xxxxx   xxxxx

    xxxxx   xxxxx
 2  xxxxx   xxxxx
    xxxxx   xxxxx

ここで、「x」のブロックは画像​​であり、「a」、「b」、「1」、および「2」はテキストです。

これまでの私の2つの試みは次のとおりです。

\begin{figure}
\begin{center}
\begin{tabular}{ccc}
 & a & b \\
1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} &
    \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\
2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} &
    \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\
\end{tabular}
\end{center}
\end{figure}

生成するもの:

      a       b
    xxxxx   xxxxx
    xxxxx   xxxxx
 1  xxxxx   xxxxx

    xxxxx   xxxxx
    xxxxx   xxxxx
 2  xxxxx   xxxxx

\begin{figure}
\begin{center}
\begin{tabular}{m{1cm}m{6cm}m{6cm}}
 & a & b \\
1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} &
    \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\
2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} &
    \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\
\end{tabular}
\end{center}
\end{figure}

生成するもの:

    a       b
    xxxxx   xxxxx
 1  xxxxx   xxxxx
    xxxxx   xxxxx

    xxxxx   xxxxx
 2  xxxxx   xxxxx
    xxxxx   xxxxx
4

2 に答える 2

15

新しい列タイプを作成することも、2つの画像列の>{\centering\arraybackslash}前に追加することもできます。m{6cm}

例えば:

\newcolumntype{C}{>{\centering\arraybackslash} m{6cm} }  %# New column type
\begin{tabular}{m{1cm}CC}                                %# Table with two of them
...

>ディレクティブを使用すると、基本的に、その列の各エントリの前に含まれているコードを挿入できます。私たちは、環境と環境の\arraybackslash間の非互換性に対処する必要があります。[詳細はこちらをご覧ください。] 1centeringtabular

于 2010-05-10T13:21:43.437 に答える
4

\dummyimage私は持っていないので、を使用しますim.png。に置き換えます\includegraphics{im.png}

\font\dummyfont = cmr10 at 100pt
\def\dummyimage{{\vbox to 100pt{\vfil\hbox to 100pt{\hfil\dummyfont A\hfil}\vfil}}}

\hfil\vbox{
\halign{&\hfil\ $\vcenter{\hbox{#}}$\strut \ \hfil\cr
&a&b\cr 
1&\dummyimage&\dummyimage\cr
2&\dummyimage&\dummyimage\cr
}}
于 2010-05-05T10:35:15.273 に答える