我有一个巨大的方程,由几个矩阵组成。它粘在一起,必须在页面之间完全移动,导致前一页出现空白。我不得不调整它的大小,但似乎打破它是一个更好的解决方案。我想让它分开,即,一半在一页的底部,另一半在下一页的开头。我使用的是双栏纸张样式。
这就是我得到的,
\documentclass[10pt, twocolumn, twoside, journal]{IEEEtran}
%\makeatletter
%\let\IEEEproof\proof
%\let\IEEEendproof\endproof
%\let\proof\@undefined
%\let\endproof\@undefined
%\makeatother
%\let\proof\relax
%\let\endproof\relax
%\IEEEoverridecommandlockouts
%\overrideIEEEmargins
\usepackage{amsmath, amsfonts, amssymb, color, enumerate, amsthm, graphicx}
\usepackage{tikz, subcaption, cite}
\usepackage{color, xcolor, soul, bm}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\hypersetup{
colorlinks = true, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = green %Colour of citations
}
\usepackage[normalem]{ulem}
\newtheorem{problem}{Problem}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\newtheorem{assumption}{Assumption}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\usepackage{epsfig}
\usepackage{psfrag}
\DeclareMathOperator{\diag}{diag}
\usepackage{tcolorbox}
\newcommand{\JW}[1]{{\color{red}#1}}
\include{user_newcommands}
\usepackage{algorithm}
\usepackage{algpseudocode}
\allowdisplaybreaks
%\newcommand{\ShS}[1]{$\clubsuit$\footnote{SHREYAS: #1}}
%\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
\def\endtheorem{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\def\endlemma{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\def\endproposition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\def\endexample{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\def\endremark{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\def\enddefinition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\begin{document}
\begin{equation}
\resizebox{.45\textwidth}{!}{$
\begin{split}
&L_g^{-1}\mathbf{e}_i \mathbf{e}_{ij}^{\sf T}L_g^{-1} = \begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & \overbrace{0}^{j^\text{th}} & \cdots & \overbrace{0}^{i^\text{th}} & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix}\\
&\times \begin{bmatrix}
0\\
0\\
\vdots\\
\vdots\\
\vdots\\
\underbrace{1}_{i^\text{th}}\\
\vdots\\
0
\end{bmatrix} \begin{bmatrix}
0\\
0\\
\vdots\\
\underbrace{-1}_{j^\text{th}}\\
\vdots\\
\underbrace{1}_{i^\text{th}}\\
\vdots\\
0
\end{bmatrix}^{\sf T} \begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix}\\
&=\begin{bmatrix}
0\\
0\\
\vdots\\
0\\
\vdots\\
\underbrace{\frac{1}{w_i}}_{i^\text{th}}\\
\vdots\\
\frac{1}{w_i}
\end{bmatrix} \begin{bmatrix}
0 & \cdots & \underbrace{0}_{j^\text{th}} & \frac{1}{w_{j+1}} & \frac{1}{w_{j+2}} & \cdots & \underbrace{\frac{1}{w_i}}_{i^\text{th}} & 0 & \cdots & 0
\end{bmatrix}\\
&=\begin{bmatrix}
0 & 0 & \cdots & \overbrace{0}^{j^\text{th}} & \overbrace{0}^{{j+1}^\text{th}} & \overbrace{0}^{{j+2}^\text{th}} & \cdots & \overbrace{0}^{i^\text{th}} & \cdots & 0\\
0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \frac{1}{w_i w_{j+1}} & \frac{1}{w_i w_{j+2}} & \cdots & \frac{1}{w_i^2} & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \cdots & \cdots & \cdots & \cdots & \cdots & 0
\end{bmatrix} \geq 0
%}
\end{split}
$}
\end{equation}
\end{document}
答案1
在我看来,整个方程式应该放在一个“块”中,也就是说,它不应该跨列,更不用说跨页了。该怎么办?我建议你将方程式放在环境中figure
。使用不是必需的;相反,只需减少一点\resizebox
的值即可。\arraycolsep
为了节省垂直空间,您可以使用\smash[t]{...}
和\smash[b]{...}
“包装器”,让\underbrace
和的参数\overbrace
“悬挂”在bmatrix
环境的顶行或底行之外。
在下面的例子中,showframe
加载该包纯粹是为了证明方程式可以适合一列,而无需借助大锤\resizebox
。
\documentclass[10pt, twocolumn, twoside, journal]{IEEEtran}
\usepackage{showframe} %optional
%\makeatletter
%\let\IEEEproof\proof
%\let\IEEEendproof\endproof
%\let\proof\@undefined
%\let\endproof\@undefined
%\makeatother
%\let\proof\relax
%\let\endproof\relax
%\IEEEoverridecommandlockouts
%\overrideIEEEmargins
\usepackage{amsmath, %amsfonts, % is loaded by 'amssymb'
amssymb, %color,
enumerate, amsthm, graphicx}
\allowdisplaybreaks
\usepackage{tikz, subcaption, cite}
\usepackage{%color,
xcolor, soul, bm}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[normalem]{ulem}
%%\usepackage{epsfig} % shouldn't be necessary
\usepackage{psfrag}
\usepackage{tcolorbox}
%\PassOptionsToPackage{hyphens}{url}
\usepackage[hyphens,spaces,obeyspaces]{url} % <-- new
\usepackage{hyperref}
\hypersetup{%
colorlinks = true, %Coloured links instead of boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = green %Colour of citations
}
%% for "clever" cross-referencing:
\usepackage[noabbrev,nameinlink]{cleveref}
\newtheorem{problem}{Problem}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\newtheorem{assumption}{Assumption}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\DeclareMathOperator{\diag}{diag}
\newcommand{\JW}[1]{\textcolor{red}{#1}}
\include{user_newcommands}
\newcommand{\ShS}[1]{$\clubsuit$\footnote{SHREYAS: #1}}
\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
%\def\endtheorem{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endlemma{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endproposition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endexample{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endremark{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\enddefinition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\newcommand{\trans}{\mathsf{T}} % <-- new
\usepackage{lipsum}
\begin{document}
\lipsum[1-2] % filler text
A cross-reference to \cref{eq:tall}.
\begin{figure}[t!]
\setlength\arraycolsep{2pt} % default: 5pt
%% caption is optional:
\caption*{Evaluating $L_g^{-1}\mathbf{e}_i \mathbf{e}_{ij}^{\trans}L_g^{-1}$}
\bigskip
\begin{equation} \label{eq:tall}
%%%%\resizebox{.9\columnwidth}{!}{$\displaystyle
\begin{aligned}[b]
&L_g^{-1}\mathbf{e}_i \mathbf{e}_{ij}^{\trans}L_g^{-1} =
\begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & \smash[t]{\overbrace{0}^{j^\text{th}}} & \cdots & \smash[t]{\overbrace{0}^{i^\text{th}}} & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix} \\%end of first row
&\times
\begin{bmatrix}
0\\
0\\
\vdots\\
\vdots\\
\vdots\\
\underbrace{1}_{i^\text{th}}\\
\vdots\\
0
\end{bmatrix}
\begin{bmatrix}
0\\
0\\
\vdots\\
\underbrace{-1}_{j^\text{th}}\\
\vdots\\
\underbrace{1}_{i^\text{th}}\\
\vdots\\
0
\end{bmatrix}^{\trans}
\begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix}\\%end of second row
&=
\begin{bmatrix}
0\\
0\\
\vdots\\
0\\
\vdots\\
\underbrace{\frac{1}{w_i}}_{i^\text{th}}\\
\vdots\\
\frac{1}{w_i}
\end{bmatrix}
\begin{bmatrix}
0 & \cdots & \smash[b]{\underbrace{0}_{j^\text{th}}} & \frac{1}{w_{j+1}} & \frac{1}{w_{j+2}} & \cdots & \smash[b]{\underbrace{\frac{1}{w_i}}_{i^\text{th}}} & 0 & \cdots & 0
\end{bmatrix}\\%end of third row
&=
\begin{bmatrix}
0 & 0 & \cdots & \smash[t]{\overbrace{0}^{j^\text{th}}} & \smash[t]{\overbrace{0}^{{j+1}^\text{th}}} & \smash[t]{\overbrace{0}^{{j+2}^\text{th}}} & \cdots & \smash[t]{\overbrace{0}^{i^\text{th}}} & \cdots & 0\\
0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \frac{1}{w_i w_{j+1}} & \frac{1}{w_i w_{j+2}} & \cdots & \frac{1}{w_i^2} & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \cdots & \cdots & \cdots & \cdots & \cdots & 0
\end{bmatrix} \\% end of fourth row
&\geq 0
\end{aligned}
\end{equation}
\end{figure}
\lipsum[3-6] % more filler text
\end{document}
附录:如果您不确定将大方程式放在figure
环境中是否是一个好方法,那么将整个方程式放入“框架”中并不需要太多额外的工作,从而进一步突出它的视觉效果。
\documentclass[10pt, twocolumn, twoside, journal]{IEEEtran}
%\makeatletter
%\let\IEEEproof\proof
%\let\IEEEendproof\endproof
%\let\proof\@undefined
%\let\endproof\@undefined
%\makeatother
%\let\proof\relax
%\let\endproof\relax
%\IEEEoverridecommandlockouts
%\overrideIEEEmargins
\usepackage{amsmath, %amsfonts, % is loaded by 'amssymb'
amssymb, %color,
enumerate, amsthm, graphicx}
\allowdisplaybreaks
\usepackage{tikz, subcaption, cite}
\usepackage{%color,
xcolor, soul, bm}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[normalem]{ulem}
%%\usepackage{epsfig} % shouldn't be necessary
\usepackage{psfrag}
\usepackage{tcolorbox}
%\PassOptionsToPackage{hyphens}{url}
\usepackage[hyphens,spaces,obeyspaces]{url} % <-- new
\usepackage{hyperref}
\hypersetup{%
colorlinks = true, %Coloured links instead of boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = blue, %Colour of internal links
citecolor = green %Colour of citations
}
%% for "clever" cross-referencing:
\usepackage[noabbrev,nameinlink]{cleveref}
\newtheorem{problem}{Problem}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}
\newtheorem{assumption}{Assumption}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\DeclareMathOperator{\diag}{diag}
\newcommand{\JW}[1]{\textcolor{red}{#1}}
\include{user_newcommands}
\newcommand{\ShS}[1]{$\clubsuit$\footnote{SHREYAS: #1}}
\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
%\def\endtheorem{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endlemma{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endproposition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endexample{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\endremark{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
%\def\enddefinition{\hspace*{\fill}~\IEEEQEDopen\par\endtrivlist\unskip}
\newcommand{\trans}{\mathsf{T}} % <-- new
\usepackage{lipsum}
\begin{document}
\lipsum[1-2] % filler text
A cross-reference to \cref{eq:tall}.
\begin{figure}[t!]
\setlength\fboxsep{1.5pt} % default: 3pt
\setlength\arraycolsep{2pt} % default: 5pt
\fbox{\begin{minipage}{\dimexpr\columnwidth-2\fboxsep-2\arrayrulewidth\relax}
%% caption is optional:
\caption*{Evaluation of $L_g^{-1}\mathbf{e}^{}_i \mathbf{e}_{ij}^{\trans}L_g^{-1}$}
\medskip
\begin{equation} \label{eq:tall}
\begin{aligned}[b]
&L_g^{-1}\mathbf{e}^{}_i \mathbf{e}_{ij}^{\trans}L_g^{-1} =
\begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & \smash[t]{\overbrace{0}^{j\text{th}}} & \cdots & \smash[t]{\overbrace{0}^{i\text{th}}} & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix} \\%end of first row
&\times
\begin{bmatrix}
0\\
0\\
\vdots\\
\vdots\\
\vdots\\
\underbrace{1}_{i\text{th}}\\
\vdots\\
0
\end{bmatrix}
\begin{bmatrix}
0\\
0\\
\vdots\\
\underbrace{-1}_{j\text{th}}\\
\vdots\\
\underbrace{1}_{i\text{th}}\\
\vdots\\
0
\end{bmatrix}^{\!\trans}
\begin{bmatrix}
\frac{1}{w_1} & 0 & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots \\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & 0\\
\vdots & \vdots & & \vdots & & \vdots & & \vdots\\
\frac{1}{w_1} & \frac{1}{w_2} & \cdots & \frac{1}{w_j} & \cdots & \frac{1}{w_i} & \cdots & \frac{1}{w_n}
\end{bmatrix}\\%end of second row
&=
\begin{bmatrix}
0\\
0\\
\vdots\\
0\\
\vdots\\
\underbrace{\frac{1}{w_i}}_{i\text{th}}\\
\vdots\\
\frac{1}{w_i}
\end{bmatrix}
\begin{bmatrix}
0 & \cdots & \smash[b]{\underbrace{0}_{j\text{th}}} & \frac{1}{w_{j+1}} & \frac{1}{w_{j+2}} & \cdots & \smash[b]{\underbrace{\frac{1}{w_i}}_{i\text{th}}} & 0 & \cdots & 0
\end{bmatrix}\\%end of third row
&=
\begin{bmatrix}
0 & 0 & \cdots & \smash[t]{\overbrace{0}^{j\text{th}}} & \smash[t]{\overbrace{0}^{{j+1}\text{st}}} & \smash[t]{\overbrace{0}^{j+2\text{nd}}} & \cdots & \smash[t]{\overbrace{0}^{i\text{th}}} & \cdots & 0\\
0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \frac{1}{w_i w_{j+1}} & \frac{1}{w_i w_{j+2}} & \cdots & \frac{1}{w_i^2} & \cdots & 0\\
\vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots & & \vdots\\
0 & 0 & \cdots & 0 & \cdots & \cdots & \cdots & \cdots & \cdots & 0
\end{bmatrix} \\% end of fourth row
&\geq 0
\end{aligned}%
\end{equation}%
\end{minipage}}
\end{figure}
\lipsum[3-6] % more filler text
\end{document}