在「TikZ」圖中繪製「(A點)到[向右彎曲=30](B點)」的一致性

在「TikZ」圖中繪製「(A點)到[向右彎曲=30](B點)」的一致性

在下TikZ圖中,我描繪了一個擴展圖 - 一系列簡單圖。命令類似於

\draw[-latex] (Point A) to[bend right=30] (Point B)

表示某一步的擴充。當(Point A)位於正上方時,這看起來不錯(Point B)- 箭頭將進入包含分數的節點的西北角。這些箭頭中的第三個也是最後一個箭頭終止於(Point B)a 東南方的 a (Point A)。 ((Point B)在本例中, 包含以綠色排版的分數1/1。它是一個臨時節點,排版是為了說明我的擔憂。)在本例中,箭頭看起來像是進入節點的西邊緣。如何修改最後一個箭頭,使箭頭進入節點的東北角?

\documentclass{amsart}
\usepackage{amssymb}
\usepackage{mathtools,array}

\usepackage{tikz}
\usetikzlibrary{calc,intersections}

\begin{document}


\begin{tikzpicture}[nodes={inner sep=0, font=\scriptsize,
execute at begin node={\setlength\abovedisplayskip{0.75ex}%
\setlength\belowdisplayskip{0.5ex}%
\setlength\abovedisplayshortskip{0.75ex}%
\setlength\belowdisplayshortskip{0.5ex}}},
shorten/.style={shorten >=#1,shorten <=#1}]

%A sequence of graphs is drawn, starting with the vertex with the b-label b.


%Here is the blow-up of the vertex labeled b.
\draw[fill] (-4,0) circle (1.5pt);
\node[anchor=north] (label_for_Vertex_b) at ($(-4,0) +(0,-0.25)$){\textit{b}};
\node[anchor=south] at ($(-4,0) +(0,0.25)$){$\dfrac{0}{1}$};
%
%
\draw (-4,-3) -- (-2,-3);
\draw[fill] (-4,-3) circle (1.5pt);
\draw[fill] (-2,-3) circle (1.5pt);
%
\node[anchor=north] at ($(-4,-3) +(0,-0.25)$){\textit{b}};
\node[anchor=south] (label_for_Farey_Fraction_at_Vertex_b) at ($(-4,-3) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] (label_for_Vertex_b-1) at ($(-2,-3) +(0,-0.25)$){$b - 1$};
\node[anchor=south] at ($(-2,-3) +(0,0.25)$){$\dfrac{1}{1}$};
%
%
%An arrow is drawn to the next diagram.
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b) to[bend right=30] node[midway, left=1.5mm, align=center]
{Blow-up of\\vertex \textit{b}} (label_for_Farey_Fraction_at_Vertex_b);


%Here is the blow-up of the vertex labeled b-1.
\draw (-4,-6) -- (-2,-6) -- (0,-6);
\draw[fill] (-4,-6) circle (1.5pt);
\draw[fill] (-2,-6) circle (1.5pt);
\draw[fill] (0,-6) circle (1.5pt);
%
\node[anchor=north] at ($(-4,-6) +(0,-0.25)$){\textit{b}};
\node[anchor=south] at ($(-4,-6) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,-6) +(0,-0.25)$){$b-1$};
\node[anchor=south] (label_for_Farey_Fraction_at_Vertex_b-1) at ($(-2,-6) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(0,-6) +(0,-0.25)$){$b-2$};
\node[anchor=south] at ($(0,-6) +(0,0.25)$){$\dfrac{2}{1}$};
%
%
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b-1) to[bend right=30] node[midway, left=1.5mm, align=center]
{Blow-up of\\vertex $b - 1$} (label_for_Farey_Fraction_at_Vertex_b-1);


