node
我试图将以下命令显示的内容放入中TikZ
。
\begin{align*}
&\text{Present edge label of} \\
&\quad 2\bigl[(b-n)+(b-(n+1))\bigr] \\
&\qquad=2^{2}b-(2n+1)2
\end{align*}
行间距太大了 - 对我来说不太合适。我尝试使用[0.25ex]
和[0.5ex]
,但它们被忽略了。如果align*
环境不允许减小行间距,我希望有一个替代建议,以获得与水平定位类似的显示,但行间距较小。
这是该图的代码TikZ
。
\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=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}$};
%
%
%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 vertex\\of\[\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} \\[0.5ex]
&\quad 2\bigl[(b-n)+(b-(n+1))\bigr] \\[0.25ex]
&\qquad=2^{2}b-(2n+1)2
\end{aligned}$};
\end{tikzpicture}
\end{document}
答案1
align*
和环境aligned
都允许减少行间距。在\\
命令后添加长度以在两行之间添加间距时,此长度将考虑额外的行间距(正数或负数)。
如果我编译您的示例,命令[0.25ex]
和[0.5ex]
不会被忽略,它们只会增加更多间距。如果您想减少行间距,您必须插入一个消极的长度。使用你的代码,aligned
如果我用
\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}