如何使用 tikz 包在 LaTeX 或 Mathematica 中构建平面缠结(有阴影或无阴影)?

如何使用 tikz 包在 LaTeX 或 Mathematica 中构建平面缠结(有阴影或无阴影)?

我曾尝试在线搜索有关平面缠结和平面代数的 tikz 代码,但代码无法准确复制。我注意到在这些在线资源中,提到了“mathfig”包。我在 Google 上搜索了 mathfig 包 tikz,并了解到它是一个用于引用使用 mathematica 绘制的图形的包。这就是我陷入困境的地方。我如何直接在 LaTeX 中创建平面缠结,或者我如何先在 mathematica 中创建它,然后使用 tikz 包在 LaTeX 中应用它?

以下是我仅使用绘制命令和节点就能得到的结果:

$\begin{tikzpicture}
\draw (2,2) circle (2.5cm);
\draw node[circle, draw, minimum size=.5cm] at (2.75, 1.75) {h};
\draw (2.75,2.10) -- (2.75,2.95);
\draw (3,1.9) -- (4.5,1.93);
\draw node[circle, draw, minimum size=.5cm] at (.5, 1.5) {f};
\draw (.6,1.25) -- (1.25,-0.35);
\draw (.6,1.25) -- (0,.5);
\draw (.6,1.25) -- (1,4.25);
\draw (.6,1.25) -- (0,3.5);
\draw node[circle, draw, minimum size=.5cm] at (2.75, 3.25) {g};
\draw (2.65,3.5) -- (2.65,4.5);
\end{tikzpicture}$

问题:如何使用 tikz 包在 LaTeX 或 Mathematica 中构建平面缠结(有阴影或无阴影)?我是否只需不断更改节点和字符串的位置即可获得我想要的缠结,还是有更有效的方法来实现它?此外,任何关于如何在 Mathematica 中构建平面以便我可以使用“\mathfig”命令将缠结的 Mathematica 图像上传到 LaTeX 的建议都将很有帮助并值得赞赏。

答案1

有一篇关于平面代数的论文论文集其中有大量此类图表,全部用 TikZ 绘制。

Haagerup 子因子的平面代数构造
艾米莉·彼得斯
国际数学杂志,21,987 (2010)
https://arxiv.org/abs/0902.1294

您可以将本文的源代码下载为 gzip 压缩包 (直接下载)。

我从论文中抄下了前两张图表作为展示:

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}

\tikzset{
  shaded/.style = {fill=red!10!blue!20!gray!30!white},
  Tbox/.style = {circle, draw, thick, fill=white, opaque},
  PAdefn/.style = {scale=.7,baseline},
}

\begin{document}

% Diagrams/SampleTangle.tex
\begin{tikzpicture}[scale=.7]
  \clip (0,0) circle (3cm);

  \begin{scope}[shift=(10:1cm)] 
    \draw[shaded] (0,0)--(0:6cm)--(90:6cm)--(0,0);  
    \draw[shaded] (0,0) .. controls ++(180:2cm) and ++(-90:2cm) .. (0,0);
  \end{scope}

  \draw[shaded] (-150:1cm) -- (120:4cm) -- (180:4cm) -- (-150:1cm);
  \draw[shaded] (-150:1cm) -- (-120:4cm) -- (-60:4cm) -- (-150:1cm);

  \begin{scope}[shift=(10:1cm)] 
    \node at (0,0) [Tbox, inner sep=2mm] {};
    \node at (90:1.5cm) [Tbox, inner sep=2mm] {};
    \node at (-45:.7cm) {$\star$};
    \node at (120:1.6cm) {$\star$};
  \end{scope}
  \node at (-150:1cm) [Tbox, inner sep=2mm] {};
  \node at (-120:1.6cm) {$\star$};
  \node at (-30:2.7cm) {$\star$};

  \draw[very thick] (0,0) circle (3cm);
\end{tikzpicture}


% Diagrams/CompositionEG.tex
\[
  \begin{tikzpicture}[PAdefn]
    \clip (0,0) circle (3cm);

    \begin{scope}[shift=(10:1cm)]   
      \draw[shaded] (0,0)--(0:6cm)--(90:6cm)--(0,0);    
      \draw[shaded] (0,0) .. controls ++(180:2cm) and ++(-90:2cm) .. (0,0);
    \end{scope}

    \draw[shaded] (-150:1cm) -- (120:4cm) -- (180:4cm) -- (-150:1cm);
    \draw[shaded] (-150:1cm) -- (-120:4cm) -- (-60:4cm) -- (-150:1cm);

    \begin{scope}[shift=(10:1cm)]   
      \node at (0,0) [Tbox, inner sep=1.4mm] {\tiny{\textcolor{gray}{2}}};
      \node at (90:1.5cm) [Tbox, inner sep=1.4mm] {\tiny{\textcolor{gray}{1}}};
      \node at (-45:.7cm) {$\star$};
      \node at (120:1.6cm) {$\star$};
    \end{scope}
    \node at (-150:1cm) [Tbox, inner sep=1.4mm] {\tiny{\textcolor{gray}{3}}};
    \node at (-120:1.6cm) {$\star$};
    \node at (-30:2.7cm) {$\star$};

    \draw[very thick] (0,0) circle (3cm);

  \end{tikzpicture}
  \,
  \circ_{2}
  \,
  \begin{tikzpicture}[PAdefn]
    \clip (0,0) circle (2cm);

    \draw[shaded] (0:4cm)--(0,0)--(90:4cm);
    \draw[shaded] (180:4cm)--(180:2cm) .. controls ++(0:1cm) and ++(90:1cm) .. (270:2cm) -- (270:4cm);

    \node at (0,0) [Tbox, inner sep=2mm] {};

    \node at (-45:1.7cm) {$\star$};
    \node at (-45:.7cm) {$\star$};  

    \draw[very thick] (0,0) circle (2cm);

  \end{tikzpicture}
  \,
  =
  \,
  \begin{tikzpicture}[PAdefn]
    \clip (0,0) circle (3cm);

    \begin{scope}[shift=(10:1cm)]   
      \draw[shaded] (0:6cm)--(90:6cm)--(90:2cm) .. controls ++(-90:1cm) and ++(180:.5cm) .. (0:1cm)--(0:6cm);   
      \draw[shaded] (-135:.6cm) circle (.5cm);
    \end{scope}

    \draw[shaded] (-150:1cm) -- (120:4cm) -- (180:4cm) -- (-150:1cm);
    \draw[shaded] (-150:1cm) -- (-120:4cm) -- (-60:4cm) -- (-150:1cm);

    \begin{scope}[shift=(10:1cm)]   
      \node at (0:.8cm) [Tbox, inner sep=2mm] {};
      \node at (90:1.5cm) [Tbox, inner sep=2mm] {};
      \node at (-45:.9cm) {$\star$};
      \node at (120:1.6cm) {$\star$};
    \end{scope}
    \node at (-150:1cm) [Tbox, inner sep=2mm] {};
    \node at (-120:1.6cm) {$\star$};
    \node at (-30:2.7cm) {$\star$};

    \draw[very thick] (0,0) circle (3cm);

  \end{tikzpicture}
\]

\end{document}

相关内容