我正在使用 tikzcd。我有一个顶点和 n 个循环。我希望前几个循环是实线,后面的循环是虚线,以表示还有更多循环。我是 Latex 的新手,不太了解,所以尝试以简单的方式呈现它。
\documentclass[11pt]{article}
\usepackage{tikz-cd}
\usepackage{tikz}
\usepackage{tikz}
\begin{document}
\begin{equation}
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex'}}
\begin{tikzpicture}
\node (a) at (0,2) {a};
\path[->] (a) edge [loop left, "$e_{n-1}$"] (a);
\path[->] (a) edge [loop right, "$e_1$"] (a);
\path[->] (a) edge [loop above, "$e_n$"] (a);
\path[->] (a) edge [loop below, "$e_2$"] (a);
\end{tikzpicture}
\end{equation}
\end{document}
这只是 o4 个循环,我想要超过 4 个。我想要 n 个这样的循环,其中一些带点。
答案1
你可能期望这样的事情:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows,
quotes}
\tikzset{
every edge quotes/.append style = {font=\footnotesize},
every edge/.append style = {> = stealth, % arrowhead can be changed only on the such way
draw=red, semithick},
vertex/.style = {shape=circle, draw, minimum size=1.5em, inner sep=2pt}
}
\begin{document}
\begin{equation}
\begin{tikzpicture}[baseline=(current bounding box.center)]
\node (a) [vertex] {a};
\path[scale=2] % <--- scaled loops size
(a) edge [loop right, "$e_1$"]
(a) edge [out=-30, in=-60, distance=5mm, ->, "$e_2$"] (a)
(a) edge [loop above, "$e_{n-1}$"]
(a) edge [out= 60, in= 30, distance=5mm, ->, "$e_n$"] (a);
\draw [densely dotted] (285:1.5em) arc (285:120:1.5em);
\end{tikzpicture}
\end{equation}
\end{document}