如何在 Latex 中的文档类“cas-dc”中的每个并排子图上添加箭头?

如何在 Latex 中的文档类“cas-dc”中的每个并排子图上添加箭头?

我想用箭头指向每个子图像中的特定对象(例如以下示例)。我也看到了一些建议,例如关联。我该如何在以下文档中执行此操作?

例子: 在此处输入图片描述

\documentclass[a4paper,fleqn]{cas-dc}
\usepackage{lipsum,capt-of,graphicx}
\usepackage{geometry}% Just for this example
\usepackage{natbib}
%\usepackage[wby]{callouts}
%\usepackage{cite}
\usepackage{ragged2e}
\usepackage{setspace}
\usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption}
\captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off}
\captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}
\usepackage{subcaption}

\usepackage{etoolbox}
\AtBeginEnvironment{table}{\sffamily}
\usepackage{booktabs,siunitx, multirow}
\sisetup{table-format=1.4, tight-spacing=true, separate-uncertainty}

\sisetup{
    output-exponent-marker = \text{e},
    exponent-product={},
    retain-explicit-plus,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-pre    = false,
    table-align-text-post = false,
    round-mode=places,
    round-precision=2,
    table-space-text-pre    = (,
    table-space-text-post   = ),
}

\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{floatrow}
\floatsetup[table]{style=Plaintop, captionskip=0pt, capposition=top}

\let\sum\relax % To change the style of summation symbol
\DeclareSymbolFont{otherlargesymbols}{OMX}{cmex}{m}{n}
\DeclareMathSymbol{\sum}{\mathop}{otherlargesymbols}{"50}

\setlength{\mathindent}{0pt}

\makeatletter
\@dblfpsep=20pt
\makeatother

\usepackage{array, cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}

\begin{document}\sloppy
\begin{figure*}[htbp]
%\begin{annotate}
\centering
\subcaptionbox{\label{sfig:a}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
%\arrow{-3,-2.4}{-4.5,-3}
\subcaptionbox{\label{sfig:b}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:c}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:d}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:e}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:f}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\\
\subcaptionbox{\label{sfig:g}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:h}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:i}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:j}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:k}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\hfill
\subcaptionbox{\label{sfig:l}}{\includegraphics[width=.12\linewidth,height=1.9cm]{example-image-a.png}}\\
\caption{bbbbb.}
\label{fig1:MalBen}
%\end{annotate}
\end{figure*}

\end{document} 

答案1

它可以作为起点:

\documentclass{cas-dc}
\usepackage{natbib}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}
    \begin{figure*}
    \tikzset{every node/.style = {inner sep=0pt},
             every path/.style = {-{Triangle[scale=0.8]}, ultra thick, red},
                 s/.style args = {#1/#2}{shift={(#1mm,#2mm)}} 
            }
    \setkeys{Gin}{width=.14\linewidth,height=20mm}
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-2/4] n1.east) -- ([s=-8/-2] n1.east);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-2/8] n1.east) -- ([s=-8/3] n1.east);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-3/6] n1.east) -- ([s=-8/2] n1.east);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-4/8] n1.east) -- ([s=-8/-1] n1.east);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-1/3] n1.east) -- ([s=-8/-1] n1.east);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=-1/3] n1.east) -- ([s=-8/-1] n1.east);
      }  

\medskip
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=2/-4] n1.west) -- ([s=8/-2] n1.west);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=2/-8] n1.west) -- ([s=8/-3] n1.west);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=3/-6] n1.west) -- ([s=8/-2] n1.west);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=4/-8] n1.west) -- ([s=8/-1] n1.west);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=1/-3] n1.west) -- ([s=8/-1] n1.west);
      }      \hfill
\tikz{\node (n1) {\includegraphics{example-image-a.png}};
      \draw ([s=1/-3] n1.west) -- ([s=8/-1] n1.west);
      } 
\caption{bbbbb.}
\label{fig1:MalBen}
    \end{figure*}
\end{document}

在此处输入图片描述

确定箭头的准确位置留给你了。你需要选择箭头的起始和终止坐标。由s(shift) 选项决定。

相关内容