From 71b8d151d45340aa1252464a036fd21b28bb3c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Fri, 18 Jun 2021 23:15:12 +0200 Subject: [PATCH] Avoid empty mtext before aligned --- luamml-convert.lua | 1 + luamml-patches-amsmath.sty | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/luamml-convert.lua b/luamml-convert.lua index a90f779..1af5e24 100644 --- a/luamml-convert.lua +++ b/luamml-convert.lua @@ -253,6 +253,7 @@ end local function noad_to_table(noad, sub, cur_style, joining) local nucleus, core = kernel_to_table(noad.nucleus, sub == noad_over and cur_style//2*2+1 or cur_style) + if not nucleus then return end if core and core[0] == 'mo' and core.minsize and not core.maxsize then core.maxsize = core.minsize -- This happens when a half-specified delimiter appears alone in a list. -- If it has a minimal size, it should be fixed to that size (since there is nothing bigger in it's list) diff --git a/luamml-patches-amsmath.sty b/luamml-patches-amsmath.sty index c5d2423..2de1036 100644 --- a/luamml-patches-amsmath.sty +++ b/luamml-patches-amsmath.sty @@ -9,7 +9,11 @@ \nonmatherr@ { \begin { \@currenvir } } \fi \savecolumn@ % Assumption: called inside a group - \alignedspace@left + \luamml_annotate:en { + nucleus = true, core = false + } { + \alignedspace@left + } \ams@start@box {#1} \bgroup \maxfields@ #2 \relax \ifnum \maxfields@ > \m@ne