packages feed

texmath 0.10 → 0.10.1

raw patch · 6 files changed

+40/−16 lines, 6 files

Files

changelog view
@@ -1,3 +1,14 @@+texmath (0.10.1)++  * Expose Text.TeXMath.TeX (TeX rendering functions) (#108).+    This is needed in order to use getTeXMath from Text.TeXMath.Unicode.ToTeX.+  * Pandoc writer: don't insert punctuation space before explicit space+    (#107).  E.g. in `2,\!4`.+  * Fix end-line command ('\\') in AMSmath environments (ARATA Mizuki).+    The end-line command in AMSmath environments does not allow spaces+    before its optional argument.+  * Use `\in` for SMALL ELEMENT OF in "base" (Vaclav Haisman).+ texmath (0.10)    * Use `\ni` in base for U+220D (#103).
src/Text/TeXMath/Readers/TeX.hs view
@@ -317,6 +317,15 @@   optional inbrackets  -- can contain e.g. [1.0in] for a line height, not yet supported   return '\n' +-- Within environments provided by AMSmath, spaces are not allowed between+-- the double-backslash command and its optional argument.+endLineAMS :: TP Char+endLineAMS = lexeme $ try $ do+  string "\\\\"+  skipMany comment+  optional inbrackets  -- can contain e.g. [1.0in] for a line height, not yet supported+  return '\n'+ arrayLine :: TP ArrayLine arrayLine = notFollowedBy (ctrlseq "end" >> return '\n') >>   sepBy1 (unGrouped <$>@@ -383,7 +392,7 @@  matrixWith :: String -> String -> TP Exp matrixWith opendelim closedelim = do-  lines' <- sepEndBy1 arrayLine endLine+  lines' <- sepEndBy1 arrayLine endLineAMS   let aligns = alignsFromRows AlignCenter lines'   return $ if null opendelim && null closedelim               then EArray aligns lines'@@ -398,7 +407,7 @@  gather :: TP Exp gather = do-  rows <- sepEndBy arrayLine endLine+  rows <- sepEndBy arrayLine endLineAMS   return $ EArray (alignsFromRows AlignCenter rows) rows  equation :: TP Exp@@ -414,19 +423,19 @@  align :: TP Exp align = do-  rows <- sepEndBy1 arrayLine endLine+  rows <- sepEndBy1 arrayLine endLineAMS   let n = maximum $ map length rows   return $ EArray (take n $ cycle [AlignRight, AlignLeft]) rows  flalign :: TP Exp flalign = do-  rows <- sepEndBy1 arrayLine endLine+  rows <- sepEndBy1 arrayLine endLineAMS   let n = maximum $ map length rows   return $ EArray (take n $ cycle [AlignLeft, AlignRight]) rows  cases :: TP Exp cases = do-  rs <- sepEndBy1 arrayLine endLine+  rs <- sepEndBy1 arrayLine endLineAMS   return $ EDelimited "{" "" [Right $ EArray (alignsFromRows AlignLeft rs) rs]  variable :: TP Exp
src/Text/TeXMath/Unicode/ToTeX.hs view
@@ -604,7 +604,7 @@   , Record {uchar = '\8711', commands = [("base","\\nabla"),("unicode-math","\\nabla")], category = Ord, comments = "NABLA, del, hamilton operator"}   , Record {uchar = '\8712', commands = [("base","\\in"),("unicode-math","\\in")], category = Rel, comments = "set membership, variant"}   , Record {uchar = '\8713', commands = [("base","\\notin"),("wrisym","\\nin"),("unicode-math","\\notin")], category = Rel, comments = "negated set membership"}-  , Record {uchar = '\8714', commands = [("unicode-math","\\smallin")], category = Rel, comments = "set membership (small set membership)"}+  , Record {uchar = '\8714', commands = [("base","\\in"),("unicode-math","\\smallin")], category = Rel, comments = "set membership (small set membership)"}   , Record {uchar = '\8715', commands = [("base","\\ni"),("base","\\owns"),("unicode-math","\\ni")], category = Rel, comments = "contains, variant"}   , Record {uchar = '\8716', commands = [("wrisym","\\nni"),("txfonts","\\notni"),("unicode-math","\\nni")], category = Rel, comments = "= \\notowner (mathabx), = \\notowns (fourier), negated contains, variant"}   , Record {uchar = '\8717', commands = [("base","\\ni"), ("unicode-math","\\smallni")], category = Rel, comments = "r: contains (SMALL CONTAINS AS MEMBER)"}
src/Text/TeXMath/Writers/Pandoc.hs view
@@ -41,15 +41,19 @@ -- This adds spaces around certain symbols, in accord -- with Appendix G of TeXBook. addSpaces :: [Exp] -> [Exp]-addSpaces (ESymbol t1 s1 : ESymbol t2 s2 : xs)-  | t2 == Pun || (t1 `notElem` [Bin, Op, Rel, Open, Pun] && not (null xs)) =-    ESymbol t1 s1 : addSpace t2 (ESymbol t2 s2) ++ addSpaces xs-addSpaces (x : ESymbol t2 s2 : xs)-  | not (null xs) =-    x : addSpace t2 (ESymbol t2 s2) ++ addSpaces xs+addSpaces (ESymbol t1 s1 : ESpace r : xs)+  = ESymbol t1 s1 : ESpace r : addSpaces xs+addSpaces (ESymbol t1 s1 : xs)+  | t1 `notElem` [Bin, Op, Rel, Open, Pun]+  = ESymbol t1 s1 : addSpaces xs+addSpaces (ESymbol t1 s1 : ESymbol Pun s2 : xs)+  = ESymbol t1 s1 : ESymbol Pun s2 : addSpaces xs+addSpaces (ESymbol t2 s2 : xs)+  | not (null xs)+  = addSpace t2 (ESymbol t2 s2) ++ addSpaces xs addSpaces (EMathOperator s : xs) =   EMathOperator s : thinspace : addSpaces xs-addSpaces (x : xs) = x : addSpaces xs+addSpaces (x:xs) = x : addSpaces xs addSpaces [] = []  addSpace :: TeXSymbolType -> Exp -> [Exp]
tests/writers/02200_Mathematical_Operators.tex view
@@ -10,7 +10,7 @@ \text{7} & \nabla & \ast & \land & :: & \ncong & \circeq & \geqq & \gtrless & \supseteq & \otimes & \models & & \divideontimes & \gtrdot & \gnsim & \\ \text{8} & \in & \circ & \vee & & \approx & & \lneqq & & \nsubseteq & \oslash & \vDash & \multimap & \bowtie & \lll & \precnsim & \\ \text{9} & \notin & \bullet & \cap & -: & & & \gneqq & & \nsupseteq & \odot & \Vdash & & \ltimes & \ggg & \succnsim & \\-\text{A} & & \sqrt{} & \cup & & \approxeq & & \ll & \prec & \subsetneq & \circledcirc & \Vvdash & \intercal & \rtimes & \lesseqgtr & \ntriangleleft & \\+\text{A} & \in & \sqrt{} & \cup & & \approxeq & & \ll & \prec & \subsetneq & \circledcirc & \Vvdash & \intercal & \rtimes & \lesseqgtr & \ntriangleleft & \\ \text{B} & \ni & \sqrt[3]{} & \int & & & & \gg & \succ & \supsetneq & \circledast & & \veebar & \leftthreetimes & \gtreqless & \ntriangleright & \\ \text{C} & & \sqrt[4]{} & \iint & \sim & & \triangleq & \between & \preccurlyeq & & & \nvdash & \barwedge & \rightthreetimes & & \ntrianglelefteq & \\ \text{D} & \ni & \propto & \iiint & \backsim & \asymp & & & \succcurlyeq & & \circleddash & \nvDash & & \backsimeq & & \ntrianglerighteq & \\
texmath.cabal view
@@ -1,5 +1,5 @@ Name:                texmath-Version:             0.10+Version:             0.10.1 Cabal-Version:       >= 1.10 Build-type:          Simple Synopsis:            Conversion between formats used to represent mathematics.@@ -94,6 +94,7 @@       Build-depends: base >= 3 && < 4     Exposed-modules:     Text.TeXMath,                          Text.TeXMath.Types,+                         Text.TeXMath.TeX,                          Text.TeXMath.Readers.TeX,                          Text.TeXMath.Readers.TeX.Macros,                          Text.TeXMath.Readers.MathML,@@ -111,7 +112,6 @@                          Text.TeXMath.Unicode.Fonts     Other-modules:       Text.TeXMath.Compat,                          Text.TeXMath.Shared,-                         Text.TeXMath.TeX,                          Paths_texmath     if impl(ghc >= 6.12)       Ghc-Options:     -Wall -fno-warn-unused-do-bind