以下是我的示例:
\documentclass[%
11pt,
%pagesize=pdftex,
%paper=letter,
pagesize,
headsepline,
parskip=half,
english,
twoside,
headings=chapterprefix,
%pointlessnumbers % Chapters always without point
numbers=noenddot
%DIV=14
]{scrbook}
\usepackage{mathtools}
\newcommand{\Sf}{\mathbf{S}_f}
\newcommand{\gradphi}[1]{(\nabla\phi)_{#1}}
\newcommand{\U}{\mathbf{U}}
\usepackage{empheq}
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
nobeforeafter,
math upper,
tcbox raise base,
enhanced,
colframe=black!30!black,
colback=black!10,
boxrule=1pt, #1}
\usepackage{geometry}
\geometry{
% Royal
top=2.0cm,%
bottom=2.5cm,%
left=2.2cm,%
right=1.7cm,%
paperwidth=15.59cm,%
paperheight=23.39cm%
}
\begin{document}
\begin{empheq}[box={\mymath[drop lifted shadow, sharp corners]}]{align}
\label{eq:phieulerimpl}
\left(\frac{\partial \phi}{\partial t}\right)_c^{n+1} & =
\dfrac{1}{\Omega_c} \left[ \sum_f D_f \gradphi{f}^{n+1} \cdot \Sf - \sum_f \U_f \phi_f^{n+1} \cdot \Sf \right] + \nonumber \\
& + S(\phi_c^{n+1}) + O(\delta t) + O(h^2),
\end{empheq}
\end{document}
输出结果如下:
我知道我可以改变给包的选项geometry
,但是页面的格式是固定的。
我该怎么做才能减少标签和公式之间的空白?我同意标签放在下一行,但垂直空间应该减少。
答案1
除了写出方程式和一个内部分隔较少的盒子外,没有太多其他内容
\documentclass[%
11pt,
%pagesize=pdftex,
%paper=letter,
pagesize,
headsepline,
parskip=half,
english,
twoside,
headings=chapterprefix,
%pointlessnumbers % Chapters always without point
numbers=noenddot
%DIV=14
]{scrbook}
\usepackage{mathtools}
\newcommand{\Sf}{\mathbf{S}_f}
\newcommand{\gradphi}[1]{(\nabla\phi)_{#1}}
\newcommand{\U}{\mathbf{U}}
\usepackage{empheq}
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
nobeforeafter,
math upper,
tcbox raise base,
enhanced,
colframe=black!30!black,
colback=black!10,
boxrule=1pt,
#1}
\usepackage{geometry}
\geometry{
% Royal
top=2.0cm,%
bottom=2.5cm,%
left=2.2cm,%
right=1.7cm,%
paperwidth=15.59cm,%
paperheight=23.39cm%
}
\begin{document}
\begin{empheq}[box={\mymath[drop lifted shadow, sharp corners]}]{equation}
\label{eq:phieulerimpl}
\begin{aligned}
\MoveEqLeft \left(\frac{\partial \phi}{\partial t}\right)_c^{n+1}
=
\dfrac{1}{\Omega_c} \Bigl[\, \sum_f D_f \gradphi{f}^{n+1} \cdot
\Sf
\\
& - \sum_f \U_f \phi_f^{n+1} \cdot \Sf \Bigr] + S(\phi_c^{n+1}) + O(\delta t) + O(h^2),
\end{aligned}
\end{empheq}
\end{document}
答案2
不错的 @daleif 答案的一个小变化(+1):使用来自包中的和环境的\medmath
宏:nccmath
multlined
mathtools
\documentclass[%
11pt,
%pagesize=pdftex,
%paper=letter,
pagesize,
headsepline,
parskip=half,
english,
twoside,
headings=chapterprefix,
%pointlessnumbers % Chapters always without point
numbers=noenddot
%DIV=14
]{scrbook}
\usepackage{nccmath, mathtools} % <---
\newcommand{\Sf}{\mathbf{S}_f}
\newcommand{\gradphi}[1]{(\nabla\phi)_{#1}}
\newcommand{\U}{\mathbf{U}}
\usepackage{empheq}
\usepackage[most]{tcolorbox}
\newtcbox{\mymath}[1][]{%
nobeforeafter,
math upper,
tcbox raise base,
enhanced,
colframe=black!30!black,
colback=black!10,
boxrule=1pt, #1}
\usepackage{geometry}
\geometry{
% Royal
top=2.0cm,%
bottom=2.5cm,%
left=2.2cm,%
right=1.7cm,%
paperwidth=15.59cm,%
paperheight=23.39cm%
}
\begin{document}
\begin{empheq}[box={\mymath[drop lifted shadow, sharp corners]}]{equation}
\label{eq:phieulerimpl}
\medmath{\begin{multlined} % <--- MEDMATH, MULTLINED
\biggl(\frac{\partial \phi}{\partial t}\biggr)_c^{n+1}
= \dfrac{1}{\Omega_c} \biggl[ \sum_f D_f \gradphi{f}^{n+1} \Sf - \sum_f \U_f \phi_f^{n+1} \Sf \biggr]+ \\
+ S(\phi_c^{n+1}) + O(\delta t) + O(h^2),
\end{multlined}}
\end{empheq}
\end{document}