\documentclass{article}
\usepackage{wrapfig}
\usepackage{xcolor}
\usepackage{lipsum}% dummy text only
\begin{document}
\lipsum[2]
\begingroup
\setlength{\intextsep}{0pt}
\setlength{\columnsep}{5pt}
\begin{wrapfigure}[15]{l}{6.5cm}
\begin{tabular}{@{}cc@{}}
\textcolor{blue}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{orange}{\rule{3cm}{3cm}} \\% Dummy image replacement
\textcolor{green}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{yellow}{\rule{3cm}{3cm}} \\% Dummy image replacement
\textcolor{red}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{brown}{\rule{3cm}{3cm}} \\% Dummy image replacement
\end{tabular}
\end{wrapfigure}
\lipsum[2-4]
\endgroup
\end{document}
如何创建一个标签放置在每个图形上、在整个图形下创建标题,并将所有图形和标题包装在一个框中,以便将其与浮动的正文分开?
谢谢
答案1
注释太长:附上包裹中的\begin{framed}
和,用于表格的,以及带有图像描述的额外表格行。\end{framed}
framed
\caption
\documentclass{article}
\usepackage{wrapfig}
\usepackage{xcolor}
\usepackage{lipsum}% dummy text only
\usepackage{framed}
\begin{document}
\lipsum[2]
\begingroup
\setlength{\intextsep}{0pt}
\setlength{\columnsep}{5pt}
\begin{wrapfigure}[30]{l}{7cm}
\begin{framed}
\begin{tabular}{@{}cc@{}}
\textcolor{blue}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{orange}{\rule{3cm}{3cm}} \\% Dummy image replacement
part A & part B\\
\textcolor{green}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{yellow}{\rule{3cm}{3cm}} \\% Dummy image replacement
part C & part D\\
\textcolor{red}{\rule{3cm}{3cm}} &% Dummy image replacement
\textcolor{brown}{\rule{3cm}{3cm}} \\% Dummy image replacement
part E & part F\\
\end{tabular}
\caption{general caption}
\end{framed}
\end{wrapfigure}
\lipsum[2-4]
\endgroup
\end{document}