\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}