答案1
两个选项,取决于所需的箭头:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\[
\begin{tikzpicture}[baseline=(current bounding box.center)]
\draw
(0,0) node[above] {$n$} --
++(45:1.5cm) node[above] {$1$} --
++(0:1.5cm) node[above] {$2$};
\node[label={above:$g$}] at (4,0.5) {$\Rightarrow$};
\draw
(5,0) node[below] {$i+1$} --
++(10:1.5cm) node[below] {$i$} --
++(50:1.5cm) node[right] {$i-1$} ;
\end{tikzpicture}
\]
\end{document}
或者用单箭头:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows}
\begin{document}
\[
\begin{tikzpicture}[baseline=(current bounding box.center)]
\draw
(0,0) node[above] {$n$} --
++(45:1.5cm) node[above] {$1$} --
++(0:1.5cm) node[above] {$2$};
\node[draw,single arrow,label={above:$g$},text width=1cm] at (4,0.5) {};
\draw
(5.5,0) node[below] {$i+1$} --
++(10:1.5cm) node[below] {$i$} --
++(50:1.5cm) node[right] {$i-1$} ;
\end{tikzpicture}
\]
\end{document}
答案2
示例(在数学中设置箭头部分):
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\[
\vcenter{\hbox{%
\tikz\draw[thick, node font=\scriptsize]
(-135:1) node[above left] {$n$}
-- (0, 0) node[above left] {$1$}
-- (1, 0) node[above] {$2$};%
}}
\stackrel{g}{\Rightarrow}
\vcenter{\hbox{%
\tikz\draw[thick, node font=\scriptsize]
(-190:1) node[below] {$i+1$}
-- (0, 0) node[below] {$i$}
-- (45:1) node[right] {$i-1$};%
}}
\]
\end{document}
该构造只是根据当前数学轴\vcenter{\hbox{...}}
将材料垂直居中。...