From 8f010440628e7269c243b4f3dbb4b101b759986f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 10 Apr 2019 21:26:23 -0700 Subject: LaTeX reader: add braces when resolving `\DeclareMathOperator`. These seem to be needed for xelatex but not pdflatex. Closes #5441. --- src/Text/Pandoc/Readers/LaTeX.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index abc137fd1..b619a3a89 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1559,10 +1559,11 @@ newcommand = do case mtype of "DeclareMathOperator" -> Tok pos (CtrlSeq "mathop") "\\mathop" + : Tok pos Symbol "{" : Tok pos (CtrlSeq "mathrm") "\\mathrm" : Tok pos Symbol "{" : (contents' ++ - [ Tok pos Symbol "}" ]) + [ Tok pos Symbol "}", Tok pos Symbol "}" ]) _ -> contents' when (mtype == "newcommand") $ do macros <- sMacros <$> getState -- cgit v1.2.3