>From 76a471fd6ffed4993bf6b8114676715859ffd6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Tue, 20 Apr 2021 00:16:55 +0200 Subject: [PATCH 2/2] Right \mathstyle while reading \Udelimiter family --- source/texk/web2c/luatexdir/tex/texmath.c | 28 +++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/source/texk/web2c/luatexdir/tex/texmath.c b/source/texk/web2c/luatexdir/tex/texmath.c index 461a51578..0c0e8a9cc 100644 --- a/source/texk/web2c/luatexdir/tex/texmath.c +++ b/source/texk/web2c/luatexdir/tex/texmath.c @@ -1580,6 +1580,7 @@ static void scan_delimiter(pointer p, int r) void math_radical(void) { halfword q; + int new_mstyle; int chr_code = cur_chr; halfword options = 0; tail_append(new_node(radical_noad, chr_code)); @@ -1600,28 +1601,35 @@ void math_radical(void) } } radicaloptions(tail) = options; - if (chr_code == 0) + if (chr_code == 0) { /*tex \.{\\radical} */ scan_delimiter(left_delimiter(tail), tex_mathcode); - else if (chr_code == 1) + new_mstyle = cramped_style(m_style); + } else if (chr_code == 1) { /*tex \.{\\Uradical} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 2) + new_mstyle = cramped_style(m_style); + } else if (chr_code == 2) { /*tex \.{\\Uroot} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 3) + new_mstyle = cramped_style(m_style); + } else if (chr_code == 3) { /*tex \.{\\Uunderdelimiter} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 4) + new_mstyle = sub_style(m_style); + } else if (chr_code == 4) { /*tex \.{\\Uoverdelimiter} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 5) + new_mstyle = sup_style(m_style); + } else if (chr_code == 5) { /*tex \.{\\Udelimiterunder} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 6) + new_mstyle = m_style; + } else if (chr_code == 6) { /*tex \.{\\Udelimiterover} */ scan_delimiter(left_delimiter(tail), umath_mathcode); - else if (chr_code == 7) + new_mstyle = cramped_style(m_style); + } else if (chr_code == 7) /*tex \.{\\Uhextensible} */ scan_delimiter(left_delimiter(tail), umath_mathcode); else @@ -1645,12 +1653,12 @@ void math_radical(void) vlink(degree(tail)) = null; q = new_node(math_char_node, 0); nucleus(tail) = q; - (void) scan_math(nucleus(tail), cramped_style(m_style)); + (void) scan_math(nucleus(tail), new_mstyle); } } else { q = new_node(math_char_node, 0); nucleus(tail) = q; - (void) scan_math(nucleus(tail), cramped_style(m_style)); + (void) scan_math(nucleus(tail), new_mstyle); } } -- 2.31.1