以下是 MWE
\documentclass[xcolor=dvipsnames]{beamer} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \begin{document} \begin{frame} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.695cm,y=0.685cm] \clip(-1.72,-5.46) rectangle (21.28,5.38); \draw (3.54,1.5) ellipse (2.02cm and 2cm); \draw (8.24,1.82) ellipse (2.11cm and 2.08cm); \end{tikzpicture} \begin{itemize} \item $B_\alpha$ \end{itemize} \end{frame} \end{document}
编译上述 tex 时,我们发现 tikzpicture 和文本之间存在巨大差距。 如何减少这个差距? 我对 tikzpicture 不太熟悉。有什么帮助和建议吗?
答案1
要将上述评论放入答案中,代码将如下所示。
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{frame}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.695cm,y=0.685cm]
% \clip(-1.72,-5.46) rectangle (21.28,5.38);
\draw (3.54,1.5) ellipse (2.02cm and 2cm);
\draw (8.24,1.82) ellipse (2.11cm and 2.08cm);
\end{tikzpicture}
\begin{itemize}
\item $B_\alpha$
\end{itemize}
\end{frame}
\end{document}
如果您尝试将图片水平居中(这只是我的想法),通过剪辑最好使用如下方法:
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.695cm,y=0.685cm]
% \clip(-1.72,-5.46) rectangle (21.28,5.38);
\draw (3.54,1.5) ellipse (2.02cm and 2cm);
\draw (8.24,1.82) ellipse (2.11cm and 2.08cm);
\end{tikzpicture}
\end{center}
\begin{itemize}
\item $B_\alpha$
\end{itemize}
\end{frame}
\end{document}