删除公式前后的大空白

删除公式前后的大空白

我从乳胶代码中提取了以下内容来定义几个方程式:

\begin{equation}
    \min C =  \sum_{t=0}^{Z} (x_t \cdot P^{HPmax} + P_t^{DemandEl}) \cdot \Delta t \cdot p_t \label{eq:objective_function}
\end{equation}

subject to:

\begin{align}
    &T^{min} \leq T^{Building}_t \leq T^{max} \label{eq:temperature_balance} \\
    &T^{Building}_t = T^{Building}_{t-1} + \frac{Q_t^{HP} - Q_t^{DemandSH} -  Q_t^{LossesSH}}{V^{UFH} \cdot  \rho^{Concrete} \cdot c^{Concrete}} \label{eq:temperature_difference_equation} \\
    &Q_t^{HP} = x_t \cdot P^{HPmax}  \cdot COP_t \cdot \Delta t \label{eq:heating_energy_HP} \\
    &h^{switchedOff}_t \leq h^{on}_{t-1} \label{eq:hp_switched_off_1}  \\
    &h^{switchedOff}_t \leq 1 - h^{on}_{t} \label{eq:hp_switched_off_2}  \\
    &h^{switchedOff}_t \geq h^{on}_{t-1} - h^{on}_{t} \label{eq:hp_switched_off_3} \\
    &k_t^{switchedOff} =   \sum_{\tau=0}^{t} h_\tau^{switchedOff} \label{eq:hp_switched_off_4} \\
     &k^{switchedOff}_t \leq n^{switchedOff} \label{eq:hp_switched_off_5} \\
    &x_t \leq h^{on}_{t} \label{eq:hp_min_mod_1} \\
    &x_t \geq h^{on}_{t} \cdot mod^{min} \label{eq:hp_min_mod_2} \\
    &x_t \in [0,1], h^{switchedOff}_t \in \{0,1\}, h^{on}_{t} \in \{0,1\} \label{eq:non_negativity} 
\end{align}

最大的问题是,在第一个等式的前后,我分别定义,以便可以在其下方添加文本“subject to”,但有一大片空白,我想消除它。以下是屏幕截图: 在此处输入图片描述

我怎样才能减少空白空间?

更新:这是主要的 Latex 文件:

\documentclass[5p,times,twocolumn]{elsarticle}
\usepackage{physics}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{hidelinks}
\usepackage{csquotes}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{acro}
\include{sections/00_acro}
\graphicspath{{figures/}}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{float}
\usepackage{comment}
\usepackage{subcaption}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{nomencl} % Nomenclature package
\usepackage{xurl}
\usepackage{todonotes}

\usepackage{makecell}
\usepackage{afterpage}


