图形不接受线宽作为参数

图形不接受线宽作为参数
\documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13]{scrbook}

\usepackage{subfigure}
\usepackage{pgfplots} 
\usepackage{tikz-qtree}
\usepackage{subcaption}

\begin{document}

\tikzset{every tree node/.style={minimum width=2em,draw,circle},
         blank/.style={draw=none},
         edge from parent/.style=
         {draw, edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}},
         level distance=1.5cm}
\begin{figure}
    \centering
    \begin{subfigure}{\textwidth}
        \centering
        \begin{tikzpicture}
        \Tree
        [.*     
            [.A ] 
            [.* 
              [.B ]
             [.C ]
                ]
        ]
        \end{tikzpicture}
    \end{subfigure}
    \begin{subfigure}{\textwidth}
        \centering
        \begin{tikzpicture}
        \Tree
        [.*     
          [.* 
                [.A ]
                [.B ]] 
            [.C ]
        ]
        \end{tikzpicture}
    \end{subfigure}
    \caption{Expression trees for tensor-chain-multiplication}
    \label{fig:myExprTree}
\end{figure}
\end{document}

此命令不接受线宽或文本宽度作为参数,以及诸如此类的东西。这里出了什么问题?我想用 a 和 b 标记,但即使这样也不行...

或者更好的是,如果你有一个更快、更优雅的解决方案,这是我想要的最终产品,但不是正确的: 乳胶树无花果

答案1

不加载subfigure subcaption

\documentclass[11pt,a4paper,bibtotoc,idxtotoc,headsepline,footsepline,footexclude,BCOR12mm,DIV13]{scrbook}

\usepackage{pgfplots} 
\usepackage{tikz-qtree}
\usepackage{subcaption}

\begin{document}

    \tikzset{every tree node/.style={minimum width=2em,draw,circle},
        blank/.style={draw=none},
        edge from parent/.style=
        {draw, edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}},
        level distance=1.5cm}
    \begin{figure}[!htb]
        \centering
        \begin{subfigure}{\textwidth}
            \centering
            \begin{tikzpicture}
            \Tree
            [.*     
            [.A ] 
            [.* 
            [.B ]
            [.C ]
            ]
            ]
            \end{tikzpicture}
        \end{subfigure}
        \begin{subfigure}{\textwidth}
            \centering
            \begin{tikzpicture}
            \Tree
            [.*     
            [.* 
            [.A ]
            [.B ]] 
            [.C ]
            ]
            \end{tikzpicture}
        \end{subfigure}
        \caption{Expression trees for tensor-chain-multiplication}
        \label{fig:myExprTree}
    \end{figure}

    \begin{figure}[!htb]
    \centering
    \begin{subfigure}{0.49\textwidth}
        \centering
        \begin{tikzpicture}
        \Tree
        [.*     
        [.A ] 
        [.* 
        [.B ]
        [.C ]
        ]
        ]
        \end{tikzpicture}
    \end{subfigure}\hfill
    \begin{subfigure}{0.49\textwidth}
        \centering
        \begin{tikzpicture}
        \Tree
        [.*     
        [.* 
        [.A ]
        [.B ]] 
        [.C ]
        ]
        \end{tikzpicture}
    \end{subfigure}
    \caption{Expression trees for tensor-chain-multiplication}
    \label{fig:myExprTree}
\end{figure}
\end{document}

在此处输入图片描述

相关内容