texmath 0.12.5.4 → 0.12.5.5
raw patch · 5 files changed
+35/−10 lines, 5 filesdep ~pandoc-types
Dependency ranges changed: pandoc-types
Files
- changelog +13/−0
- src/Text/TeXMath/Readers/TeX.hs +7/−7
- test/reader/tex/issue204.test +8/−0
- test/regression/203.test +4/−0
- texmath.cabal +3/−3
changelog view
@@ -1,3 +1,16 @@+texmath (0.12.5.5)++ * Allow pandoc-types 1.23.++ * TeX reader: remove false positives for isConvertible (#204).+ "Convertible" symbols are those in which subscripts render+ under the symbol in display environments, and as subscripts+ in inline environments. Previously the TeX parser recognized+ all relation and binary symbols as convertible, which does not+ match TeX's behavior.++ * TeX reader: Support `\enspace` (#203).+ texmath (0.12.5.4) * OMML reader: fix treatment of `eqArr` (#196).
src/Text/TeXMath/Readers/TeX.hs view
@@ -543,14 +543,13 @@ isConvertible :: Exp -> Bool isConvertible (EMathOperator x) = x `elem` convertibleOps where convertibleOps = [ "lim","liminf","limsup","inf","sup"- , "min","max","Pr","det","gcd"- ]-isConvertible (ESymbol Rel _) = True-isConvertible (ESymbol Bin _) = True+ , "min","max","Pr","det","gcd" ] isConvertible (ESymbol Op x) = x `elem` convertibleSyms- where convertibleSyms = ["\x2211","\x220F","\x22C2",- "\x22C3","\x22C0","\x22C1","\x2A05","\x2A06",- "\x2210","\x2A01","\x2A02","\x2A00","\x2A04"]+ where convertibleSyms =+ ["\x2211", "\x220F", "\x2210", -- \sum \prod \amalg+ "\x22C0", "\x22C1", -- bigwedge \bigvee+ "\x22C2", "\x22C3", -- \bigcap \bigcup+ "\x2A05", "\x2A06"] -- \bigsqcap \bisqcup isConvertible _ = False -- check if sub/superscripts should always be under and over the expression@@ -655,6 +654,7 @@ (ERoot <$> inbrackets <*> texToken) <|> (ESqrt <$> texToken) xspace :: Text -> TP Exp+xspace "\\enspace" = return $ ESpace (1/2) xspace "\\mspace" = braces $ do len <- many1 digit
+ test/reader/tex/issue204.test view
@@ -0,0 +1,8 @@+<<< tex+a \succcurlyeq_{i} b++>>> native+[ EIdentifier "a"+, ESub (ESymbol Rel "\8829") (EIdentifier "i")+, EIdentifier "b"+]
+ test/regression/203.test view
@@ -0,0 +1,4 @@+<<< tex+x\enspace y+>>> native+[ EIdentifier "x" , ESpace (1 % 2) , EIdentifier "y" ]
texmath.cabal view
@@ -1,5 +1,5 @@ Name: texmath-Version: 0.12.5.4+Version: 0.12.5.5 Cabal-Version: >= 1.10 Build-type: Simple Synopsis: Conversion between math formats.@@ -76,7 +76,7 @@ xml, parsec >= 3, containers,- pandoc-types >= 1.20 && < 1.23,+ pandoc-types >= 1.20 && < 1.24, mtl >= 2.2.1, text, split@@ -124,7 +124,7 @@ Build-Depends: base >= 4.11 && < 5, texmath, xml,- pandoc-types >= 1.20 && < 1.23,+ pandoc-types >= 1.20 && < 1.24, aeson, bytestring, text,