%Test new equation system display
\usepackage[margin=2cm]{geometry}
\usepackage{mathtools,kantlipsum}
\newenvironment{AllowDisplayBreaks}{\allowdisplaybreaks}{\ignorespacesafterend}
\newcommand\stxt[1]{\scriptscriptstyle\textup{#1}}


%Define the color of the links
\usepackage{xcolor}
\usepackage{hyperref}

\definecolor{myColor}{RGB}{0, 0.0, 0} 

\hypersetup{
    colorlinks=true,
    linkcolor=myColor,
    citecolor=myColor,
    urlcolor=myColor,
}


\journal{Applied Energy}


% Remove preprint submitted to Applied Energy and the date
\makeatletter
\def\ps@pprintTitle{
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \def\@oddfoot{}%
  \let\@evenfoot\@oddfoot
}
\makeatother



\begin{document}

\begin{frontmatter}

\title{Title}


\author[1]{A}
\author[1]{B}


\address[1]{Address1}

\begin{abstract}
\input{sections/00_abstract}
\end{abstract}

\begin{comment}
%%Graphical abstract
\begin{graphicalabstract}
\includegraphics{grabs}
\end{graphicalabstract}

%%Research highlights
\begin{highlights}
\item Research highlight 1
\item Research highlight 2
\end{highlights}
\end{comment}

\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
keyword 1 \sep keyword 2 \sep keyword 3 \sep keyword 4 \sep keyword 5 
%% PACS codes here, in the form: \PACS code \sep code
%\PACS 0000 \sep 1111
%% MSC codes here, in the form: \MSC code \sep code
%% or \MSC[2008] code \sep code (2000 is the default)
%MSC 0000 \sep 1111
\end{keyword}

\end{frontmatter}

%% \linenumbers

\input{sections/00_nomecl}
\input{sections/01_intro}
\input{sections/02_related_work}
\input{sections/03_optimization_problem_for_the_building}
\input{sections/04_immitation_learning_for_building_control}
\input{sections/05_results}
\input{sections/06_conclusion}
\input{sections/ending}


\thispagestyle{empty} % Remove page number and header/footer on the first page


%% If you have bibdatabase file and want bibtex to generate the
%% bibitems, please use
%%
 \bibliographystyle{elsarticle-num} 
 \bibliography{refs}

%% else use the following coding to input the bibitems directly in the
%% TeX file.

% \begin{thebibliography}{00}

% %% \bibitem{label}
% %% Text of bibliographic item

% \bibitem{}

% \end{thebibliography}
\end{document}
\endinput
%%
%% End of file `elsarticle-template-num.tex'.

答案1

以下是我要做的(尽管我会使用较小的文本索引)

环境AllowDisplayBreaks只是为了让我们可以在本地添加它。提示:\\*不要使用分页符/分栏符。

我使用\stxt它来格式化文本上标,考虑到它们的大小,我选择使其更小。

\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{mathtools,kantlipsum}
\newenvironment{AllowDisplayBreaks}{\allowdisplaybreaks}{\ignorespacesafterend}
\newcommand\stxt[1]{\scriptscriptstyle\textup{#1}}
\begin{document}

% just to force a column break

\vspace*{12cm}

\kant[2]

\begin{equation}
    \min C =  \sum_{t=0}^{Z} (x_t \cdot P^{\stxt{HPmax}} + P_t^{\stxt{DemandEl}}) \cdot \Delta t \cdot p_t \label{eq:objective_function}
\end{equation}
%
subject to:
%
\begin{AllowDisplayBreaks}
  \begin{align}
    &T^{\stxt{min}} \leq T^{\stxt{Building}}_t \leq T^{\stxt{max}} \label{eq:temperature_balance} \\
    &T^{\stxt{Building}}_t = T^{\stxt{Building}}_{t-1} + \frac{Q_t^{\stxt{HP}} - Q_t^{\stxt{DemandSH}} -  Q_t^{\stxt{LossesSH}}}{V^{\stxt{UFH}} \cdot  \rho^{\stxt{Concrete}} \cdot c^{\stxt{Concrete}}} \label{eq:temperature_difference_equation} \\
    &Q_t^{\stxt{HP}} = x_t \cdot P^{\stxt{HPmax}}  \cdot COP_t \cdot \Delta t \label{eq:heating_energy_HP} \\
    &h^{\stxt{switchedOff}}_t \leq h^{\stxt{on}}_{t-1} \label{eq:hp_switched_off_1}  \\
    &h^{\stxt{switchedOff}}_t \leq 1 - h^{\stxt{on}}_{t} \label{eq:hp_switched_off_2}  \\
    &h^{\stxt{switchedOff}}_t \geq h^{\stxt{on}}_{t-1} - h^{\stxt{on}}_{t} \label{eq:hp_switched_off_3} \\
    &k_t^{\stxt{switchedOff}} =   \sum_{\tau=0}^{t} h_\tau^{\stxt{switchedOff}} \label{eq:hp_switched_off_4} \\
    &k^{\stxt{switchedOff}}_t \leq n^{\stxt{switchedOff}} \label{eq:hp_switched_off_5} \\
    &x_t \leq h^{\stxt{on}}_{t} \label{eq:hp_min_mod_1} \\
    &x_t \geq h^{\stxt{on}}_{t} \cdot mod^{\stxt{min}} \label{eq:hp_min_mod_2} \\
    &x_t \in [0,1], h^{\stxt{switchedOff}}_t \in \{0,1\}, h^{\stxt{on}}_{t} \in \{0,1\} \label{eq:non_negativity} 
  \end{align}
\end{AllowDisplayBreaks}

\end{document}

相关内容