我使用的是嵌套项目,但是我需要的是方程式应该以与上一个项目中的文本相同的方式出现。这意味着方程式和使用时间项目符号应该具有相同的空间以使文档保持良好状态。提前致谢
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\let\olditem\item
\renewcommand{\item}{%
\olditem\vspace{8pt}}
\usetheme{Warsaw}
\addtobeamertemplate{block begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block alerted begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block example begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
\usecolortheme[named=UBCblue]{structure}
\begin{frame}
\frametitle{AAAAAA}
\begin{itemize}
\item Electricity pricing tariff
\begin{itemize}
\item Time of use (TOU) pricing scheme
\end{itemize}
\item Cost function
\begin{itemize}
\item \begin{equation} YU_T=\sum_{{t}=1}^{\mathcal{T}}\sum_{\mathcal{A}=1}^{\mathcal{A_S}}\bigg(\mathcal{E}(t)\times \pi(t)\times\gamma(t)
\bigg).
\end{equation}
\end{itemize}
\end{itemize}
答案1
我建议您更改为内联数学模式。因此,更改
\item \begin{equation} YU_T=\sum_{{t}=1}^{\mathcal{T}}\sum_{\mathcal{A}=1}^{\mathcal{A_S}}
\bigg(\mathcal{E}(t)\times \pi(t)\times\gamma(t)\bigg).
\end{equation}
到
\item $\displaystyle YU_T=\sum_{{t}=1}^{\mathcal{T}}\sum_{\mathcal{A}=1}^{\mathcal{A_S}}
\Bigl(\mathcal{E}(t)\times \pi(t)\times\gamma(t)\Bigr)$.
请注意,我还建议将括号的大小从 减小\bigg
到\Big
(甚至只是\big
)。
附录回应 OP 的后续评论:据我所知,这三个\addtobeamertemplate
指令不影响行距。(当然,它们不会影响您显示的框架中的行距。如前所述,这三个指令只是将的长度设置\textwidth
为相等1\textwidth
,即它们似乎根本没有做任何有意义的事情。)
如果你不想要 redefined 指令提供的大行距\item
,那么就使用\olditem
。下面截图的上半部分显示了使用 产生的间距\item
,下半部分显示了使用 的线条效果\olditem
。
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Warsaw}
% \usepackage{amsmath} % 'amsmath'mis loaded automatically by 'beamer'
% \usepackage[utf8]{inputenc} % that's the default
\let\olditem\item
\renewcommand{\item}{\olditem\vspace{8pt}}
%% I've deliberately commented out the next three lines:
%\addtobeamertemplate{block begin}{\setlength{\textwidth}{1\textwidth}}{}
%\addtobeamertemplate{block alerted begin}{\setlength{\textwidth}{1\textwidth}}{}
%\addtobeamertemplate{block example begin}{\setlength{\textwidth}{1\textwidth}}{}
\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
\usecolortheme[named=UBCblue]{structure}
\begin{document}
\begin{frame}{AAAAAA}
\textcolor{red}{Using \texttt{\string\item}}
\begin{itemize}
\item Electricity pricing tariff
\begin{itemize}
\item Time of use (TOU) pricing scheme
\end{itemize}
\item Cost function
\begin{itemize}
\item $\displaystyle YU_T=\sum_{{t}=1}^{\mathcal{T}}
\sum_{\mathcal{A}=1}^{\mathcal{A_S}}
\bigl(\mathcal{E}(t)\times \pi(t)\times\gamma(t)\bigr)$.
\end{itemize}
\end{itemize}
\bigskip
\textcolor{red}{Using \texttt{\string\olditem}}
\begin{itemize}
\olditem Electricity pricing tariff
\begin{itemize}
\olditem Time of use (TOU) pricing scheme
\end{itemize}
\olditem Cost function
\begin{itemize}
\olditem $\displaystyle YU_T=\sum_{{t}=1}^{\mathcal{T}}
\sum_{\mathcal{A}=1}^{\mathcal{A_S}}
\bigl(\mathcal{E}(t)\times \pi(t)\times\gamma(t)\bigr)$.
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
答案2
为什么不简单地将您的方程式转换为与 \displaystyle 内联?
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\let\olditem\item
\renewcommand{\item}{%
\olditem\vspace{8pt}}
\usetheme{Warsaw}
\addtobeamertemplate{block begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block alerted begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block example begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
\usecolortheme[named=UBCblue]{structure}
\begin{document}
\begin{frame}
\frametitle{AAAAAA}
\begin{itemize}
\item Electricity pricing tariff
\begin{itemize}
\item Time of use (TOU) pricing scheme
\end{itemize}
\item Cost function
\begin{itemize}
\item $\displaystyle{YU_T=\sum_{{t}=1}^{\mathcal{T}}\sum_{\mathcal{A}=1}^{\mathcal{A_S}}\bigg(\mathcal{E}(t)\times \pi(t)\times\gamma(t)
\bigg)}$
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
答案3
如果您想要一个方程编号,请以minipage
相应大小的 a 开始该项目:
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\let\olditem\item
\renewcommand{\item}{%
\olditem\vspace{8pt}}
\usetheme{Warsaw}
\addtobeamertemplate{block begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block alerted begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\addtobeamertemplate{block example begin}{%
\setlength{\textwidth}{1\textwidth}%
}{}
\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
\usecolortheme[named=UBCblue]{structure}
\begin{document}
\begin{frame}
\frametitle{AAAAAA}
\begin{itemize}
\item Electricity pricing tariff
\begin{itemize}
\item Time of use (TOU) pricing scheme
\end{itemize}
\item Cost function
\begin{itemize}
\item \begin{minipage}{\linewidth}\begin{equation} YU_T=\sum_{{t}=1}^{\mathcal{T}}\sum_{\mathcal{A}=1}^{\mathcal{A_S}}\bigg(\mathcal{E}(t)\times \pi(t)\times\gamma(t)
\bigg).
\end{equation}
\end{minipage}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}