aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-04-10 21:26:23 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-04-10 21:26:23 -0700
commit8f010440628e7269c243b4f3dbb4b101b759986f (patch)
tree41cf83c68cc237c755322606dd67ce227036b6a5 /src
parentd50f2a0bf684060f431348ebe2977f243162ec2b (diff)
downloadpandoc-8f010440628e7269c243b4f3dbb4b101b759986f.tar.gz
LaTeX reader: add braces when resolving `\DeclareMathOperator`.
These seem to be needed for xelatex but not pdflatex. Closes #5441.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs3
1 files changed, 2 insertions, 1 deletions
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