%Here is the blow-up of the vertex labeled b-n.
\draw (-4,-9) -- (-2,-9) -- (0,-9) (2,-9) -- (5,-9);
\draw[fill] (-4,-9) circle (1.5pt);
\draw[fill] (-2,-9) circle (1.5pt);
\draw[fill] (0,-9) circle (1.5pt);
\node at (1,-9){$\ldots$};
\draw[fill] (2,-9) circle (1.5pt);
\draw[fill] (5,-9) circle (1.5pt);
%
\node[anchor=north] at ($(-4,-9) +(0,-0.25)$){\textit{b}};
\node[anchor=south] at ($(-4,-9) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,-9) +(0,-0.25)$){$b-1$};
\node[anchor=south] at ($(-2,-9) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(0,-9) +(0,-0.25)$){$b-2$};
\node[anchor=south] at ($(0,-9) +(0,0.25)$){$\dfrac{2}{1}$};
%
\node[anchor=south, green] (label_for_phantom_Farey_Fraction_at_ellipses) at ($(1,-9) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(2,-9) +(0,-0.25)$){\textit{b-n}};
\node[anchor=south] at ($(2,-9) +(0,0.25)$){$\dfrac{n}{1}$};
%
\node[anchor=north] at ($(5,-9) +(0,-0.25)$){$b-(n+1)$};
\node[anchor=south] at ($(5,-9) +(0,0.25)$){$\dfrac{n+1}{1}$};
%
%
%
%
\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b-2) to[bend right=30] node[midway, left=1.5mm, align=center]
{Blow-up of\\more vertices} (label_for_phantom_Farey_Fraction_at_ellipses);
%
%
%A "pin" is drawn between the midpoint of last two vertices and the label of the mediants of these vertices.
\draw[-latex, dashed, line width=0.8pt, shorten <=3mm, shorten >=1mm] ($(3.5,-9) +(60:2)$) -- (3.5,-9);
\path node[anchor=south, align=center, text width={width("future vertex")}]
at ($(3.5,-9) +(60:2)$){future mediant\\for vertex\[\dfrac{2n+1}{2}\]};
%
%A "pin" is drawn between the midpoint of the edge between the last two vertices and its label.
\coordinate (label_for_Edge) at ($(3.5,-9.5) +(0,-0.75)$);
\draw[draw=gray, line width=0.8pt, shorten <=1mm, shorten >=1mm] (3.5,-9) -- (label_for_Edge);
\node[anchor=north, align=center, inner sep=0, font=\scriptsize] at (label_for_Edge)
{$\begin{aligned} &\text{Present edge label of} \\[-1.5ex]
&\quad 2\bigl[(b-n)+(b-(n+1))\bigr] \\[-1.5ex]
&\qquad=2^{2}b-(2n+1)2
\end{aligned}$};



\draw[-latex, line width=0.8pt, shorten=7.5pt] (label_for_Vertex_b-1) to[bend right=30] node[midway, left=1.5mm, align=center]
{Blow-up of\\vertex $b - 1$} (label_for_Farey_Fraction_at_Vertex_b-1);


\draw[-latex, line width=0.8pt, shorten <=30pt, shorten >=7.5pt] (label_for_Edge.south) -- ($(label_for_Edge.south) +(0,-4)$);

%Here is the vertex placed at the broken edge.
\draw (-4,-15) -- (-2,-15) -- (0,-15) (2,-15) -- (5,-15);
\draw[fill] (-4,-15) circle (1.5pt);
\draw[fill] (-2,-15) circle (1.5pt);
\draw[fill] (0,-15) circle (1.5pt);
\node at (1,-15){$\ldots$};
\draw[fill] (2,-15) circle (1.5pt);
\draw[fill] ({(2+5)/2},-15) circle (1.5pt);
\draw[fill] (5,-15) circle (1.5pt);
%
\node[anchor=north] at ($(-4,-15) +(0,-0.25)$){\textit{b}};
\node[anchor=south] at ($(-4,-15) +(0,0.25)$){$\dfrac{0}{1}$};
%
\node[anchor=north] at ($(-2,-15) +(0,-0.25)$){$b-1$};
\node[anchor=south] at ($(-2,-15) +(0,0.25)$){$\dfrac{1}{1}$};
%
\node[anchor=north] at ($(0,-15) +(0,-0.25)$){$b-2$};
\node[anchor=south] at ($(0,-15) +(0,0.25)$){$\dfrac{2}{1}$};
%
\node[anchor=north] at ($(2,-15) +(0,-0.25)$){\textit{b-n}};
\node[anchor=south] at ($(2,-15) +(0,0.25)$){$\dfrac{n}{1}$};
%
\node[anchor=north] at ($(5,-15) +(0,-0.25)$){$b-(n+1)$};
\node[anchor=south] at ($(5,-15) +(0,0.25)$){$\dfrac{n+1}{1}$};
%
%A "pin" is drawn between the midpoint of the edge between the last two vertices and its label.
\draw[draw=gray, line width=0.8pt, shorten <=1mm, shorten >=1mm] ({(2+5)/2},-15) -- ({(2+5)/2},-16);
\node[anchor=north] at ({(2+5)/2},-16){$2^{2}b-(n+1)2$};
\node[anchor=south] at ($({(2+5)/2},-15) +(0,0.25)$){$\dfrac{2n+1}{2}$};

\end{tikzpicture}

\end{document}

答案1

像這樣?

在此輸入影像描述

