我想打印希腊字母 alpha 来代替 alpha1、alpha2 和 alpha3。我该怎么做?以下是代码:
\begin{center}
\begin{tikzpicture}[scale=2, auto,swap]
\filldraw [black] (.7,3) circle (1pt);
\filldraw [black] (.8,3) circle (1pt);
\filldraw [black] (.9,3) circle (1pt);
\filldraw [black] (1,3) circle (1pt);
\filldraw [black] (1.1,3) circle (1pt);
\foreach \pos/\name/\disp in {
{(0,4)/1/K},
{(-2,3)/2/alpha1},
{(0,3)/3/alpha2},
{(2,3)/4/alpha3}}
\node[minimum size=20pt,inner sep=0pt] (\name) at \pos {\disp};
\foreach \source/\dest in {
1/2,
1/3,
1/4}
\path[draw,thick,->] (\source) -- node {} (\dest);
\end{tikzpicture}
\end{center}
答案1
您的问题已通过(我的)评论解决,因此这里有一个题外的建议。您的图像仍为一棵树。可以使用 TikZ 简单绘制树:
\documentclass[tikz, margin=3mm]{standalone}
\usepackage{amsmath} % for \dotsm
\begin{document}
\begin{tikzpicture}
\node {$K$}
child{ node {$\alpha_1$}}
child{ node {$\alpha_2$}}
child{ node {$\dotsm$} edge from parent[draw=none]}
child{ node {$\alpha_n$}};
\end{tikzpicture}
\end{document}