我希望方程式能够在表格底部正确显示带有变量的 argmin 标签。在我的情况下,它显示为下标。我尝试了所有方法,但无法完成。以下是我的代码的一部分,编译正常,但不符合预期
\multicolumn{4}{l}{ $\begin{array} {lcl} \mathbf{r}^i \longleftarrow \argmin_\mathbf{r}\;\Vert \mathbf{r} \Vert_1 \;\;\;\;\mbox{subject to}\;\;\;\; \mathbf{y}= \mathbf{A}\mathbf{r} \end{array} $ }
\begin{tabular}{ll|l|l|l|} \hline
\multicolumn{5}{l}{Algorithm:} \\ \hline
\multicolumn{5}{l}{\begin{tabular}[l]{@{}l@{}}Inputs: CS measurement vector for a speech frame $\mathbf{y}$ \\ Outputs: predictor $\mathbf{a}^i$, residual $\mathbf{r}^i$ \\ $i$ = 0, \\ Initialize dictionary: $h^i=rand, \mathbf{H}^i= conv(h)$ \\\end{tabular}} \\
\hline
\multicolumn{5}{l}{\textbf{while} halting criterion false \textbf{do}} \\
\multirow{2}{*}{1.} & \\
& \multicolumn{4}{l}{$\begin{array} {lcl}
\mathbf{x}^i =\mathbf{H}^i\mathbf{r}^i \end{array}$} \\
2. & \multicolumn{4}{l}{
$\begin{array} {lcl} \mathbf{a}^i \longleftarrow \argmin_\mathbf{a} \; \Vert \mathbf{r}\Vert_2 + \gamma\Vert\mathbf{a}\Vert_1 \;\;\; \mbox{subject to}\;\; \mathbf{x}^i=\mathbf{X}^i\mathbf{a+r} \end{array}$\vspace{1em}} \\
\multirow{4}{*}{3.} & \multicolumn{4}{l}{\; \mbox{Estimate the vocal tract impulse response}} \\
& \multicolumn{4}{l}{
$\begin{array} {lcl}
h^{i+1} \;\; \mbox{given the predictior estimate}\;\;\mathbf{a}^i \end{array}$} \\
& \multicolumn{4}{l}{$\begin{array} {lcl}
\mathbf{H}^{i+1}= [conv(h^{i+1})] \end{array}$
} \\
& \multicolumn{4}{l}{$\begin{array} {lcl}
i=i+1; \end{array}$ } \\
\multicolumn{5}{l}{\textbf{end while}} \\ \hline
\end{tabular}
所需输出需要底部带有变量的 argmin,而不是像这样的下标
答案1
一个合理的定义方法\argmin
是通过\DeclareMathOperator
命令amsopn
加载,最方便的是通过mathtools
。要使限制表现得像那些,\lim
您应该使用声明的星号版本:
\DeclareMathOperator*{\argmin}{argmin}
然后,在显示的数学中,限制将放置在文本“argmin”下。如果您在内联数学中,您可以使用\limits
或\displaystyle
来获得此效果:
\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator*{\argmin}{argmin}
\begin{document}
\( \argmin_r \) vs.\ \( \argmin\limits_r \),
\begin{equation*}
\argmin_r
\end{equation*}
and \( \displaystyle\argmin_r \).
\end{document}
对于您的示例代码,您似乎试图显示一种算法。我强烈建议您为此使用algorithm
和algorithmic
包,而不是多个tabular
包。在不知道您的算法到底是什么的情况下,类似以下内容似乎接近所需的输出:
\documentclass{article}
\usepackage{algorithm,algorithmic,mathtools}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\DeclareMathOperator*{\argmin}{argmin}
\DeclareMathOperator{\conv}{conv}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\begin{document}
\begin{algorithm}
\caption{Example algorithm}
\begin{algorithmic}[1]
\REQUIRE CS measurement vector for a speech frame \( \mathbf{y} \)
\ENSURE predictor \( \mathbf{a}^i \), residual \( \mathbf{r}^i \)
\STATE \( i=0 \)
\STATE Initialize dictionary: \( h^i=\text{rand} \), \(
\mathbf{H}^i= \conv(h) \)
\STATE \( \mathbf{r}^i \longleftarrow \argmin\limits_{\mathbf{r}}
\norm{\mathbf{r}}_1 \) subject to \( \mathbf{y}=
\mathbf{A}\mathbf{r} \)
\WHILE{halting criterion false}
\STATE \( \mathbf{x}^i =\mathbf{H}^i\mathbf{r}^i \)
\STATE \( \mathbf{a}^i \longleftarrow \argmin\limits_{\mathbf{a}}
\norm{\mathbf{r}}_2 + \gamma\norm{\mathbf{a}}_1 \) subject to \(
\mathbf{x}^i=\mathbf{X}^i\mathbf{a+r} \)
\STATE Estimate the vocal tract impulse response
\STATE \( h^{i+1} \) given the predictior estimate \( \mathbf{a}^i \)
\STATE \( \mathbf{H}^{i+1}= [conv(h^{i+1})] \)
\STATE \( i=i+1 \)
\ENDWHILE
\end{algorithmic}
\end{algorithm}
\end{document}