答案1
像这样?
(红线表示文本区域边框)
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{positioning}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[
node distance = 2mm and 8mm,
N/.style = {draw, semithick, minimum size=7mm}
]
\node (n0) [inner sep=0pt] {\includegraphics[width=0.75\textwidth]{example-image-duck}};
\node (n1) [N, below left = of n0.north west] {};
\node (n2) [N, left = of n0.west] {};
\node (n3) [N, above left = of n0.south west] {};
\end{tikzpicture}
\caption{Duck. Quack, quack!}
\label{fig:duck}
\end{figure}
See figure \ref{fig:duck}
\end{document}
附录: 您可以相对于彼此定位的小节点:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{positioning}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[
node distance = 2mm and 8mm, % you can changedistances according to your wish
N/.style = {draw, semithick, minimum size=7mm}
]
\node (n0) [inner sep=0pt] {\includegraphics[width=0.75\textwidth]{example-image-duck}};
\node (n1) [N, left = of n0.west] {};
\node (n2) [N, above = of n1] {};
\node (n3) [N, below = of n1] {};
\end{tikzpicture}
\caption{Duck. Quack, quack!}
\label{fig:duck}
\end{figure}
See figure \ref{fig:duck} \dots
\end{document}
它们之间的垂直距离定义为node distance = <vertical distance> and <horizontal distance>
。您可以根据需要更改<vertical distance>
(和)。<horizontal distance>