子图中的定位符号如何实现?

子图中的定位符号如何实现?

如何在排版子图时实现类似的定位符号?图中用红色框起来的符号“abcde”对应图片的位置,位于图片标题之前。我想知道如何在 LaTeX 中实现这个功能。

在此处输入图片描述

答案1

caption假设图形已完成并排列为“子图”(我将它们从已发布的图形中剪下来),则可以通过重新定义格式、插入彩色框来合并表示子图相对位置的红色框。

X

\documentclass[12pt,a4paper]{article}

\usepackage{graphicx}

\usepackage{subcaption}%  needed <<<<<<<<<<<<<<<<
\usepackage{xcolor}%  needed <<<<<<<<<<<<<<<<

\newcommand{\fsymbols}{\fcolorbox{red}{gray!20}{\parbox{50pt}{\centering \bfseries a b c \\ d e}}} %  colored box  <<<<<<<<<<<<<<<

\DeclareCaptionFormat*{myformat}{\fsymbols \\ \\#1#2\\#3}  % new format style for caption
\captionsetup[figure]{labelfont=sf, font=footnotesize, format=myformat, singlelinecheck=false}

\begin{document}    

\begin{figure}
    \begin{minipage}[b]{0.20\textwidth}
    \caption{(a) Image I,\\ (b) Square SE \\ (c) Dilatation of A by B. \\ (d) Elongated SE. \\ (e) Dilatation of A by ...}
    \end{minipage}%
\hfill
    \begin{minipage}[c]{0.75\textwidth}     
        \centering
        \begin{subfigure}[c]{0.3\textwidth}
            \centering
            \includegraphics[width=\textwidth, keepaspectratio]{image_a}        
        \end{subfigure}%
        \hfill
        \begin{subfigure}[c]{0.13\textwidth}
            \centering
            \includegraphics[width=\textwidth,keepaspectratio]{image_b}         
        \end{subfigure}% 
        \hfill
        \begin{subfigure}[c]{0.3\textwidth}
            \centering
            \includegraphics[width=\textwidth, keepaspectratio]{image_c}    
        \end{subfigure}%
        \vspace*{5pt}
        \begin{subfigure}[c]{0.3\textwidth}
            \centering
            \includegraphics[width=0.4\textwidth, keepaspectratio]{image_d} 
        \end{subfigure}%
        \vspace*{20pt}
        \hfill
        \begin{subfigure}[c]{0.3\textwidth}
            \centering
            \includegraphics[width=\textwidth, keepaspectratio]{image_e}        \
        \end{subfigure}%
        \vspace*{20pt}
    \end{minipage}
\end{figure}
    
\end{document}

相关内容