Multicols 的算法缩进问题

Multicols 的算法缩进问题

多列内算法块的缩进问题:这是一个已知问题吗?

\documentclass{article}

\usepackage{amsfonts}  % blackboard math symbols
\usepackage{amsmath} % required for \underset
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{algorithmic}
% Make hyperref and algorithmic compatible
\newcommand{\theHalgorithm}{\arabic{algorithm}}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{mathrsfs}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{listings}
\usepackage{sidecap}

\begin{document}

\onecolumn
\section*{Appendix}

\begin{multicols}{2}
\begin{algorithm}[H]
    \footnotesize
    \caption{Q Regression from UVPN Value Estimate}
    \label{alg:local_metric}
    \begin{algorithmic}[1]
    \REQUIRE{MDP, \(\beta = 1\), Value Function \(V(s, g)\), Buffer \(\mathcal B\)}
    \STATE Sample \(\langle s, a, s' \rangle\) from the MDP, append to \(\mathcal B\)
    \FOR{each epoch}
        \STATE minimize  \(\Vert A(s, a, g),\;
        V(s, s') + V(s', g) - V(s, g)\Vert
    \ENDFOR
    \end{algorithmic}
\end{algorithm}

\columnbreak

\begin{algorithm}[H]
    \footnotesize
    \caption{Test Time}
    \label{alg:local_metric}
    \begin{algorithmic}[1]
    \REQUIRE{Value Function \(V(s, g)\)}
    \STATE Sample \(\langle s, a, s' \rangle\) from the MDP, append to replay buffer \(\mathcal B\)
    \FOR{each epoch}
       \STATE minimize  \(\Vert A(s, a, g),\;
        V(s, s') + V(s', g) - V(s, g)\Vert
    \ENDFOR
    \end{algorithmic}
\end{algorithm}
\end{multicols}

\end{document}

在此处输入图片描述

答案1

问题在于循环内部有一个拼写错误,这里\)缺少一个结尾。

相关内容