在 Latex 中使用“插入框”命令时如何添加带有连续编号的标题?

问题描述

我在 Latex 中使用 InsertBoxL 命令生成了 3 个连续的图像,一个在另一个之下,每个图像旁边都有文字。有没有办法使用上面的命令在 Latex 中插入带有连续编号的标题

我目前使用的 Latex 是:

\documentclass[11pt]{article}
\input{insBox}

\begin{document}

 \InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here 
 \bigskip
 \InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here
 \bigskip
 \InsertBoxL{0}{\rule{1.6in}{0.9in}} %text inserted here

\end{document}

我已经用 \rule 命令替换了我的实际图像。

任何帮助将不胜感激!

解决方法

要为您的框添加标题,您可以使用 \captionof 包中的 caption 宏:

\documentclass[11pt]{article}
\input{insbox}
\usepackage{caption}

\begin{document}

 \InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}
 \bigskip
 \InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}
 \bigskip
 \InsertBoxL{0}{\rule{1.6in}{0.9in}} \captionof{figure}{some text}

\end{document}

然而,与这些奇怪的盒子东西不同,迷你页面可能更容易:

\documentclass[11pt]{article}

\usepackage{graphicx}
\usepackage{caption}
\captionsetup{singlelinecheck=false}

\begin{document}

\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\linewidth-1.6in}
\captionof{figure}{some text}
\end{minipage}%

\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\textwidth-1.6in}
\captionof{figure}{some tefffffxt}
\end{minipage}%

\noindent\begin{minipage}[b]{1.6in}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}%
\begin{minipage}[b]{\dimexpr\textwidth-1.6in}
\captionof{figure}{some text}
\end{minipage}%

\end{document}

enter image description here

除了图片之外,还有现成的字幕包:

\documentclass[11pt]{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{sidecap}

\begin{document}

\begin{SCfigure}
  \includegraphics[width=.3\textwidth]{example-image-duck}
  \caption{heading}
\end{SCfigure}
\begin{SCfigure}
  \includegraphics[width=.3\textwidth]{example-image-duck}
  \caption{heading}
\end{SCfigure}
\begin{SCfigure}
  \includegraphics[width=.3\textwidth]{example-image-duck}
  \caption{heading}
\end{SCfigure}

\end{document}