答案1
像这样吗?
\documentclass{article}
\usepackage{mathtools,array}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\begin{document}
\begin{gather*}
\mathit{MSE}=\frac{1}{mn} \sum_{i=1}^m \sum_{j=1}^n (x_{ij}-y_{ij})^2 \\[2ex]
\begin{array}{@{} l >{$}l<{$} @{}}
m & number of rows in cover image\\
n & number of columns in cover image\\
x_{ij} & pixel value from cover image\\
y_{ij} & pixel value from stego image
\end{array} \\[2ex]
\mathit{PSNR}(x,y)=\frac{10\log_{10}[\max(\max(x),\max(y))]^2}{\abs{x-y}^2}
\end{gather*}
\end{document}
附录回答 OP 的后续问题。(a)要用矩形框围住方程式或方程组,请使用指令\boxed
。(b)要给方程式添加标题,请将其放在figure
环境中并使用\caption
指令。
\documentclass{article}
\usepackage{mathtools,array}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\counterwithin{figure}{section} % optional
\usepackage[font={sf},skip=0.5\baselineskip]{caption} % optional
\begin{document}
\setcounter{section}{2} % just for this example
\setcounter{figure}{8}
\begin{figure}[ht!]
\[
\boxed{%
\begin{gathered}
\mathit{MSE}=\frac{1}{mn} \sum_{i=1}^m \sum_{j=1}^n (x_{ij}-y_{ij})^2 \\[1ex]
\begin{array}{@{} l >{$}l<{$} @{}}
m & number of rows in cover image\\
n & number of columns in cover image\\
x_{ij} & pixel value from cover image\\
y_{ij} & pixel value from stego image\\
\end{array}
\end{gathered}
}% end of scope of \boxed
\]
\caption{MSE Algorithm}
\end{figure}
\[
\boxed{%
\mathit{PSNR}(x,y)=\frac{10\log_{10}[\max(\max(x),\max(y))]^2}{\abs{x-y}^2}
}
\]
\end{document}
答案2
一个答案:
\documentclass{article}
\usepackage{amsthm,amsmath}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{align*}
& MSE = \frac{1}{m n} \sum_{m}\sum_{n} (x_{mn}-y_{mn})^2 \\
& m \text{ number of ...} \\
& n \text{ number of ...} \\
& x_{mn} \text{ pixel value ...} \\
& y_{mn} \text{ ixel value ...}
\end{align*}
\[
PSNR(x,y) =\frac{10 \log_{10}(\max(\max(x),\max(y))^2}{|x-y|^2}
\]
\end{document}
第二个中丢失了一个闭括号!