中心优化问题公式化时遇到的问题

中心优化问题公式化时遇到的问题

我尝试使用 使整数规划公式居中\centering\begin{center}围绕\begin{align}环境,但公式似乎仍然向左偏移。我该如何将其与幻灯片的中心对齐?

以下是我的代码的一部分:

\documentclass{beamer}

\usetheme{CambridgeUS}

\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{items}[ball]
\setbeamercolor{title}{bg=red!65!black, fg=white}
\setbeamercolor{item projected}{bg=darkred}
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{navigation symbols}{}
\setbeamercovered{transparent}
\setbeamercolor{block title}{fg=darkred}
\setbeamercolor{local structure}{fg=darkred}
\usepackage[backend=bibtex]{biblatex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{lmodern}
\usepackage{algorithm2e}

\usepackage{etoolbox}
\AtBeginEnvironment{align}{\setcounter{equation}{0}}
\usepackage{chngcntr}
%\counterwithout{equation}{chapter} % remove the chapter number
\addbibresource{references.bib}
\title[Presentation Title]{Test}

% A subtitle is optional and this may be deleted
\subtitle{An Introduction}

\author{abc}



\date{PUT DATE HERE}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\begin{frame}{Outline}
  \tableofcontents
  % You might wish to add the option [pausesections]
\end{frame}

% Section and subsections will appear in the presentation overview
% and table of contents.
\section{First Main Section}

\subsection{First Subsection}

\begin{frame}{First Slide Title}{Optional Subtitle}
  \begin{itemize}
  \item {
    My first point.
  }
  \item {
    My second point.
  }
  \end{itemize}
\end{frame}

\subsection{Second Subsection}

\begin{frame}[shrink]{The Integer Programming Formulation}
\begin{align}
&\min \quad 
\sum_{t\in\mathcal{T}} \sum_{(i,j)\in A} d_{ij} x_{tij}\\
\text{s.t.}\quad
\sum_{o\in O} b_o z_{ot} &\leq B\alpha_t \quad && \forall t \in \mathcal{T}\\
\sum_{t\in \mathcal{T}} z_{ot} &= 1 \quad && \forall o\in O\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &\geq z_{ot} \quad && \forall o \in O, t\in \mathcal{T}, i:l(i)\in L_o\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &= \sum_{(i,j)\in \delta^-(i)} x_{tji} \quad && \forall i\in V, t\in \mathcal{T}\\
\sum_{(s,j)\in \delta^+(s)} x_{tsj} &= \sum_{(j,s)\in \delta^-(s)} x_{tjs} = \alpha_t \quad && \forall t\in \mathcal{T}\\
x_{tij} &\leq \alpha_t \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
z_{ot} &\leq \alpha_t \quad && \forall o\in , t\in \mathcal{T}\label{8}\\
\sum_{o\in O} z_{ot} &\geq \alpha_t \quad && t\in \mathcal{T}\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &= g_{ti} \quad && \forall i\in V, t\in \mathcal{T}\\
y_{ti} &\geq x_{tij} \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
\sum_{j\in W} g_{tj} &\geq y_{ti} + \sum_{(j,k)\in A(W)} x_{tjk} \quad && \forall i \in W, W \subseteq V \setminus \{s\},|W|>1, t\in\mathcal{T}\\
x_{tij} &\in \mathbb{B} \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
z_{ot} &\in \mathbb{B} \quad && \forall o\in O, t\in \mathcal{T}\\
0 \leq \alpha_t &\leq 1 \quad && t\in\mathcal{T}\\
y_{ti} &\leq \alpha_t \quad && \forall i\in V, t\in \mathcal{T}
\end{align}
\end{frame}

\end{document}

编译后的样子如下:

配方看起来向左冲

答案1

引自 Beamer 用户指南:

永远不要使用较小的字体大小来“适应框架”。永远不要使用邪恶的选项shrink

要将所有内容放在一张幻灯片上,甚至都\tiny不够小。我不建议这样做,但使用以下字体大小,你可以将其压缩到一帧中:

\documentclass{beamer}

\usetheme{CambridgeUS}

\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{items}[ball]
\setbeamercolor{title}{bg=red!65!black, fg=white}
\setbeamercolor{item projected}{bg=darkred}
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{navigation symbols}{}
\setbeamercovered{transparent}
\setbeamercolor{block title}{fg=darkred}
\setbeamercolor{local structure}{fg=darkred}
\usepackage[backend=bibtex]{biblatex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{mathtools}
\usepackage{amsthm}
%\usepackage{lmodern}
\usepackage{algorithm2e}

\usepackage{etoolbox}
\AtBeginEnvironment{align}{\setcounter{equation}{0}}
\usepackage{chngcntr}
%\counterwithout{equation}{chapter} % remove the chapter number
\addbibresource{references.bib}
\title[Presentation Title]{Test}

% A subtitle is optional and this may be deleted
\subtitle{An Introduction}

\author{abc}

\date{PUT DATE HERE}

\begin{document}

\begin{frame}{The Integer Programming Formulation}
\centering
\fontsize{4pt}{5pt}\selectfont
\begin{minipage}{.7\textwidth}
\begin{align}
&\min \quad 
\sum_{t\in\mathcal{T}} \sum_{(i,j)\in A} d_{ij} x_{tij}\\
\text{s.t.}\quad
\sum_{o\in O} b_o z_{ot} &\leq B\alpha_t \quad && \forall t \in \mathcal{T}\\
\sum_{t\in \mathcal{T}} z_{ot} &= 1 \quad && \forall o\in O\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &\geq z_{ot} \quad && \forall o \in O, t\in \mathcal{T}, i:l(i)\in L_o\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &= \sum_{(i,j)\in \delta^-(i)} x_{tji} \quad && \forall i\in V, t\in \mathcal{T}\\
\sum_{(s,j)\in \delta^+(s)} x_{tsj} &= \sum_{(j,s)\in \delta^-(s)} x_{tjs} = \alpha_t \quad && \forall t\in \mathcal{T}\\
x_{tij} &\leq \alpha_t \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
z_{ot} &\leq \alpha_t \quad && \forall o\in , t\in \mathcal{T}\label{8}\\
\sum_{o\in O} z_{ot} &\geq \alpha_t \quad && t\in \mathcal{T}\\
\sum_{(i,j)\in \delta^+(i)} x_{tij} &= g_{ti} \quad && \forall i\in V, t\in \mathcal{T}\\
y_{ti} &\geq x_{tij} \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
\sum_{j\in W} g_{tj} &\geq y_{ti} + \sum_{(j,k)\in A(W)} x_{tjk} \quad && \forall i \in W, W \subseteq V \setminus \{s\},|W|>1, t\in\mathcal{T}\\
x_{tij} &\in \mathbb{B} \quad && \forall (i,j)\in A, t\in \mathcal{T}\\
z_{ot} &\in \mathbb{B} \quad && \forall o\in O, t\in \mathcal{T}\\
0 \leq \alpha_t &\leq 1 \quad && t\in\mathcal{T}\\
y_{ti} &\leq \alpha_t \quad && \forall i\in V, t\in \mathcal{T}
\end{align}
\end{minipage}
\end{frame}

\end{document}

在此处输入图片描述

相关内容