git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: add braces when resolving `\DeclareMathOperator`.

These seem to be needed for xelatex but not pdflatex. Closes #5441.

commit8f010440628e7269c243b4f3dbb4b101b759986f authorJohn MacFarlane <jgm@berkeley.edu> dateWed 10 Apr 2019, 21:26 (8 years ago) parentd50f2a0
1 file changed+2−1
src/Text/Pandoc/Readers/LaTeX.hs+2−1
src/Text/Pandoc/Readers/LaTeX.hs+2−1
@@ -1559,10 +1559,11 @@ newcommand = do
15591559 case mtype of
15601560 "DeclareMathOperator" ->
15611561 Tok pos (CtrlSeq "mathop") "\\mathop"
1562+ : Tok pos Symbol "{"
15621563 : Tok pos (CtrlSeq "mathrm") "\\mathrm"
15631564 : Tok pos Symbol "{"
15641565 : (contents' ++
1565− [ Tok pos Symbol "}" ])
1566+ [ Tok pos Symbol "}", Tok pos Symbol "}" ])
15661567 _ -> contents'
15671568 when (mtype == "newcommand") $ do
15681569 macros <- sMacros <$> getState