![我如何在 LaTeX 中排版法诺平面?](https://linux22.com/image/300401/%E6%88%91%E5%A6%82%E4%BD%95%E5%9C%A8%20LaTeX%20%E4%B8%AD%E6%8E%92%E7%89%88%E6%B3%95%E8%AF%BA%E5%B9%B3%E9%9D%A2%EF%BC%9F.png)
如果这是重复的问题或者是糟糕的问题,我深感抱歉。
我该如何排版法诺平面在 LaTeX 中?
具体来说,我需要它的矢量图形,我更愿意使用该tikz
包。我也不想复制粘贴别人的答案:我希望能够对其进行自定义。
为方便起见,这是法诺平面的图片:
恐怕我一点头绪都没有。我可以使用tikz-cd
平均交换图,但仅此而已。
请帮忙 :)
答案1
使用一些基本的几何形状和calc
库,您可以将所有计算留给 TikZ:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\FanoPlane[1][1cm]{%
\begin{tikzpicture}[
mydot/.style={
draw,
circle,
fill=black,
inner sep=1.5pt}
]
\draw
(0,0) coordinate (A) --
(#1,0) coordinate (B) --
($ (A)!.5!(B) ! {sin(60)*2} ! 90:(B) $) coordinate (C) -- cycle;
\coordinate (O) at
(barycentric cs:A=1,B=1,C=1);
\draw (O) circle [radius=#1*1.717/6];
\draw (C) -- ($ (A)!.5!(B) $) coordinate (LC);
\draw (A) -- ($ (B)!.5!(C) $) coordinate (LA);
\draw (B) -- ($ (C)!.5!(A) $) coordinate (LB);
\foreach \Nodo in {A,B,C,O,LC,LA,LB}
\node[mydot] at (\Nodo) {};
\end{tikzpicture}%
}
\begin{document}
\FanoPlane\quad\FanoPlane[2cm]\quad\FanoPlane[3cm]
\end{document}
答案2
事实上和其他的没太大区别...
\documentclass[tikz,border=5]{standalone}
\begin{document}
\tikz[every node/.style={circle, fill}]
\draw circle [radius=1] (90:2) -- (210:2) -- (330:2) -- cycle (0,0) node {}
\foreach \i in {90,210,330}{ (\i:2) node {} -- (\i+180:1) node {} };
\end{document}
答案3
以下是两个简短的解决方案:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (30:1) -- (210:2)
(150:1) -- (330:2)
(270:1) -- (90:2)
(90:2) -- (210:2) -- (330:2) -- cycle
(0:0) circle (1);
\fill (0:0) circle(3pt)
(30:1) circle(3pt)
(90:2) circle(3pt)
(150:1) circle(3pt)
(210:2) circle(3pt)
(270:1) circle(3pt)
(330:2) circle(3pt);
\end{tikzpicture}
\end{document}
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw \foreach \a in {30,150,270}{(\a:1) -- (180+\a:2)}
(90:2) -- (210:2) -- (330:2) -- cycle
(0:0) circle (1);
\fill \foreach \p in {(0:0),(30:1),(90:2),(150:1),(210:2),(270:1),(330:2)}
{\p circle(3pt)};
\end{tikzpicture}
\end{document}
答案4
另一个基于 的解决方案pstricks
,使用包中的简短代码pst-poly
。该pdf
选项允许 pdfLaTeX
编译,前提是您--shell-escape
为 TeX Live 或 MacTeX 设置了开关,--enable-write18
对于 MiKTeX:
\documentclass[12pt, pdf, x11names]{standalone}
\usepackage{pst-poly}
\begin{document}
\psset{unit = 2cm,dimen = m}
\begin{pspicture*}(-1.25,-1)(1.25,1.1)
\providecommand{\PstPolygonNode}{%
\psdots[dotstyle = o, dotsize=4pt,fillstyle = solid, fillcolor=cyan](1;\INode)}
\psset{ linewidth = 0.6pt}
\rput{-30}(0,0){\PstTriangle[PolyName =A]}
\pscircle(A0){0.5}
\rput{150}(0,0){\PstTriangle[unit=0.5, PolyOffset=2,PolyName=I, linestyle=none]}
\multido{\i = 1 + 1}{3}{\ncline[nodesep = 2pt]{A\i}{I\i}}
\psdot[dotstyle = o, dotsize=4pt,fillstyle = solid, fillcolor=cyan](A0)
\end{pspicture*}
\end{document}