绘制括号多项式的规则

绘制括号多项式的规则

我正在尝试重新创建括号多项式的三个规则:

在此处输入图片描述

这是我迄今为止尝试过的:

\documentclass[executivepaper]{article}

\usepackage{mathtools}

\everymath{\displaystyle}

\usepackage{amssymb}

\usepackage{amsfonts}

\usepackage{commath}

\usepackage{kantlipsum,graphicx}

\usepackage{amsmath}

\usepackage[utf8]{inputenc}

\usepackage{sectsty}

\usepackage{tcolorbox}

\usepackage{geometry}

\usepackage{tikz}

\usetikzlibrary{shapes,snakes}

\usepackage{float}

\setlength\parindent{3pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\newtheorem{definition}{Definition}

\newtheorem{theorem}{Theorem}

\newtheorem{corollary}{Corollary}[theorem]

\begin{document}

\begin{tcolorbox}

\textbf{Rules for the Bracket Polynominal} \textit{The Kauffman \textbf{Bracket Polynominal} of a regular projection of a link is a polynominal in integer powers of the variable A defined by the following three rules:}

\begin{center}

\begin{enumerate}

%the first rule
\item $\bigg \langle \begin{tikzpicture} \filldraw[color=gray, fill=none, thick] circle (0.3); \end{tikzpicture} \bigg \rangle=1$

%the second rule
\item $\bigg \langle L \cup \begin{tikzpicture} \filldraw[color=gray, fill=none, thick] circle (0.3); \end{tikzpicture} \bigg \rangle=(-A^{2}-A^{-2}) \big \langle L \big \rangle$

%the third rule
\item $\bigg \langle \begin{tikzpicture} \draw (-1,0) -- (90:0.1cm); \end{tikzpicture} \bigg \rangle=A\bigg \langle \begin{tikzpicture} \draw (-0.4,0.4) .. controls (0,0) .. (0.4,0.4); \draw (-0.4,-0.4) .. controls (0,0) .. (0.4,-0.4); \end{tikzpicture} \bigg \rangle + A^{-1} \bigg \langle \begin{tikzpicture} \path[thick,draw]   (1,1) node[right]{} .. controls (-0.25,0) .. (1,-1); \path[thick,draw]   (-1,1)node[right]{} .. controls (0.25,0) .. (-1,-1); \end{tikzpicture} \bigg \rangle$

\end{enumerate}

\end{center}

\end{tcolorbox}

\end{document}

我已经基本完成了第一条和第二条规则,只是似乎不知道如何将圆圈向下移动,以便它适合尖括号之间。对于第三条规则,我在绘制交叉线以及确保其他两对线的尺寸正确且在括号内正确对齐方面遇到了麻烦。任何帮助都将不胜感激!

答案1

您应该为图片定义宏;这是一种可能性。

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}

\newcommand{\KP}[1]{%
  \begin{tikzpicture}[baseline=-\dimexpr\fontdimen22\textfont2\relax]
  #1
  \end{tikzpicture}%
}
\newcommand{\KPA}{%
  \KP{\filldraw[color=gray, fill=none, thick] circle (0.3);}%
}
\newcommand{\KPB}{%
  \KP{
    \draw[color=gray,thick] (-0.3,0.3) -- (0.3,-0.3);
    \draw[color=gray,thick] (-0.3,-0.3) -- (-0.05,-0.05);
    \draw[color=gray,thick] (0.05,0.05) -- (0.3,0.3);
  }%
}
\newcommand{\KPC}{%
  \KP{%
    \draw[color=gray,thick] (-0.3,0.3) .. controls (0,-0.05) .. (0.3,0.3);
    \draw[color=gray,thick] (-0.3,-0.3) .. controls (0,0.05) .. (0.3,-0.3);
  }%
}
\newcommand{\KPD}{%
  \KP{%
    \draw[color=gray,thick] (-0.3,-0.3) .. controls (0.05,0) .. (-0.3,0.3);
    \draw[color=gray,thick] (0.3,-0.3) .. controls (-0.05,0) .. (0.3,0.3);
  }%
}


\begin{document}

\begin{enumerate}
%the first rule
\item
  $\left\langle\KPA\right\rangle=1$

%the second rule
\item
  $\left\langle L \cup \KPA\right\rangle=(-A^{2}-A^{-2})\langle L\rangle$

%the third rule
\item
  $\left\langle\KPB\right\rangle=
  A\left\langle\KPC\right\rangle + A^{-1} \left\langle \KPD \right\rangle$

\end{enumerate}

\end{document}

在此处输入图片描述

一些注释。

  1. 绝不问题\everymath{\displaystyle}曾经。

  2. commath软件包提供了大量有缺陷的命令。请避免使用它。

答案2

已经给出的两个答案都有一个明显的改进,即使用数学样式使符号可扩展。即使是@egreg的答案(比@LoopSpaces的答案更灵活)在这方面也有缺陷,因为它静态地引用了“文本大小”(它使用了\textfont2)。

这些增强只是例行公事,但由于已经过去了 24 小时,我会认为这两位作者没有费心提交它们(它们也相当无聊!),并提出自己承担这项任务。

除了从 缩小到\textfont\scriptfont缩小到\scriptscriptfont尺寸之外,我还决定让符号在显示时以“大”的形式出现,就像“大”运算符(\sum\int\bigoplus、...)。诚然,这可能是值得怀疑的。

这是代码:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not necessary, but recommended.

\usepackage[ascii]{inputenc}     % Just to check that the source is still pure,
                                 % 7-bit-clean ASCII when you execute it, as it
                                 % was when I wrote it.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}

% Old uncle Gustavo prefers to stick to the "picture" environment:
\usepackage{pict2e}
% \usepackage{xcolor} % I'd leave it out

%--------------------------------------------------------------%
\makeatletter

