![如何使用 tikzpicture 和 wrapfigure 并在 beamer 框架上获取图片周围的文字](https://linux22.com/image/322873/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20tikzpicture%20%E5%92%8C%20wrapfigure%20%E5%B9%B6%E5%9C%A8%20beamer%20%E6%A1%86%E6%9E%B6%E4%B8%8A%E8%8E%B7%E5%8F%96%E5%9B%BE%E7%89%87%E5%91%A8%E5%9B%B4%E7%9A%84%E6%96%87%E5%AD%97.png)
我尝试了以下方法,但现在最后一行不再显示在页面上了……我希望能够在图片周围添加文字(因此使用环绕图),缩放图片,并使用 tikz(由 GeoGebra 生成的代码)。但文字不在图片周围,所以我丢失了最后一行……有人吗?提前非常感谢
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usecolortheme{albatross}
\usepackage{gnuplottex}
\usepackage{pgfplots}
\usepackage{color}
\usepackage{gensymb}
\usepackage{pgf,tikz}
\usepackage{MnSymbol,wasysym}
\usepackage[utf8]{inputenc}
\setbeamertemplate{navigation symbols}{} % Remove navigation symbols
\begin{document}
\setbeamercolor{background canvas}{bg=blue}
\setbeamercolor{title}{fg=yellow}
\setbeamercolor{frametitle}{fg=yellow}
\setbeamercolor{itemize/enumerate body}{fg=white}
\setbeamercolor{local structure}{fg=white}
\color{white}
\setlength{\parindent}{0pt}
%\setlength{\headheight}{15pt}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frame
{
\frametitle{Theorie B (12)}
De lijn CD heb ik weer doorgetrokken naar E, het snijpunt met de cirkel. En ik kan hier weer melden dat $\angle A + \angle E = 180\degree$ en $\angle D + \angle B = 180\degree$ omdat A,B,D en E op de cirkel liggen en een koordenvierhoek vormen.\\
\resizebox{5.0cm}{!}{}
\begin{wrapfigure}%{r}{0pt} %[bla] is de hoogte in lijnen, {bla} is de uitlijning (links, centre of rechts reps l,c,r,
%\vspace{-12pt} %\vspace maakt extra of minder ruimte om het plaatje
%\hspace{5pt}
% \begin{center}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-5.39,-5.34) rectangle (20.22,7.85);
\draw [shift={(5.24,3.97)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (120.19:0.45) arc (120.19:191.53:0.45) -- cycle;
\draw [shift={(5.24,3.97)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (92.9:0.45) arc (92.9:120.19:0.45) -- cycle;
\draw [shift={(1.88,6.07)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (-85.72:0.45) arc (-85.72:-4.36:0.45) -- cycle;
\draw(3.43,4.8) circle (2cm);
\draw (2.09,3.32)-- (5.24,3.97);
\draw (2.09,3.32)-- (1.88,6.07);
\draw (1.88,6.07)-- (5.15,5.82);
\draw (1.88,6.07)-- (4.12,5.9);
\draw (4.12,5.9)-- (5.24,3.97);
\draw (5.15,5.82)-- (5.24,3.97);
\begin{scriptsize}
\fill [color=xdxdff] (2.09,3.32) circle (1.5pt);
\draw[color=xdxdff] (1.8,3.23) node {$A$};
\fill [color=xdxdff] (5.24,3.97) circle (1.5pt);
\draw[color=xdxdff] (5.51,4.05) node {$B$};
\fill [color=xdxdff] (1.88,6.07) circle (1.5pt);
\draw[color=xdxdff] (1.63,6.29) node {$D$};
\fill [color=xdxdff] (5.15,5.82) circle (1.5pt);
\draw[color=xdxdff] (5.27,6.04) node {$E$};
\fill [color=xdxdff] (4.12,5.9) circle (1.5pt);
\draw[color=xdxdff] (4.25,6.11) node {$C$};
\end{scriptsize}
\end{tikzpicture}
% \end{center}
\end{wrapfigure}\\
$\angle ABC < \angle B$, dus $\angle D + \angle ABC < 180\degree$. \\
Verder geldt: $\angle A + \angle ABC + \angle C + \angle D = 360\degree$\\
Dus geldt ook $\angle A + \angle C > 180\degree$\\
C ligt dus binnen de cirkel.
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
答案1
主要问题是 tikzfigure 填满了整个页面。
由于颜色未定义,仍然存在大量错误。
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usecolortheme{albatross}
\usepackage{gnuplottex}
\usepackage{pgfplots}
\usepackage{color}
\usepackage{gensymb}
\usepackage{pgf,tikz}
\usepackage{MnSymbol,wasysym}
\usepackage{wrapfig}
\usepackage[utf8]{inputenc}
\setbeamertemplate{navigation symbols}{} % Remove navigation symbols
\usetikzlibrary{arrows.meta}
\begin{document}
\setbeamercolor{background canvas}{bg=blue}
\setbeamercolor{title}{fg=yellow}
\setbeamercolor{frametitle}{fg=yellow}
\setbeamercolor{itemize/enumerate body}{fg=white}
\setbeamercolor{local structure}{fg=white}
\color{white}
\setlength{\parindent}{0pt}
%\setlength{\headheight}{15pt}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Theorie B (12)}
De lijn CD heb ik weer doorgetrokken naar E, het snijpunt met de cirkel. En ik kan hier weer melden dat $\angle A + \angle E = 180\degree$ en $\angle D + \angle B = 180\degree$ omdat A,B,D en E op de cirkel liggen en een koordenvierhoek vormen.\\
\begin{wrapfigure}{r}{0pt}
\raisebox{0pt}[\dimexpr \height-.5cm]{% wrapfigure likes to add a big gap here
\begin{tikzpicture}[line cap=round,line join=round,>=Triangle,x=1.0cm,y=1.0cm]
%\clip(-5.39,-5.34) rectangle (20.22,7.85);
\draw [shift={(5.24,3.97)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (120.19:0.45) arc (120.19:191.53:0.45) -- cycle;
\draw [shift={(5.24,3.97)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (92.9:0.45) arc (92.9:120.19:0.45) -- cycle;
\draw [shift={(1.88,6.07)},color=qqwuqq,fill=qqwuqq,fill opacity=0.1] (0,0) -- (-85.72:0.45) arc (-85.72:-4.36:0.45) -- cycle;
\draw(3.43,4.8) circle (2cm);
\draw (2.09,3.32)-- (5.24,3.97);
\draw (2.09,3.32)-- (1.88,6.07);
\draw (1.88,6.07)-- (5.15,5.82);
\draw (1.88,6.07)-- (4.12,5.9);
\draw (4.12,5.9)-- (5.24,3.97);
\draw (5.15,5.82)-- (5.24,3.97);
\begin{scriptsize}
\fill [color=xdxdff] (2.09,3.32) circle (1.5pt);
\draw[color=xdxdff] (1.8,3.23) node {$A$};
\fill [color=xdxdff] (5.24,3.97) circle (1.5pt);
\draw[color=xdxdff] (5.51,4.05) node {$B$};
\fill [color=xdxdff] (1.88,6.07) circle (1.5pt);
\draw[color=xdxdff] (1.63,6.29) node {$D$};
\fill [color=xdxdff] (5.15,5.82) circle (1.5pt);
\draw[color=xdxdff] (5.27,6.04) node {$E$};
\fill [color=xdxdff] (4.12,5.9) circle (1.5pt);
\draw[color=xdxdff] (4.25,6.11) node {$C$};
\end{scriptsize}
\end{tikzpicture}}
\end{wrapfigure}
$\angle ABC < \angle B$, dus $\angle D + \angle ABC < 180\degree$. \\
Verder geldt: $\angle A + \angle ABC + \angle C + \angle D = 360\degree$\\
Dus geldt ook $\angle A + \angle C > 180\degree$\\
C ligt dus binnen de cirkel.
\WFclear% to avoid possible problems on the next page
\end{frame}
\end{document}