編輯: 下面的 MWE 是基於我的 回答關於你之前的問題。它分為五行,由構建塊 (BBB)(節點)組成dot,具有以下結構:黑色實心圓圈,上面有名稱的標籤(其中是分數 0/1、1/1、2/1等)並在其下方標有名稱的標籤(其中索引bb-1等)。標籤的名稱可以在相鄰行的 BBB 之間繪製箭頭:

 dot/.style args = {#1/#2/#3/#4}{circle, draw, fill, minimum size=3pt,
                    inner sep=0pt, outer sep=0pt, anchor=center,
                    label={[name=#1]$#2$},
                    label={[name=#3]below:$#4$},
                    node contents={},
                    on chain}, 

透過使用庫將定義的 BBB 連接在每個影像行中的鏈中chains。它們之間的距離由 決定node distance=<vertical> and <horizontal>

除了 BBB 之外,還定義了lbl引腳節點、標籤樣式、邊緣引用和節點距離等輔助元素。最後定義了 BBB 之間的距離。這樣就可以輕鬆地以一致的方式更改 BBB 之間的距離。

所描述的結構建議的解決方案為您的圖像提供了一致、簡潔和簡短的程式碼(當然在我看來),如果需要,可以簡單地使用新圖像的元素進行擴展。

完整的 MWE 為:

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{chains,           % new
                positioning,      % new
                shapes.multipart, % new
                quotes}           % new  
\makeatletter
\tikzset{% for discontinuing of chain
  off chain/.code={\def\tikz@lib@on@chain{}}%
}
\makeatother

\begin{document}
    \begin{tikzpicture}[auto,
           node distance = 22mm and 21mm,    % new
             start chain = going right,     % new
every edge quotes/.style = {auto=right, font=\footnotesize,
                            align=center},  % new
every edge/.append style = {-latex, line width=0.8pt},
      every label/.style = {inner sep= 2pt,font=\footnotesize},
         dot/.style args = {#1/#2/#3/#4}{circle, draw, fill, minimum size=3pt,
                            inner sep=0pt, outer sep=0pt, anchor=center,
                            label={[name=#1]$#2$},
                            label={[name=#3]below:$#4$},
                            node contents={},
                            on chain}, % 
         lbl/.style args = {#1/#2}{rectangle split, rectangle split parts=2,
                            font=\footnotesize, inner sep=2pt,
                            node contents={#1\nodepart{two}#2},
                            }, % new
                    ]
%%%% 1. row (is on the top of image), node name is n11
\node (n11) [dot=n11a/\frac{0}{1}/n11b/b];
%%%% 2. row, nodes names are n21, n22
\node (n21) [dot=n21a/\frac{0}{1}/n21b/b,
            below=of n11];
\node (n22) [dot=n22a/\frac{1}{1}/n22b/b-];
\draw[-latex, line width=0.8pt]
        (n11b) edge["blow up\\ of vertex $b$", bend left] (n21a);
\draw   (n21) -- (n22);
%%%% 3. row, nodes names are n31, n32, ...
\node (n31) [dot=n31a/\frac{0}{1}/n31b/b,
            below=of n21];
\node (n32) [dot=n32a/\frac{1}{1}/n32b/b-1];
\node (n33) [dot=n33a/\frac{2}{1}/n33b/b-2];
\draw   (n22b) edge["blow up\\  of vertex $b$", bend left] (n32a);
\draw   (n31) -- (n33);
%%%% 4. row, nodes names are n41, n42, ...
\node (n41) [dot=n41a/\frac{0}{1}/n41b/b,
            below=of n31];
\node (n42) [dot=n42a/\frac{1}{1}/n42b/b-1];
\node (n43) [dot=n43a/\frac{2}{1}/n43b/b-2];
\node (n44) [dot=n45a/\frac{n}{1}/n45b/b-n];
\node (n45) [dot=n46a/\frac{n+1}{1}/n46b/b-(n+1)];
\path   (n43) -- node[inner sep=0pt,
                      label={[name=n46,text=green!40!black]$\frac{3}{1}$}] {$\dots$} (n44);
\draw   (n33b) edge["blow up\\  of vertex $b$",
                    bend left] (n43a);
\draw   (n33b) edge[bend left] (n46.north);
\draw[thick]    (n41) -- (n43)   (n44) -- node (aux) {} (n45);
% "pin" above
\draw[<-, semithick, dashed]   (aux) -- ++ (6mm,9mm) 
        node[above, lbl=Future vertex of/
                        $\dfrac{2n+1}{2}$];
% "pin" below
\draw[semithick]    (aux) -- ++ (0,-9mm) 
        node (aux2) [below, lbl=Present edge label of/
                                {$\begin{gathered}
                                2\bigl[(b-n)+(b-(n+1))\bigr]\\
                                = 2^{2}b-(2n+1)2
                                \end{gathered}$}];
%%%% 5. row, nodes names are n51, n52, ...
\node (n51) [dot=n51a/\frac{0}{1}/n41b/b,
            below=of n41 |- aux2];
\node (n52) [dot=n52a/\frac{1}{1}/n52b/b-1];
\node (n53) [dot=n53a/\frac{2}{1}/n53b/b-2];
\node (n54) [dot=n54a/\frac{n}{1}/n54b/b-n];
\node (n55) [dot=n55a/\frac{n+1}{1}/n55b/b-(n+1)];
%
\path   (n53) -- node [anchor=center] {$\dots$} (n54);
\draw[thick]    (n51) --  (n53) 
                (n54) --  (n55) node (n56) [pos=0.5, off chain, 
                                      dot=n56a/\frac{2n+1}{2}/n56b/ ];
\draw[semithick]
        (aux2) -- (n56a) (n56) -- ++ (0,-9mm) node[below, lbl={$2^{2}b-(2n+1)2$/ }];
    \end{tikzpicture}
\end{document}

請注意,我知道我提出的解決方案與您目前使用的解決方案有很大不同。無論如何,(根據我的意見)值得對其進行測試並查看替代解決方案,這可能提供更簡單的管理方法、更簡單的更改或保持一致性。

相關內容