如何在图形旁边添加符号?

如何在图形旁边添加符号?

我想用标志来装饰人物的侧面。

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{graphicx}
\begin{document}
    \begin{figure}[H]
        \centering
        \includegraphics[width=0.75\textwidth]{example-image}
        \caption{Smiley}
        \label{fig:smiley}
    \end{figure}
\end{document}

我怎样才能做到这一点?

答案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>

在此处输入图片描述

相关内容