Konsistenz beim Zeichnen von „(Punkt A) bis [Biegung rechts=30] (Punkt B)“ in einem „TikZ“-Diagramm

Konsistenz beim Zeichnen von „(Punkt A) bis [Biegung rechts=30] (Punkt B)“ in einem „TikZ“-Diagramm

Im folgenden TikZDiagramm habe ich einen expandierenden Graphen dargestellt - eine Folge einfacher Graphen. Die Befehle ähneln

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

zeigen die Erweiterung bei einem bestimmten Schritt an. Das sieht gut aus, wenn (Point A)direkt darüber steht (Point B)– die Pfeilspitze zeigt in die nordwestliche Ecke eines Knotens, der einen Bruch enthält. Der dritte – und letzte – dieser Pfeile endet an einem , der (Point B)südöstlich von einem liegt (Point A). (Der (Point B)enthält in diesem Fall den Bruch 1/1in Grün. Es ist ein temporärer Knoten, der gesetzt ist, um mein Anliegen zu veranschaulichen.) In diesem Fall sieht die Pfeilspitze so aus, als würde sie in die westliche Kante des Knotens zeigen. Wie kann dieser letzte Pfeil so geändert werden, dass die Pfeilspitze in die nordöstliche Ecke des Knotens zeigt?

\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}

Antwort1

So was?

Bildbeschreibung hier eingeben

Bearbeiten: MWE unten basiert auf meiner Antwortzu Ihrer vorherigen Frage. Es ist in fünf Reihen organisiert, die aus Bausteinen (BBB) ​​– Knoten dot– mit der folgenden Struktur bestehen: schwarzer ausgefüllter Kreis, Beschriftung mit Namen darüber (wo sind die Brüche 0/1, 1/1, 2/1 usw.) und Beschriftung mit Namen darunter (wo sind die Indizes b, b-1, usw.). Die Namen der Beschriftungen ermöglichen das Zeichnen von Pfeilen zwischen BBBs in benachbarten Reihen:

 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}, 

Definierte BBB werden in jeder Bildzeile mithilfe der chainsBibliothek in Ketten verbunden. Der Abstand zwischen ihnen wird durch bestimmt node distance=<vertical> and <horizontal>.

Neben BBB werden Hilfselemente wie lblPin-Knoten, Beschriftungsstil, Kantenzitate und Knotenabstand definiert. Mit Letzterem werden Abstände zwischen BBB definiert. Damit ist es einfach, Abstände zwischen BBB auf konsistente Weise zu ändern.

Die beschriebene Struktur und der Lösungsvorschlag ermöglichen (natürlich meiner Meinung nach) einen konsistenten, prägnanten und kurzen Code für Ihr Bild, der bei Bedarf einfach um neue Bildelemente erweitert werden kann.

Vollständiges MWE ist:

\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}

Beachten Sie, dass ich mir bewusst bin, dass meine vorgeschlagene Lösung sich stark von Ihrer unterscheidet, die Sie bisher verwenden. Trotzdem lohnt es sich (meiner Meinung nach), sie zu testen und nach alternativen Lösungen zu suchen, die möglicherweise eine einfachere Handhabung, einfachere Änderungen oder die Aufrechterhaltung der Konsistenz bieten.

verwandte Informationen