0

Issue with indentation in an algorithm block inside multicols: Is this a known issue?

\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}

enter image description here

1 Answer 1

0

The issue is a typo inside the loop, here a closing \) is missing.

1
  • you better drop the question and answer, if it was a mistake. Otherwise, people search for keywords find your question and getting sidetracked as it really hasn't to do with indentation, multicol, algorithms ... Mar 17, 2020 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .