我试图将幻灯片分成两个水平部分,顶部包含左上角的数学表达式,底部包含两列,列出表达式的应用。但是,当我尝试以下代码时,会出现一些重叠。我该如何解决这个问题?我为 tikzpicture 尝试了许多不同的环境;块、迷你页面等,但都出现了同样的问题。代码如下。
\documentclass{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{tikzmark, calc,decorations.pathmorphing,patterns}
\usetikzlibrary{arrows.meta, positioning, quotes}
\tikzstyle{every picture}+=[remember picture, overlay]
\usetikzlibrary{overlay-beamer-styles}
%% start
\begin{document}
\begin{frame}[t]{Applications}
\begin{minipage}{.45\textwidth}
\begin{tikzpicture}[remember picture,
optimization problem/.style = {%
rounded corners,
fill=gray!10,
inner ysep=2pt,
inner xsep=1pt,
align = center
},
information text/.style={%
rounded corners,
fill=blue!10,
inner ysep=2pt,
inner xsep=1pt,
align = center
}
]
\draw node[below right=1 cm and 0.5cm of current page.north west, opacity=0.3, style=optimization problem] (prob)
{
$
\begin{array}{ll}
\textup{minimize} & \mu \\
\textup{subject to} & f(\mu)\leq 1.
\end{array}
$
};
\end{tikzpicture}
\end{minipage}
\begin{minipage}{.45\textwidth}
\begin{columns}
\begin{column}{0.4\textwidth}
\begin{itemize}
\item first
\item second
\item third
\end{itemize}
\end{column}
\hfill
\begin{column}{0.4\textwidth}
\begin{itemize}
\item first
\item second
\item third
\end{itemize}
\end{column}
\end{columns}
\end{minipage}
\end{frame}
\end{document}
答案1
不太清楚您期望代码产生什么结果以及为什么需要幻灯片上的图像绝对定位。重新排列文档序言后,删除演示文稿中每幅图像和幻灯片上第一幅图像的绝对定位minipage
,我得到以下结果:
制作方:
\documentclass{beamer}
\mode<presentation>
{
% \usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
% \usecolortheme{default} % or try albatross, beaver, crane, ...
% \usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{arrows, arrows.meta,
backgrounds,
calc,
decorations.pathmorphing,
patterns, positioning,
quotes,
shapes,
tikzmark
}
%\tikzstyle{every picture}+=[remember picture, overlay]
\usetikzlibrary{overlay-beamer-styles}
%% start
\begin{document}
\begin{frame}[t]{Applications}
\tikzset{base/.style = {}
}
\begin{tikzpicture}[
optimization problem/.style = {rounded corners, fill=gray!10, opacity=0.3,
inner ysep=2pt, inner xsep=1pt,
align=center},
]
\node[optimization problem] (prob)
{$\begin{array}{ll}
\text{minimize} & \mu \\
\text{subject to} & f(\mu)\leq 1.
\end{array}$};
\end{tikzpicture}
\begin{minipage}{.45\textwidth}
\begin{columns}
\begin{column}{0.4\linewidth}
\begin{itemize}
\item first
\item second
\item third
\end{itemize}
\end{column}
\hfill
\begin{column}{0.4\linewidth}
\begin{itemize}
\item first
\item second
\item third
\end{itemize}
\end{column}
\end{columns}
\end{minipage}
\end{frame}
\end{document}
如您所见,幻灯片上没有任何内容与其元素重叠。
在我看来,更明智的做法是删除第二个列表minipage
,这样可以为两个列表腾出更多的(水平)空间: