Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package texmath for openSUSE:Factory checked 
in at 2024-10-28 15:20:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/texmath (Old)
 and      /work/SRC/openSUSE:Factory/.texmath.new.2020 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "texmath"

Mon Oct 28 15:20:06 2024 rev:61 rq:1218586 version:0.12.8.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/texmath/texmath.changes  2024-05-21 
18:35:20.499972718 +0200
+++ /work/SRC/openSUSE:Factory/.texmath.new.2020/texmath.changes        
2024-10-28 15:22:53.053862241 +0100
@@ -1,0 +2,25 @@
+Sat Oct  5 02:15:36 UTC 2024 - Peter Simons <[email protected]>
+
+- Update texmath to version 0.12.8.11.
+  texmath (0.12.8.11)
+
+    * TeX reader: Ignore `@{..}` and `!{..}` in array alignment specifiers 
(#241).
+
+    * TeX reader: ignore `\color` instead of crashing (#225).
+
+-------------------------------------------------------------------
+Tue Sep 10 01:22:40 UTC 2024 - Peter Simons <[email protected]>
+
+- Update texmath to version 0.12.8.10.
+  texmath (0.12.8.10)
+
+    * TeX reader: allow `\lVert .. \vVert` to create an EDelimited (#238).
+
+    * Typst writer: improved handling of primes (#239).
+      Use `'` instead of e.g. `prime`. Don't put a space before primes.
+
+    * Typst writer: improve rendering of EDelimited (#238).
+
+    * Typst writer: use `mid()` for middle delimiters (#238).
+
+-------------------------------------------------------------------

Old:
----
  texmath-0.12.8.9.tar.gz

New:
----
  texmath-0.12.8.11.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ texmath.spec ++++++
--- /var/tmp/diff_new_pack.OpH0BO/_old  2024-10-28 15:22:55.141949466 +0100
+++ /var/tmp/diff_new_pack.OpH0BO/_new  2024-10-28 15:22:55.141949466 +0100
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           %{pkg_name}
-Version:        0.12.8.9
+Version:        0.12.8.11
 Release:        0
 Summary:        Conversion between math formats
 License:        GPL-2.0-or-later

++++++ texmath-0.12.8.9.tar.gz -> texmath-0.12.8.11.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/changelog 
new/texmath-0.12.8.11/changelog
--- old/texmath-0.12.8.9/changelog      2001-09-09 03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/changelog     2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,20 @@
+texmath (0.12.8.11)
+
+  * TeX reader: Ignore `@{..}` and `!{..}` in array alignment specifiers 
(#241).
+
+  * TeX reader: ignore `\color` instead of crashing (#225).
+
+texmath (0.12.8.10)
+
+  * TeX reader: allow `\lVert .. \vVert` to create an EDelimited (#238).
+
+  * Typst writer: improved handling of primes (#239).
+    Use `'` instead of e.g. `prime`. Don't put a space before primes.
+
+  * Typst writer: improve rendering of EDelimited (#238).
+
+  * Typst writer: use `mid()` for middle delimiters (#238).
+
 texmath (0.12.8.9)
 
   * Parse TeX `\mathbf` as both bold and upright (#236).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/src/Text/TeXMath/Readers/MathML.hs 
new/texmath-0.12.8.11/src/Text/TeXMath/Readers/MathML.hs
--- old/texmath-0.12.8.9/src/Text/TeXMath/Readers/MathML.hs     2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/src/Text/TeXMath/Readers/MathML.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -52,7 +52,7 @@
 import Data.List (transpose)
 import Control.Applicative ((<|>))
 import qualified Data.Text as T
-import Control.Monad (filterM, guard)
+import Control.Monad (filterM, mzero)
 import Control.Monad.Reader (ReaderT, runReaderT, asks, local)
 import Data.Either (rights)
 
@@ -449,14 +449,14 @@
 -- Other
 
 semantics :: Element -> MML Exp
-semantics e = do
-  guard (not $ null cs)
-  first <- safeExpr (head cs)
-  if isEmpty first
-    then fromMaybe empty . getFirst . mconcat <$> mapM annotation (tail cs)
-    else return first
-  where
-    cs = elChildren e
+semantics e =
+  case elChildren e of
+    [] -> mzero
+    (c:cs) -> do
+      first <- safeExpr c
+      if isEmpty first
+        then fromMaybe empty . getFirst . mconcat <$> mapM annotation cs
+        else return first
 
 annotation :: Element -> MML (First Exp)
 annotation e = do
@@ -509,7 +509,7 @@
   align <- maybe a toAlignment <$> (findAttrQ "columnalign" e)
   case name e of
     "mtr" -> mapM (tableCell align) (elChildren e)
-    "mlabeledtr" -> mapM (tableCell align) (tail $ elChildren e)
+    "mlabeledtr" -> mapM (tableCell align) (drop 1 $ elChildren e)
     _ -> throwError $ "Invalid Element: Only expecting mtr elements " <> err e
 
 tableCell :: Alignment -> Element -> MML (Alignment, [Exp])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/src/Text/TeXMath/Readers/OMML.hs 
new/texmath-0.12.8.11/src/Text/TeXMath/Readers/OMML.hs
--- old/texmath-0.12.8.9/src/Text/TeXMath/Readers/OMML.hs       2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/src/Text/TeXMath/Readers/OMML.hs      2001-09-09 
03:46:40.000000000 +0200
@@ -1,5 +1,6 @@
 {-# LANGUAGE PatternGuards #-}
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE LambdaCase #-}
 
 {-
 Copyright (C) 2014 Jesse Rosenthal <[email protected]>
@@ -58,7 +59,9 @@
 elemToOMML :: Element -> Maybe [Exp]
 elemToOMML element  | isElem "m" "oMathPara" element = do
   let expList = mapMaybe elemToOMML (elChildren element)
-  return $ map (\l -> if length l == 1 then (head l) else EGrouped l) expList
+  return $ map (\case
+                   [x] -> x
+                   xs -> EGrouped xs) expList
 elemToOMML element  | isElem "m" "oMath" element =
   Just $ concat $ mapMaybe elemToExps $ unwrapWTags $ elChildren element
 elemToOMML _ = Nothing
@@ -238,11 +241,8 @@
 elemToExps' element | isElem "m" "acc" element = do
   let chr = filterChildName (hasElemName "m" "accPr") element >>=
             filterChildName (hasElemName "m" "chr") >>=
-            findAttrBy (hasElemName "m" "val") >>=
-            Just . head
-      chr' = case chr of
-        Just c -> T.singleton c
-        Nothing -> "\x302"       -- default to wide hat.
+            findAttrBy (hasElemName "m" "val")
+      chr' = maybe "\x302" T.pack chr  -- default to wide hat
   baseExp <- filterChildName (hasElemName "m" "e") element >>=
              elemToBase
   return $ [EOver False baseExp (ESymbol Accent chr')]
@@ -271,18 +271,17 @@
                   (elChildren element)
       inDelimExps = map (map Right) baseExps
       dPr = filterChildName (hasElemName "m" "dPr") element
+      headOrSpace [] = Just ' '
+      headOrSpace (c:_) = Just c
       begChr = dPr >>=
                filterChildName (hasElemName "m" "begChr") >>=
-               findAttrBy (hasElemName "m" "val") >>=
-               (\c -> if null c then (Just ' ') else (Just $ head c))
+               findAttrBy (hasElemName "m" "val") >>= headOrSpace
       sepChr = dPr >>=
                filterChildName (hasElemName "m" "sepChr") >>=
-               findAttrBy (hasElemName "m" "val") >>=
-               (\c -> if null c then (Just ' ') else (Just $ head c))
+               findAttrBy (hasElemName "m" "val") >>= headOrSpace
       endChr = dPr >>=
                filterChildName (hasElemName "m" "endChr") >>=
-               findAttrBy (hasElemName "m" "val") >>=
-               (\c -> if null c then (Just ' ') else (Just $ head c))
+               findAttrBy (hasElemName "m" "val") >>= headOrSpace
       beg = maybe "(" T.singleton begChr
       end = maybe ")" T.singleton endChr
       sep = maybe "|" T.singleton sepChr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/src/Text/TeXMath/Readers/TeX.hs 
new/texmath-0.12.8.11/src/Text/TeXMath/Readers/TeX.hs
--- old/texmath-0.12.8.9/src/Text/TeXMath/Readers/TeX.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/src/Text/TeXMath/Readers/TeX.hs       2001-09-09 
03:46:40.000000000 +0200
@@ -202,6 +202,7 @@
   choice
     [ text c
     , styled c
+    , colored c
     , root c
     , xspace c
     , mathop c
@@ -407,19 +408,17 @@
 
 delimitedImplicit :: TP Exp
 delimitedImplicit = try $ do
-  openc <- lexeme $ oneOf "()[]|"
-  closec <- case openc of
-                 '(' -> return ')'
-                 '[' -> return ']'
-                 '|' -> return '|'
-                 _   -> mzero
-  let closer = lexeme $ char closec
+  (opent, closer) <-
+           (("(", symbol ")") <$ symbol "(")
+       <|> (("[", symbol "]") <$ symbol "[")
+       <|> (("|", symbol "|") <$ symbol "|")
+       <|> (("\x2016", "\x2016" <$ ctrlseq "rVert") <$ ctrlseq "lVert")
   contents <- concat <$>
               many (try $ ((:[]) . Left  <$> middle)
                       <|> (map Right . unGrouped <$>
                              many1Exp (notFollowedBy closer *> expr)))
-  _ <- closer
-  return $ EDelimited (T.singleton openc) (T.singleton closec) contents
+  closet <- T.pack <$> closer
+  return $ EDelimited opent closet contents
 
 scaled :: Text -> TP Exp
 scaled cmd = do
@@ -454,8 +453,10 @@
 
 arrayAlignments :: TP [Alignment]
 arrayAlignments = mconcat <$>
-  braces (many (((:[]) . letterToAlignment <$> letter)
+  braces (many (
+                ((:[]) . letterToAlignment <$> letter)
             <|> ([] <$ char '|')
+            <|> ([] <$ ((char '@' <|> char '!') <* inbraces))
             <|> (do char '*'
                     num <- T.pack <$> braces (many1 digit)
                     cols <- arrayAlignments
@@ -676,6 +677,13 @@
                        _           -> f [x]
        Nothing  -> mzero
 
+colored :: Text -> TP Exp
+colored "\\color" = do
+  _ <- inbraces -- skip the color
+  -- in the future we might add color to the types or to the styles
+  texSymbol <|> inbraces <|> texChar
+colored _ = mzero
+
 -- note: sqrt can be unary, \sqrt{2}, or binary, \sqrt[3]{2}
 root :: Text -> TP Exp
 root c = do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/src/Text/TeXMath/Writers/Typst.hs 
new/texmath-0.12.8.11/src/Text/TeXMath/Writers/Typst.hs
--- old/texmath-0.12.8.9/src/Text/TeXMath/Writers/Typst.hs      2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/src/Text/TeXMath/Writers/Typst.hs     2001-09-09 
03:46:40.000000000 +0200
@@ -37,10 +37,19 @@
 -- | Transforms an expression tree to equivalent Typst
 writeTypst :: DisplayType -> [Exp] -> Text
 writeTypst dt exprs =
-  T.unwords $ map writeExp $ everywhere (mkT $ S.handleDownup dt) exprs
+  writeExps $ everywhere (mkT $ S.handleDownup dt) exprs
 
 writeExps :: [Exp] -> Text
-writeExps = T.intercalate " " . map writeExp
+writeExps = go . map writeExp
+ where
+   go (a : b : es)
+    | T.take 1 b == "'" -- avoid space before a prime #239
+     = a <> go (b:es)
+   go (a : as)
+     = a <> if null as
+               then mempty
+               else " " <> go as
+   go [] = mempty
 
 inParens :: Text -> Text
 inParens s = "(" <> s <> ")"
@@ -101,6 +110,10 @@
 writeExp (ESymbol _t s)
   | T.all isAscii s = esc s  -- use '+' not 'plus'
   | s == "\x2212" = "-" -- use '-' not 'minus'
+  | s == "\8242" = "'" -- use ' for prime, see #239
+  | s == "\8243" = "''"
+  | s == "\8244" = "'''"
+  | s == "\8279" = "''''"
   | otherwise = fromMaybe (esc s) $ M.lookup s typstSymbolMap
 writeExp (EIdentifier s) =
   if T.length s == 1
@@ -247,14 +260,24 @@
 writeExp (EDelimited open close es) =
   if isDelim open && isDelim close
      then
-       if matchedPair open close &&  -- see #233
+       (if matchedPair open close &&  -- see #233
             not (any (\x -> x == Left open || x == Left close) es)
-          then open <> body <> close
-          else "lr" <> inParens (open <> body <> close)
+           then id
+           else ("lr" <>) . inParens)
+          (renderOpen open <> body <> renderClose close)
      else esc open <> body <> esc close
-  where fromDelimited (Left e)  = e
+  where fromDelimited (Left e)  = "mid(" <> renderSymbol e <> ")"
         fromDelimited (Right e) = writeExp e
-        isDelim c = c `elem` ["(",")","[","]","{","}","|","||"]
+        isDelim c = c `elem` ["(",")","[","]","{","}","|","||","\x2016"]
+        renderOpen e =
+          if T.all isAscii e
+             then e
+             else renderSymbol e <> " "
+        renderClose e =
+          if T.all isAscii e
+             then e
+             else " " <> renderSymbol e
+        renderSymbol e = fromMaybe (esc e) (M.lookup e typstSymbolMap)
         matchedPair "(" ")" = True
         matchedPair "[" "]" = True
         matchedPair "{" "}" = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/regression/238.test 
new/texmath-0.12.8.11/test/regression/238.test
--- old/texmath-0.12.8.9/test/regression/238.test       1970-01-01 
01:00:00.000000000 +0100
+++ new/texmath-0.12.8.11/test/regression/238.test      2001-09-09 
03:46:40.000000000 +0200
@@ -0,0 +1,4 @@
+<<< tex
+\left\{ x \in \mathbb{R}^n \middle| \lVert x \rVert_2^2 = \sum_{i=1}^n x_i^2 = 
1\right\}
+>>> typst
+{x in bb(R)^n mid(bar.v) lr(bar.v.double x bar.v.double)_2^2 = sum_(i = 1)^n 
x_i^2 = 1}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/regression/239.test 
new/texmath-0.12.8.11/test/regression/239.test
--- old/texmath-0.12.8.9/test/regression/239.test       1970-01-01 
01:00:00.000000000 +0100
+++ new/texmath-0.12.8.11/test/regression/239.test      2001-09-09 
03:46:40.000000000 +0200
@@ -0,0 +1,4 @@
+<<< tex
+f'_n
+>>> typst
+f'_n
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/regression/241.test 
new/texmath-0.12.8.11/test/regression/241.test
--- old/texmath-0.12.8.9/test/regression/241.test       1970-01-01 
01:00:00.000000000 +0100
+++ new/texmath-0.12.8.11/test/regression/241.test      2001-09-09 
03:46:40.000000000 +0200
@@ -0,0 +1,30 @@
+<<< tex
+\begin{array}{l@{\qquad}l}
+\text{Infection/colonization episode} & \text{Waning immunity episode}\\
+b^{\prime}(t) = \mu_{0}b(t) - cy(t) & b(t) = 0 
+\end{array}
+>>> native
+[ EArray
+    [ AlignLeft , AlignLeft ]
+    [ [ [ EText TextNormal "Infection/colonization episode" ]
+      , [ EText TextNormal "Waning immunity episode" ]
+      ]
+    , [ [ ESuper (EIdentifier "b") (ESymbol Ord "\8242")
+        , EDelimited "(" ")" [ Right (EIdentifier "t") ]
+        , ESymbol Rel "="
+        , ESub (EIdentifier "\956") (ENumber "0")
+        , EIdentifier "b"
+        , EDelimited "(" ")" [ Right (EIdentifier "t") ]
+        , ESymbol Bin "\8722"
+        , EIdentifier "c"
+        , EIdentifier "y"
+        , EDelimited "(" ")" [ Right (EIdentifier "t") ]
+        ]
+      , [ EIdentifier "b"
+        , EDelimited "(" ")" [ Right (EIdentifier "t") ]
+        , ESymbol Rel "="
+        , ENumber "0"
+        ]
+      ]
+    ]
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/writer/typst/07.test 
new/texmath-0.12.8.11/test/writer/typst/07.test
--- old/texmath-0.12.8.9/test/writer/typst/07.test      2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/test/writer/typst/07.test     2001-09-09 
03:46:40.000000000 +0200
@@ -20,4 +20,4 @@
 , EIdentifier "a"
 ]
 >>> typst
-u prime.double + p (x) u prime + q (x) u = f (x) , quad x > a
+u'' + p (x) u' + q (x) u = f (x) , quad x > a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/writer/typst/primes1.test 
new/texmath-0.12.8.11/test/writer/typst/primes1.test
--- old/texmath-0.12.8.9/test/writer/typst/primes1.test 2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/test/writer/typst/primes1.test        2001-09-09 
03:46:40.000000000 +0200
@@ -37,4 +37,4 @@
 , ESuper (ESymbol Accent "'") (ESymbol Accent "'")
 ]
 >>> typst
-x^2 + 2^2 + x^prime + x^(') + x^("''") + x prime + x^(')^(') + x^(')^2 + x^(' 
+ ') + x^(')^(') + x^('^(')) + '^(') + '^(')
+x^2 + 2^2 + x^(') + x^(') + x^("''") + x' + x^(')^(') + x^(')^2 + x^(' +') + 
x^(')^(') + x^('^(')) +'^(') +'^(')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/test/writer/typst/primes2.test 
new/texmath-0.12.8.11/test/writer/typst/primes2.test
--- old/texmath-0.12.8.9/test/writer/typst/primes2.test 2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/test/writer/typst/primes2.test        2001-09-09 
03:46:40.000000000 +0200
@@ -27,4 +27,4 @@
 , ESuper (EIdentifier "H") (ESymbol Accent "\8279")
 ]
 >>> typst
-H^(\") H^(') H^(\*) H^(`) H^ª H^degree H^(²) H^(³) H^acute H^(¹) H^º 
H^quote.l.single H^quote.r.single H^quote.low.single H^quote.high.single 
H^quote.l.double H^quote.r.double H^quote.low.double H^quote.high.double 
H^prime H^prime.double H^prime.triple H^prime.rev H^prime.double.rev 
H^prime.triple.rev H^prime.quad
+H^(\") H^(') H^(\*) H^(`) H^ª H^degree H^(²) H^(³) H^acute H^(¹) H^º 
H^quote.l.single H^quote.r.single H^quote.low.single H^quote.high.single 
H^quote.l.double H^quote.r.double H^quote.low.double H^quote.high.double H^(') 
H^('') H^(''') H^prime.rev H^prime.double.rev H^prime.triple.rev H^('''')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.12.8.9/texmath.cabal 
new/texmath-0.12.8.11/texmath.cabal
--- old/texmath-0.12.8.9/texmath.cabal  2001-09-09 03:46:40.000000000 +0200
+++ new/texmath-0.12.8.11/texmath.cabal 2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                texmath
-Version:             0.12.8.9
+Version:             0.12.8.11
 Cabal-Version:       >= 1.10
 Build-type:          Simple
 Synopsis:            Conversion between math formats.

Reply via email to