Skip to content

Math macros using a table cannot be called multiple times #2312

@Omikhleia

Description

@Omikhleia

MWE (in Djot)

$$`\def{icol}{(\mtable{#1}{#2})}
\icol{a \\ b} = \icol{c}{d}`

(I wanted to check the syntax equivalence)

Expected

Image

Observed

Crash in ./packages/math/base-elements.lua = bad argument #1 to 'gmatch' (string expected, got table)

Analysis

The columnalign option is modified (parsed to a list, and extended to match the actual number of columns) without having (shallow-)copied the options, and the passed options object the same (from the macro), so one invocation affects the other.

Metadata

Metadata

Assignees

Labels

modules:packagesIssue relates to core or 3rd party packages

Type

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions