istgame 错误在正确的代码上

istgame 错误在正确的代码上

代码:

\documentclass[12pt]{article}
\usepackage{istgame}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta, positioning}
\usepackage{enumitem}
\usepackage{float}
\usepackage[margin=1in]{geometry} 
\usepackage{amsmath}
\begin{document}
    \begin{figure}[H]
        \centering
        \begin{istgame}[scale = 0.85, transform shape] %Cause of error
            \setistNewNodeStyle{max}
            [regular polygon, regular polygon sides = 3]{1.75cm}
            \setistNewNodeStyle{maxTerm}
            [regular polygon, regular polygon sides = 3, dashed]{1.75cm}
            \setistNewNodeStyle{min}
            [regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.75cm}
            \def\distFactor{25};
            \xtdistance{\distFactor mm}{4*\distFactor mm}
            \istroot(bd)[max]<center>{$bd$}
            \istb \istb \endist
            \xtdistance{\distFactor mm}{2*\distFactor mm}
            \istroot(cd)(bd-1)[min]<center>{$cd$}
            \istb \istb \istb \endist
            \xtdistance{\distFactor mm}{\distFactor mm}
            \istroot(ce)(cd-1)[max]<center>{$ce$}
            \istb \istb \endist
            \istroot(de)(ce-1)[min]<center>{$de$}
            \istb \endist
            \istroot(dd)(de-1)[maxTerm]<center>{$dd$} \endist
            \istroot(be)(ce-2)[min]<center>{$be$} 
            \istb \endist
            \istroot(bdRepeat)(be-1)[max]<center>{$bd$} 
            \istbt{}{-1} \istbt{}{0} \endist %Error
        \end{istgame}
    \end{figure}
    \begin{figure}[H]
        \centering
        \begin{istgame}
            \setistNewNodeStyle{max}
            [regular polygon, regular polygon sides = 3]{1.75cm}
            \setistNewNodeStyle{min}
            [regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.75cm}
            \setistNewNodeStyle{chance}
            [circle]{1.2cm}
            %\xtShowTerminalNodes[box node, minimum size = 1cm]
            \def\distFactor{20};
            \xtdistance{\distFactor mm}{4*\distFactor mm}
            \setxtarrowtips[blue, thick]
            \istroot(0)[max]<center, blue>{1.5}
            \istb[blue, ->-] \istb \endist
            \xtdistance{\distFactor mm}{2*\distFactor mm}
            \istroot(1)(0-1)[chance]<center, purple>{1.5}
            \istb{0.5}[al] \istb{0.5}[ar] \endist
            \istroot(2)(0-2)[chance]<center, purple>{$-0.5$}
            \istb{0.5}[al] \istb{0.5}[ar] \endist
            \xtdistance{\distFactor mm}{\distFactor mm}
            \istroot(3)(1-1)[min]<center, red>{2}
            \istbt{}{2} \istbt{}{2} \endist
            \istroot(4)(1-2)[min]<center, red>{1}
            \istbt{}{1} \istbt{}{2} \endist
            \istroot(5)(2-1)[min]<center, red>{0}
            \istbt{}{0} \istbt{}{2} \endist
            \istroot(6)(2-2)[min]<center, red>{$-1$}
            \istbt{}{-1} \istbt{}{0} \endist
        \end{istgame}
    \end{figure}
\end{document}

错误信息:

Package PGF Math Error: Unknown function `south' (in 'south'). \istbt{}{-1} \istbt{}{0} \endist

输出:

在此处输入图片描述

语法正确,但注释行却出现错误%Error。这是怎么回事?

编辑:如果我注释掉该[scale = 0.85, transform shape]部分,则不会出现错误。那么为什么会抛出错误呢?

答案1

我不会使用transform shape(特别是,不作为环境选项),因为指定了最小大小。如果需要使用,transform shape您可以在(不作为环境选项)的每个定义中使用它,NewNodeStyle如下所示:

\begin{istgame}[scale = 0.85] %%, transform shape] %Cause of error
    \setistNewNodeStyle{max}
    [regular polygon, regular polygon sides = 3, 
    transform shape]{1.75cm}
    \setistNewNodeStyle{maxTerm}
    [regular polygon, regular polygon sides = 3, dashed, 
    transform shape]{1.75cm}
    \setistNewNodeStyle{min}
    [regular polygon, regular polygon sides = 3, shape border rotate = 180, 
    transform shape]{1.75cm}
    ...

相关内容