更新至 TeXLive 2014 后,“Hobby” 库停止工作

更新至 TeXLive 2014 后,“Hobby” 库停止工作

升级到 TeXLive 2014 后,使用该hobby库准备的 TikZ 图片编译停止工作。

考虑以下 MWE:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{hobby,positioning}

\begin{document}
    \begin{tikzpicture}[%
        scale=1, 
        % circlenodes/.style={circle, draw, font=\footnotesize},
        circlenodes/.style={circle, draw, font=\footnotesize, inner sep=0.1em,
            minimum width=1.5em},
        % midnodes/.style={midway, circle, fill=white, font=\tiny},
        midnodes/.style={midway, font=\tiny, above},
        >=latex,
        ]
        \fill[gray!20](-3, 3) to[curve through={%
            (-2, 1.5) (0,0) (0.5, 0.5) (1, 1.5) (3,3) 
        }] (4, 4) --(4,-0.5) -- (-3, -0.5) -- (-3, 3);
        \draw[thick, ->] (-3,-0.5) -- (4, -0.5) node[at end, anchor=west] {$tgo$};
        \draw[thick, ->] (-3,-0.5) -- (-3, 4) node[at end, anchor=south] {$J(tgo)$};
        \draw[very thick] (-3, 3) to[curve through={%
            (-2, 1.5) (0,0) (0.5, 0.5) (1, 1.5) (3,3) 
        }] (4, 4);
        \node[circlenodes, fill=red!20] (one) at (-3,3) {$a_0$};
        \node[circlenodes, fill=green!20, below=0pt of one] (a1) {$a_1$};
        \node[circlenodes, fill=yellow!20] (five)  at (-2,1.5) {$a_2$};
        \node[circlenodes, fill=blue!20, below=0pt of five] (a3) {$a_3$};
        \node[circlenodes, below=0pt of one] {$a_1$};
        \node[circlenodes, fill=red!20] (three) at (0.5,0.5) {$c_0$};
        \node[circlenodes, fill=green!20, right=0pt of three] (c1) {$c_1$};
        \node[circlenodes, fill=yellow!20, right=0pt of c1] (c2) {$c_2$};
        \node[circlenodes, fill=blue!20, right=0pt of c2] (c3) {$c_3$};
        \node[circlenodes, fill=green!20] (four)  at (3,3) {$b_1$};
        \node[circlenodes, fill=yellow!20, below=0pt of four] (b2) {$b_2$};
        \node[circlenodes, fill=blue!20,] (six)   at (1,1.5) {$b_3$};
        \node[circlenodes, fill=red!20] (two)  at (4,4) {$b_0$};
        \path[->] (two) edge[bend left=30]  node[midnodes] {1} (four);
        \path[->] (b2) edge[bend left=30] node[midnodes] {3} (six);
        \path[->] (a1) edge[bend right=30] node[midnodes] {2} (five);
    \end{tikzpicture}
\end{document}

编译器会给出以下错误消息lualatex

! Undefined control sequence.
<argument> \fp_if_undefined:NTF 
                     \l_hobby_out_angle_fp {\array_put:Nnx \l_hobby_matrix_b_ar
l.18         }] (4, 4)
                     --(4,-0.5) -- (-3, -0.5) -- (-3, 3);
? 

随着最后期限的临近,我开始紧张起来:-)。有位智者可能会说:“永远不要改变正在运行的系统。”我应该听从他的建议,但我还是这样:

您知道如何修复这个问题吗?

答案1

此问题现已在以下版本中修复:hobby在 CTAN 上,并且更改已传播至 TeXLive 14(对于 MikTeX 我无法说)。

如果您有旧版本,请参阅 egreg 的帖子。

答案2

该函数\fp_if_undefined:NTF(及其同类函数)几个月前就被弃用了,并从expl3套件的最新版本中删除。不幸的是,hobby没有及时更新。

您可以通过以适当的方式定义现在不存在的函数来暂时解决该问题:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{hobby,positioning}

\ExplSyntaxOn
\cs_set_eq:NN \fp_if_undefined:NTF \cs_if_free:NTF
\cs_set_eq:NN \fp_if_undefined:NT \cs_if_free:NT
\ExplSyntaxOff

经过检查,hobby.code.tex它们似乎是唯一需要提供的功能。

相关内容