如何生成带有单独标题的多列图形

如何生成带有单独标题的多列图形

除标题内容外,我该如何创建与第一个文档/图像完全相同的内容,但侧面标签显示每个项目的数量(第二张图片)?我考虑过使用子浮点方法或表格方法,但这不是我想要的。我正在使用修改后的svmono类。谢谢。

在此处输入图片描述

在此处输入图片描述

以下是我的尝试。结果并非我想要的那样。

\documentclass{article} 

\usepackage{tabularx} 
\usepackage{graphicx} 
\graphicspath{{Figures/}}
\usepackage[export]{adjustbox}
\usepackage[labelfont=bf,sf,font=small]{caption}
\captionsetup[figure]{labelformat=empty,font={sf,bf},skip=1pt}

\begin{document} 
\begin{tabularx}{\textwidth}{*{4}{X}} 
\begin{center}
\captionof{figure}{Beaker}
\includegraphics[width=2cm,height=2.75cm,valign=t]{Beaker.png}
\end{center} & \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \underline{\hspace{1cm}}\\ 
            30 mL & \underline{\hspace{1cm}}\\ 
            \end{tabular} 
& \begin{center}
\captionof{figure}{Erlenmeyer Flask}
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
\end{center} & \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \underline{\hspace{1cm}}\\ 
            30 mL & \underline{\hspace{1cm}}\\ 
            \end{tabular}\\ 
\end{tabularx} 

\end{document}

答案1

以下可能接近所需的布局。为了避免扭曲图像,我建议使用widthheight选项,而不是将两者结合起来。

在此处输入图片描述

\documentclass{article} 
\usepackage{geometry}
\usepackage{tabularx} 
\usepackage[demo]{graphicx} 
\usepackage[export]{adjustbox}


\newcommand{\mytitle}[1]{\multicolumn{2}{@{}l}{\bfseries\sffamily #1}}
\newcommand{\myline}{\underline{\hspace{1.25cm}}}
\begin{document} 
\noindent
\setlength{\tabcolsep}{2.5pt}
\begin{tabularx}{\textwidth}{*{3}{@{}cX}} 
\mytitle{Beaker} & \mytitle{Erlenmeyer Flask} & \mytitle{Other glassware}\\
\includegraphics[width=2cm,height=2.75cm,valign=t]{Beaker.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular} 
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}\\ 
\mytitle{Beaker} & \mytitle{Erlenmeyer Flask} & \mytitle{Other glassware}\\
\includegraphics[width=2cm,height=2.75cm,valign=t]{Beaker.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular} 
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}\\ 
\mytitle{Beaker} & \mytitle{Erlenmeyer Flask} & \mytitle{Other glassware}\\
\includegraphics[width=2cm,height=2.75cm,valign=t]{Beaker.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular} 
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}\\ 
\mytitle{Beaker} & \mytitle{Erlenmeyer Flask} & \mytitle{Other glassware}\\
\includegraphics[width=2cm,height=2.75cm,valign=t]{Beaker.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular} 
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}
& 
\includegraphics[width=2cm,height=2.75cm,valign=t]{Erlenmeyer.png}
 & 
      \begin{tabular}[t]{@{}rl@{}} 
            30 mL & \myline\\ 
            30 mL & \myline\\ 
            \end{tabular}\\ 
\end{tabularx} 

\end{document}

答案2

对于图像放置在光栅中的简单情况:

\documentclass{article}
\usepackage{booktabs, tabularx}
\usepackage[export]{adjustbox}
\usepackage{caption, subfig}
    \captionsetup[table]{font=small, skip=1ex}

\newcommand\sfdata[1]{\begin{tabular}[t]{rl<{\underline{\hspace{15mm}}}@{}}
                        #1
                      \end{tabular} 
                      }

\begin{document}
    \begin{table}
    \captionsetup[subfloat]{labelformat=empty,font={small,sf,bf},skip=0pt}
    \setkeys{Gin}{width=0.45\linewidth}
\caption*{General Chemistry Lab Glass List}
\begin{tabularx}{\textwidth}{@{} X X @{}}
    \toprule
\subfloat[image 1 title]
{
\includegraphics[valign=t]{example-image-duck}%
\sfdata{
    30 mL   &   \\
    30 mL   &   }
}
    &   \subfloat[image 2 title]
        {
        \includegraphics[valign=t]{example-image-duck}%
        \sfdata{
            25 mL   &   \\
            25 mL   &   }
        }       \\
\subfloat[image 3 title]
{
\includegraphics[valign=t]{example-image-duck}%
\sfdata{
    100 mL   &   \\
    100 mL   &   }
}
    &   \subfloat[image 4 title]
        {
        \includegraphics[valign=t]{example-image-duck}%
        \sfdata{
            50 mL   &   \\
            50 mL   &   }
        }       \\        
\end{tabularx}
    \end{table}
\end{document}

在此处输入图片描述

相关内容