我想在同一张幻灯片上放置两个公式,一个在右边,一个在左边。但是不行。有人能帮忙吗?这是我使用的代码:
\begin{frame}
\frametitle{NM - Negative-Multinomial}
\begin{itemize}
\item Generalization of the Negative Binomial when multiple outcomes are considered.
\end{itemize}
\begin{align}
P(\bm{Y}=\bm{y}) = \binom{\beta+m-1}{m}\binom{m}{\bm{y}}\prod_{j=1}^p \pi_j^{y_j}\pi_{p+1}^{\beta}, \label{eq: NM}
\end{align}
Parameters are $(\bm{\pi}, \beta)=(\pi_1, \dots, \pi_{p+1}, \beta)$, $\sum_{j=1}^{p+1}\pi_j=1$, $\beta>0$, $m$ is the size and $\pi_{p+1}=1-\sum_{j=1}^p \pi_j$ is the probability of a failure.
\noindent{
\begin{minipage}[c]{0.38\linewidth}
\leavevmode
\vskip 0pt
\vskip -\baselineskip
\begin{equation}
E[\textbf{Y}] = \beta\frac{\bm{\pi}}{\pi_{p+1}} \nonumber
\end{equation}
\end{minipage}}
\hfill{%
\begin{minipage}[c]{0.38\linewidth}
\leavevmode
\vskip 0pt
\vskip -\baselineskip
\begin{equation}
Var[\textbf{Y}] = \frac{\beta}{\pi_{p+1}^2}\bm{\pi}\bm{\pi}'+\frac{\beta}{\pi_{p+1}}diag(\bm \pi) \nonumber
\end{equation}
\end{minipage}}
\begin{itemize}
\item Fitted via ML by an iteratively reweighted Poisson regression.
\end{itemize}
\end{frame}
答案1
对于当前的情况,无需设置minipage
环境来将方程式并排放置。相反,只需\qquad
在它们之间插入一个间隔即可。
我也会使用单一itemize
环境,并且我会替换align
它,equation
因为没有什么可以跨行对齐。
\documentclass{beamer}
% define a few math operators:
\DeclareMathOperator{\E}{E}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\diag}{diag}
\usepackage{bm}
\begin{document}
\begin{frame}
\frametitle{NM -- Negative Multinomial}
\begin{itemize}
\item Generalization of the Negative Binomial when multiple outcomes are considered.
\begin{equation}\label{eq: NM}
P(\bm{Y}=\bm{y}) = \binom{\beta+m-1}{m}\binom{m}{\bm{y}}
\prod_{j=1}^p \pi_j^{y_j}\pi_{p+1}^{\beta}\,.
\end{equation}
Parameters are $(\bm{\pi}, \beta)=(\pi_1, \dots, \pi_{p+1}, \beta)$, $\sum_{j=1}^{p+1}\pi_j=1$, $\beta>0$, $m$~is the size, and $\pi_{p+1}=1-\sum_{j=1}^p \pi_j$ is the probability of failure.
\begin{equation*}
\E[\textbf{Y}] = \beta\frac{\bm{\pi}}{\pi_{p+1}}
\qquad
\Var[\textbf{Y}] =
\frac{\beta}{\pi_{p+1}^2}\bm{\pi}\bm{\pi}'
+\frac{\beta}{\pi_{p+1}}\diag(\bm \pi)
\end{equation*}
\item Fitted via ML by an iteratively reweighted Poisson regression.
\end{itemize}
\end{frame}
\end{document}