Skip to content

Indent line breaks when when using \Statex at the top of a new column #16

Open
@jfriemel

Description

@jfriemel

The indent lines seem to break when using the multicol package and \Statex near the top of a new column. Here's an example:

\documentclass{article}
\usepackage{algpseudocodex}
\usepackage{multicol}

\begin{document}
    \begin{multicols}{3}
        \begin{algorithmic}[1]
            \If{\(a > 0\)}
                \Statex \hspace{\algorithmicindent}no
                \State yes
                \State yes
            \EndIf
            \If{\(b > 0\)}
                \Statex \hspace{\algorithmicindent}no
                \State yes
                \State yes
            \EndIf
            \If{\(c > 0\)}
                \Statex \hspace{\algorithmicindent}no
                \State yes
                \State yes
            \EndIf
        \end{algorithmic}
    \end{multicols}
\end{document}

And here's the corresponding output:
image

The \hspace{\algorithmicindent} is added because \Statex does not produce the correct indentation as noted by @LeCyberDucky in #7. Note that the indent lines only break in the second and third column. They do not break when \Statex is replaced by \State or when there are fewer than two lines below \Statex in a column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions