3

How can I achieve similar positioning symbols when typesetting sub-pictures? The symbol "abcde" framed in red in the picture corresponds to the position of the picture and is located before the caption of the picture. I want to know how to implement this function in LaTeX.

enter image description here

1
  • 1
    Please show us (in form of MWE /Minimal Working Example/, a small but complete document) what you try so far.
    – Zarko
    Apr 28, 2021 at 10:14

1 Answer 1

3

Assuming the figures were completed and arranged as 'subfigures' (I cut them out from the published figure), the red framed box indicating the relative positions of the subfigures can be incorporated by redefining the caption format, by inserting the colored box.

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .