在 `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)东南方向(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}

请注意,我知道我提出的解决方案与您目前使用的解决方案完全不同。无论如何,(根据我的意见)值得测试它并寻找替代解决方案,它可能提供更简单的管理方法、更简单的更改或保持一致性。

相关内容