Skip to content

Document \plainhs, \mathhs, etc. #103

@sgraf812

Description

@sgraf812

I just discovered that can use \begin{code}...\end{code} blocks in display math and even arrays, to format code blocks side-by-side:

\[
\mathhs
\begin{array}{ccc}
\begin{code}
not :: Bool -> Bool
not b  | False <- b  = True
       | True <- b   = False
\end{code} &
\begin{code}
not2 :: Bool -> Bool
not2 False  = True
not2 True   = False
\end{code} &
\begin{code}
not3 :: Bool -> Bool
not3 x | False <- x  = True
not3 True            = False
\end{code}
\end{array}
\plainhs
\]

Alas, I had to carefully read polycode.fmt for that. I haven't found anything in the user's guide or on the TeX SE.

Let this issue serve as documentation until either the user's guide or TeX SE picks it up.

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