% We define separate versions (large and small) for the frames:
\newcommand*\@KP@Large@frame[2]{%
    \setlength\unitlength{\fontdimen 22 #1\tw@}%
    \vrule \@width\z@ \@height 4\unitlength \@depth\tw@\unitlength
    \begin{picture}(6,2)(-3,-1)%
        \def\@KP@Radius     {3}%
        \def\@KP@Hole@radius{.5}% The same value seem adequate for both...
        \def\@KP@Diameter   {6}%
        #2%
    \end{picture}%
}
\newcommand*\@KP@Small@frame[2]{%
    \setlength\unitlength{\fontdimen 22 #1\tw@}%
    \vrule \@width\z@ \@height \thr@@\unitlength \@depth\@ne\unitlength
    \begin{picture}(4,2)(-2,-1)%
        \def\@KP@Radius     {2}%
        \def\@KP@Hole@radius{.5}% ... but let it be customizable too.
        \def\@KP@Diameter   {4}%
        #2%
    \end{picture}%
}

% On the other hand, for the commands that draw the four different shapes, it
% seems that all differences between the small variant and the large one can be
% confined in the following three macros (here, we just declare their name):
\newcommand*\@KP@Radius     {}
\newcommand*\@KP@Hole@radius{}
\newcommand*\@KP@Diameter   {}
%
% The four shapes:
\newcommand*\@KP@Shape@A{%
    \put(0,0){\circle{\@KP@Diameter}}%
}
\newcommand*\@KP@Shape@B{%
    \Line(-\@KP@Radius,\@KP@Radius )(\@KP@Radius,-\@KP@Radius)%
    \Line(-\@KP@Radius,-\@KP@Radius)(-\@KP@Hole@radius,-\@KP@Hole@radius)%
    \Line(\@KP@Radius ,\@KP@Radius )(\@KP@Hole@radius ,\@KP@Hole@radius )%
}
\newcommand*\@KP@Shape@C{%
    \cbezier(-\@KP@Radius,\@KP@Radius )(0,0)(0,0)(\@KP@Radius,\@KP@Radius )%
    \cbezier(-\@KP@Radius,-\@KP@Radius)(0,0)(0,0)(\@KP@Radius,-\@KP@Radius)%
}
\newcommand*\@KP@Shape@D{%
    \cbezier(-\@KP@Radius,-\@KP@Radius)(0,0)(0,0)(-\@KP@Radius,\@KP@Radius)%
    \cbezier(\@KP@Radius ,-\@KP@Radius)(0,0)(0,0)(\@KP@Radius ,\@KP@Radius)%
}

\newcommand*\@KP@Atomic@mathpalette[1]{%
    \mathinner{% or "\mathord"?
        % Note that a new level of grouping has just been entered (p. 290).
        % \color{gray}% not used, for now
        \mathchoice{%
            \linethickness{.6\p@}% Tip: use thicker lines if you decide to 
                                 % revert to using gray.
            \@KP@Large@frame \textfont {#1}%
        }{%
            \linethickness{.4\p@}% adjustable
            \@KP@Small@frame \textfont {#1}%
        }{%
            \linethickness{.3\p@}% adjustable
            \@KP@Small@frame \scriptfont {#1}%
        }{%
            \linethickness{.2\p@}% adjustable
            \@KP@Small@frame \scriptscriptfont {#1}%
        }%
    }%
}

% User-level commands:
\newcommand*\KPA{\@KP@Atomic@mathpalette \@KP@Shape@A}
\newcommand*\KPB{\@KP@Atomic@mathpalette \@KP@Shape@B}
\newcommand*\KPC{\@KP@Atomic@mathpalette \@KP@Shape@C}
\newcommand*\KPD{\@KP@Atomic@mathpalette \@KP@Shape@D}

\makeatother
%--------------------------------------------------------------%



\begin{document}

The Kauffmann Polynomial is defined by:
\begin{enumerate}
    \item
        Trivial link: \( \left<\KPA\right> = 1 \).

    \item
        Disjoint union etc.:
        \( \left<L\cup\KPA\right> = (-A^{2}-A^{-2})\langle L\rangle \).

    \item
        Skein relation:
        \( \left<\KPB\right> = A\left<\KPC\right> + A^{-1}\left<\KPD\right> \).
\end{enumerate}
Now the same three relations in display:
%
\begin{align}
    \left<\KPA\right> &= 1
        &&\text{trivial link} \label{eq:trivial} \\
    \left<L\cup\KPA\right> &= (-A^{2}-A^{-2})\langle L\rangle
        &&\text{disjoint union} \label{eq:union} \\
    \left<\KPB\right> &= A\left<\KPC\right> + A^{-1}\left<\KPD\right>
        &&\text{skein relation} \label{eq:skein}
\end{align}
%
From \eqref{eq:trivial} and~\eqref{eq:skein} I infere that
\( \frac{\left<\KPB\right>}{A\left<\KPC\right>
+ A^{-1}\left<\KPD\right>} = \left<\KPA\right> \);
let us repeat it once again:
%
\begin{equation*}
    \frac{\left<\KPB\right>}{A\left<\KPC\right> + A^{-1}\left<\KPD\right>}
        = \left<\KPA\right>
\end{equation*}
%

Also work: \( 2^{\left<\KPB\right>} \) and \( 2^{2^{\left<\KPB\right>}} \).

\end{document}

它产生的输出如下:

上述代码的输出

答案3

以下是我的做法:

\documentclass{article}
\usepackage{amssymb}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{knots}
\tikzset{knot/.style={double=#1,double distance=1pt,line width=2pt,white}}

\begin{document}
\begin{enumerate}
\item \(\langle \tikz[baseline=-.8ex] \draw[knot,double=Red] (0,0) circle (1ex); \rangle = 1\)
\item \(\langle \tikz[baseline=-.8ex] \node[knot under cross,knot,draw,double=Red] {}; \rangle = A \langle \tikz[baseline=-.8ex] \node[knot vert,knot,draw,double=Red] {}; \rangle + A^{-1} \langle \tikz[baseline=-.8ex] \node[knot horiz,knot,draw,double=Red] {}; \rangle\)
\item \(\langle  \tikz[baseline=-.8ex] \draw[knot,double=Red] (0,0) circle (1ex); \cup L \rangle = (-A^2 - A^{-2}) \langle L \rangle\)
\end{enumerate}
\end{document}

它看起来有点不同,因为我使用直线而不是曲线。

考夫曼括号恒等式

相关内容