![如何使用 pstricks 制作彼得森图的图表](https://linux22.com/image/305691/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20pstricks%20%E5%88%B6%E4%BD%9C%E5%BD%BC%E5%BE%97%E6%A3%AE%E5%9B%BE%E7%9A%84%E5%9B%BE%E8%A1%A8.png)
如何在五边形内制作等边星?
答案1
一种可能性(来自的简单变体)这个例子PS-Tricks 示例库):
\documentclass{article}
\usepackage{pst-poly}
\providecommand{\PstPolygonNode}{%
\psdots[dotscale=2](1;\INode)
\multido{\iA=0+1}{\INode}{%
\multido{\iB=\iA+1}{\numexpr\INode-\iA+1\relax}{%
\psline[linecolor=blue!50](1;\iA)(1;\iB)}}}
\begin{document}
\psset{unit=2,linewidth=0.2pt}
\PstPolygon[PolyNbSides=5]
\end{document}
答案2
与 Gonzalo 的回答略有不同:
\documentclass{article}
\usepackage{pst-node,multido}
\begin{document}
\begin{pspicture}(5,5)
\SpecialCoor
\multido{\i=0+1}{7}{\rput{90}{\degrees[5]\pnode(1;\i){v\i}}}% Mark nodes
\multido{\i=0+1}{5}{%
\pcline(v\i)(v\number\numexpr\i+1)% C_5<1>
\pcline(v\i)(v\number\numexpr\i+2)% C_5<2>
\pscircle[fillstyle=solid,fillcolor=black](v\i){2pt}% node
}
\end{pspicture}
\end{document}
还有pst-poly
:
\documentclass{article}
\usepackage{pst-poly}
\begin{document}
\begin{pspicture}(5,5)
\providecommand{\PstPolygonNode}{\psdots[dotsize=0.1](1;\INode)}
\rput{90}(2,2){\PstPolygon[PolyNbSides=5]}
\rput{90}(2,2){\PstPolygon[PolyNbSides=5,PolyOffset=2]}
\end{pspicture}
\end{document}