如何将 TikZ + standalone 创建的图形放入 mdframed 创建的示例默认框架内?

如何将 TikZ + standalone 创建的图形放入 mdframed 创建的示例默认框架内?

尝试将 TikZ + 创建的图形放入由 创建的框架standalone内时出现错误。exampledefaultmdframed

以下是主要代码:

\documentclass{book}

\usepackage{tikz}
\usepackage{standalone}

\usepackage{mdframed}
\mdfdefinestyle{exampledefault}{linewidth=2pt}
\newtheorem{my_definition}{DEFINITION}

\begin{document}

\begin{mdframed}[style=exampledefault]
\begin{my_definition}\textbf{[My Definition]:}\label{mine}
Let us see the figure below:

\begin{figure}[h!]
\begin{center}
\includestandalone[width=.5\textwidth]{simple_figure}
\caption{Line description.}
\label{my_fig}
\end{center}
\end{figure}

\end{my_definition}
\end{mdframed}

\end{document}

下面是图片代码:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [line width=1](-2.5,-2) rectangle (2.5,2) (2.5,2) node [above] {$U$};
\draw [line width=1] (-.5,0) circle (1) (-.5,1) node [above] {$A$} ;
\end{tikzpicture}
\end{document}

最后下面是错误:

! LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.16 \begin{figure}[h!]
                       
?

相关内容