Skip to content

array and matrix environments don't ignore trailing newlines #337

@wchargin

Description

@wchargin

Everyone likes trailing commas! But trailing newlines in matrices seem to add an extra newline 😢

LaTeX source to test:

\documentclass{article}

\pagestyle{empty}

\usepackage{amsmath}

\begin{document}

\[
  \begin{bmatrix}
    a & b \\
    c & d \\ 
  \end{bmatrix}
\]

\end{document}

LaTeX output:
LaTeX output doesn't show the blank line

KaTeX output:
KaTeX output has an extra blank line

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions