![如何在 Latex 中的文档类“cas-dc”中的每个并排子图上添加箭头?](https://linux22.com/image/425676/%E5%A6%82%E4%BD%95%E5%9C%A8%20Latex%20%E4%B8%AD%E7%9A%84%E6%96%87%E6%A1%A3%E7%B1%BB%E2%80%9Ccas-dc%E2%80%9D%E4%B8%AD%E7%9A%84%E6%AF%8F%E4%B8%AA%E5%B9%B6%E6%8E%92%E5%AD%90%E5%9B%BE%E4%B8%8A%E6%B7%BB%E5%8A%A0%E7%AE%AD%E5%A4%B4%EF%BC%9F.png)
我想用箭头指向每个子图像中的特定对象(例如以下示例)。我也看到了一些建议,例如关联。我该如何在以下文档中执行此操作?
\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) 选项决定。