我尝试在 Latex 中显示 Tikzpicture:
\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\title{My Figure Problem}
\begin{document}
\maketitle
\section{Placeholder Text 1}
\lipsum[1]
\begin{figure}[h!]\centering
\begin{tikzpicture}[transform canvas = {scale=4.0}]
\draw (0,0) ellipse (10pt and 20pt);
\end{tikzpicture}
\caption{Picture of a Elipse.}
\end{figure}
text continues here.
\section{Placeholder Text 2}
\lipsum[1]
\end{document}
但是 Tikzpicture 不占用空间并且显示在文本后面:
如果我用普通图形替换 tikzpicture,一切都会正常。我该如何解决这个问题?