장식을 사용할 때 마크에 라벨 삽입.markings

장식을 사용할 때 마크에 라벨 삽입.markings

다음 코드를 사용하여 각 마크에 라벨(또는 노드나 좌표)을 어떻게 삽입할 수 있습니까?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.markings}
\begin{document}
\begin{tikzpicture}
\def\gap{0.2}
\def\bigradius{3}
\def\littleradius{0.5}
%
\draw[cyan](0,0)coordinate(h) (-1*\bigradius,0) -- (1*\bigradius,0) (0,-1*\bigradius) -- (0,1*\bigradius);
%
\draw[color=blue, line width=2pt, decoration={markings,
mark=at position 0.2455 with {\arrow[color=red]{stealth}},
mark=at position 0.765 with {\arrow[color=green]{stealth}},
mark=at position 0.87 with {\arrow[color=brown]{stealth}},
mark=at position 0.97 with {\arrow[color=orange]{stealth}}},
postaction={decorate}, preaction={fill=yellow!60, fill opacity=.4}]
let
 \n1={asin(\gap/2/\bigradius)},
 \n2={asin(\gap/2/\littleradius)}
in (\n1:\bigradius) arc (\n1:360-\n1:\bigradius) -- (-\n2:\littleradius) arc (-\n2:-360+\n2:\littleradius) -- cycle;
%
\node[red] at (h) {H};
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

답변1

화살표를 그릴 때 간단히 노드를 추가할 수 있습니다. 여기서 좌표는 (-.3,.3)마크 좌표를 기준으로 한 로컬 좌표입니다.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.markings}
\begin{document}
\begin{tikzpicture}
\def\gap{0.2}
\def\bigradius{3}
\def\littleradius{0.5}
%
\draw[cyan](0,0)coordinate(h) (-1*\bigradius,0) -- (1*\bigradius,0) (0,-1*\bigradius) -- (0,1*\bigradius);
%
\draw[color=blue, line width=2pt, decoration={markings,
mark=at position 0.2455 with {\arrow[color=red]{stealth} \node[color=red] at (-.3,.3) {$a$};},
mark=at position 0.765 with {\arrow[color=green]{stealth} \node[color=green] at (-.3,.3) {$b$};},
mark=at position 0.87 with {\arrow[color=brown]{stealth} \node[color=brown] at (-.3,.3) {$c$};},
mark=at position 0.97 with {\arrow[color=orange]{stealth} \node[color=orange] at (-.3,.3) {$d$};},
},
postaction={decorate}, preaction={fill=yellow!60, fill opacity=.4}]
let
 \n1={asin(\gap/2/\bigradius)},
 \n2={asin(\gap/2/\littleradius)}
in (\n1:\bigradius) arc (\n1:360-\n1:\bigradius) -- (-\n2:\littleradius) arc (-\n2:-360+\n2:\littleradius) -- cycle;
%
\node[red] at (h) {H};
\end{tikzpicture}
\end{document}

답변2

표시에 노드를 추가하면 됩니다. 이 코드는 구부러진 화살표를 사용합니다.https://tex.stackexchange.com/a/676562/292811, 더 예뻐 보일 수 있습니다.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending,calc, decorations.markings,hobby}
\begin{document}
\begin{tikzpicture}[>={Stealth[length=0.3cm,bend]},
    % stolen from https://tex.stackexchange.com/a/676562/292811
    colored bent arrow at/.style args={#1/#2/#3}{decoration={markings,
        mark=at position {#1*\pgfdecoratedpathlength-0.15cm} with {\coordinate (bent arrow 1);},
        mark=at position {#1*\pgfdecoratedpathlength-0.05cm} with {\coordinate (bent arrow 2);},
        mark=at position {#1*\pgfdecoratedpathlength} with {#3},
        mark=at position {#1*\pgfdecoratedpathlength+0.05cm} with {\coordinate (bent arrow 3);},
        mark=at position {#1*\pgfdecoratedpathlength+0.15cm} with {\coordinate (bent arrow 4);
        \draw[style/.expand once=#2,-{Stealth[length=0.3cm,bend]}] (bent arrow 1) to[curve through={(bent arrow 2) .. (bent arrow 3)}]  (bent arrow 4) ;}
    }}]
\def\gap{0.2}
\def\bigradius{3}
\def\littleradius{0.5}
%
\draw[cyan](0,0)coordinate(h) (-1*\bigradius,0) -- (1*\bigradius,0) (0,-1*\bigradius) -- (0,1*\bigradius);
%
\draw[color=blue, line width=2pt,
    colored bent arrow at/.list={0.2455/red/{\node[above left,red]{$a$};},
        0.765/green/{\node[below,green]{$b$};},
        0.87/brown/{\node[above,brown]{$c$};},
        0.97/orange/{\node[above,orange]{$a$};}},
    %decoration={markings,
        % mark=at position 0.2455 with {\arrow[color=red]{stealth}},
        % mark=at position 0.765 with {\arrow[color=green]{stealth}},
        % mark=at position 0.87 with {\arrow[color=brown]{stealth}},
        % mark=at position 0.97 with {\arrow[color=orange]{stealth}}},
    postaction={decorate}, preaction={fill=yellow!60, fill opacity=.4}]
let
 \n1={asin(\gap/2/\bigradius)},
 \n2={asin(\gap/2/\littleradius)}
in (\n1:\bigradius) arc (\n1:360-\n1:\bigradius) -- (-\n2:\littleradius) arc (-\n2:-360+\n2:\littleradius) -- cycle;
%
\node[red] at (h) {H};
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보