arrows.meta 在编译过程中卡住

arrows.meta 在编译过程中卡住

为了使用隐形形状的箭头,我在序言中添加了这一点

\usetikzlibrary{shapes,arrows,chains,positioning,calc}
\usetikzlibrary{arrows.meta}

编译的时候,控制台卡住 (C:\MiKTex\tex\generic\pgf\frontendlayer\tikz\libraries\tikzlibraryautomata.code.tex) ,没有错误信息。

梅威瑟:

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,chains,positioning,calc}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}[scale=8]\centering
\usetikzlibrary{automata,positioning}
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           very thick,
           text width=6.5em,
           minimum width = 5em,
           minimum height=4em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}


\node [punkt, draw = blue] at (0,0) {$x>y$};
\node [punkt, draw = red] at (0.8, 0) {$x<y$};

%
 \node[] at (0.15, 0.03) (0up) {};
 \node[] at (0.65, 0.03) (1up) {};
 \path (0up) edge[pil, bend left=15] node [above] {A} (1up);

 \node[] at (0.15, -0.03) (0down) {};
 \node[] at (0.65, -0.03) (1down) {};
 \path (1down) edge[pil, bend left=15] node [below] {B} (0down);

\end{tikzpicture}

\end{document}

我的问题是 MWE 本身运行良好,但将相同的代码添加到我原来的 tex 文件中会导致上述问题。

更新:终于找到了“MnonWE”:

\documentclass[11pt]{article}
\usepackage{commath}
\usepackage{tikz}

% arrows in tikz
\usetikzlibrary{shapes,arrows,chains,positioning,calc}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}[scale=8]
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           very thick,
           text width=6.5em,
           minimum width = 5em,
           minimum height=4em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}


\node [punkt, draw = blue] at (0,0) {$\forall i:x_i>y_i$};
\node [punkt, draw = red] at (0.8, 0) {$\forall i:x_i<y_i$};
%
 \node[] at (0.15, 0.03) (0up) {};
 \node[] at (0.65, 0.03) (1up) {};
 \path (0up) edge[pil, bend left=15] node [above] {A} (1up);

 \node[] at (0.15, -0.03) (0down) {};
 \node[] at (0.65, -0.03) (1down) {};
 \path (1down) edge[pil, bend left=15] node [below] {B} (0down);

\end{tikzpicture}
\end{document}

\usepackage{commath}因此,仅当包含在前言中并$\forall i:x_i>y_i$在 \node 中使用时,文件才会编译失败。

答案1

我正在测试整洁@hpekristiansen MWE

\documentclass{article}
\usepackage{commath}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}
        \node {$:$};
    \end{tikzpicture}
\end{document}

问题在于此代码片段commath.sty(大约第 280 行):

% Fix alignment of := in mathmode
\mathchardef\ordinarycolon\mathcode`\:
\mathcode`\:=\string"8000
\begingroup \catcode`\:=\active
   \gdef:{\mathrel{\mathop\ordinarycolon}}
\endgroup

这会循环显示节点文本(不确定为什么)。可能应该通知软件包作者,看他们能否修复它。

暂时,您可以将文件复制commath.sty到当前目录,并删除这些行。

然后它应该可以正常工作,即使你失去了调整:=(无论如何我都会用另一种方式来做;玩数学代码和猫代码,正如你所见,是危险的。它肯定也会做一些有趣的事情babel)。

相关内容