From 9f58a552800b52def52ce2a69c5e7eb8269e4d5b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 5 Jan 2024 22:09:36 -0800 Subject: [PATCH] Typst reader: fix handling of `\overline`. Due to a typo, it was being incorrectly rendered as an `\underset`. Closes #9294. --- src/Text/Pandoc/Readers/Typst/Math.hs | 2 +- test/typst-reader.native | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Readers/Typst/Math.hs b/src/Text/Pandoc/Readers/Typst/Math.hs index e1c58467513b..fdd6771a8678 100644 --- a/src/Text/Pandoc/Readers/Typst/Math.hs +++ b/src/Text/Pandoc/Readers/Typst/Math.hs @@ -175,7 +175,7 @@ handleMath tok = <$> (getField "body" fields >>= pMathGrouped) <*> pure (ESymbol TUnder "_") Elt "math.overline" _ fields -> - EUnder False + EOver False <$> (getField "body" fields >>= pMathGrouped) <*> pure (ESymbol TOver "\175") Elt "math.underbrace" _ fields -> do diff --git a/test/typst-reader.native b/test/typst-reader.native index 740cc65abf68..0e00bc1ab6c2 100644 --- a/test/typst-reader.native +++ b/test/typst-reader.native @@ -1674,7 +1674,7 @@ Pandoc , Space , Str "or" , Space - , Math InlineMath "\\underset{\175}{A}" + , Math InlineMath "\\overline{A}" , Space , Str "with" , Space @@ -2042,7 +2042,7 @@ Pandoc , Space , Str "produces" , Space - , Math InlineMath "\\underset{\175}{x + y}" + , Math InlineMath "\\overline{x + y}" , Str "," , Space , Str "and"