Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package texmath for openSUSE:Factory checked 
in at 2025-10-10 17:11:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/texmath (Old)
 and      /work/SRC/openSUSE:Factory/.texmath.new.5300 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "texmath"

Fri Oct 10 17:11:05 2025 rev:69 rq:1310479 version:0.13.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/texmath/texmath.changes  2025-09-12 
21:10:18.237185106 +0200
+++ /work/SRC/openSUSE:Factory/.texmath.new.5300/texmath.changes        
2025-10-10 17:12:55.078253845 +0200
@@ -1,0 +2,12 @@
+Sun Oct  5 15:13:14 UTC 2025 - Peter Simons <[email protected]>
+
+- Update texmath to version 0.13.0.1.
+  texmath (0.13.0.1)
+
+    * TeX reader: fix parsing of primes (#273).
+      We previously misparsed `a_i'` as `a_{i'}` rather than `{a_i}'`.
+
+    * Typst writer: fix position of primes with ESubSup.
+      In typst, unlike tex, the primes must come after the base.
+
+-------------------------------------------------------------------

Old:
----
  texmath-0.13.tar.gz

New:
----
  texmath-0.13.0.1.tar.gz

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

Other differences:
------------------
++++++ texmath.spec ++++++
--- /var/tmp/diff_new_pack.9tyeld/_old  2025-10-10 17:12:56.638319602 +0200
+++ /var/tmp/diff_new_pack.9tyeld/_new  2025-10-10 17:12:56.650320108 +0200
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           %{pkg_name}
-Version:        0.13
+Version:        0.13.0.1
 Release:        0
 Summary:        Conversion between math formats
 License:        GPL-2.0-or-later

++++++ texmath-0.13.tar.gz -> texmath-0.13.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.13/changelog.md 
new/texmath-0.13.0.1/changelog.md
--- old/texmath-0.13/changelog.md       2001-09-09 03:46:40.000000000 +0200
+++ new/texmath-0.13.0.1/changelog.md   2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,11 @@
+texmath (0.13.0.1)
+
+  * TeX reader: fix parsing of primes (#273).
+    We previously misparsed `a_i'` as `a_{i'}` rather than `{a_i}'`.
+
+  * Typst writer: fix position of primes with ESubSup.
+    In typst, unlike tex, the primes must come after the base.
+
 texmath (0.13)
 
   * Add cancellation of terms for most formats. (#271, #251, #269).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.13/src/Text/TeXMath/Readers/TeX.hs 
new/texmath-0.13.0.1/src/Text/TeXMath/Readers/TeX.hs
--- old/texmath-0.13/src/Text/TeXMath/Readers/TeX.hs    2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.13.0.1/src/Text/TeXMath/Readers/TeX.hs        2001-09-09 
03:46:40.000000000 +0200
@@ -52,28 +52,22 @@
 
 -- The parser
 
-expr1 :: TP Exp
-expr1 = do
-  e <- expr2
-  -- check for primes and add them as a subscript
-  -- in TeX ' is shorthand for ^{\prime}
-  primes <- many (char '\'')
-  let getPrimes cs = case cs of
-                       "" -> ""
-                       "'" -> "\x2032"
-                       "''" -> "\x2033"
-                       "'''" -> "\x2034"
-                       "''''" -> "\x2057"
-                       _ -> "\x2057" ++ getPrimes (drop 4 cs)
-  ignorable
-  case getPrimes primes of
-    "" -> return e
-    cs -> return $ case e of
-                     ESub b sub -> ESubsup b sub (ESymbol Pun (T.pack cs))
-                     _ -> ESuper e (ESymbol Pun (T.pack cs))
+primes :: TP Exp
+primes = do
+  ESymbol Pun . getPrimes <$> (many1 (char '\'') <* ignorable)
+
+getPrimes :: [Char] -> Text
+getPrimes cs =
+  case cs of
+    "" -> ""
+    "'" -> "\x2032"
+    "''" -> "\x2033"
+    "'''" -> "\x2034"
+    "''''" -> "\x2057"
+    _ -> "\x2057" <> getPrimes (drop 4 cs)
 
-expr2 :: TP Exp
-expr2 = choice
+expr1 :: TP Exp
+expr1 = choice
           [ inbraces
           , variable
           , number
@@ -255,7 +249,7 @@
     ctrlseq "operatorname"
     -- these are slightly different but we won't worry about that here...
     convertible <- (char '*' >> spaces >> return True) <|> return False
-    tok' <- texSymbol <|> braces (manyExp expr2) <|> texChar
+    tok' <- texSymbol <|> braces (manyExp expr1) <|> texChar
     tok'' <- (EMathOperator <$> (expToOperatorName tok'))
            <|> return (EStyled TextNormal [tok'])
     return (tok'', convertible)
@@ -613,8 +607,8 @@
 
 subSup :: Maybe Bool -> Bool -> Exp -> TP Exp
 subSup limits convertible a = try $ do
-  let sub1 = symbol "_" >> expr1
-  let sup1 = symbol "^" >> expr1
+  let sub1 = symbol "_" >> expr1  -- see #273
+  let sup1 = (symbol "^" >> expr1) <|> primes
   (b,c) <- try (do {m <- sub1; n <- sup1; return (m,n)})
        <|> (do {n <- sup1; m <- sub1; return (m,n)})
   return $ case limits of
@@ -625,9 +619,8 @@
 
 superOrSubscripted :: Maybe Bool -> Bool -> Exp -> TP Exp
 superOrSubscripted limits convertible a = try $ do
-  c <- oneOf "^_"
-  spaces
-  b <- expr
+  (c,b) <- ((,) <$> oneOf "^_" <*> (spaces >> expr))
+          <|> (('^',) <$> primes)
   case c of
        '^' -> return $ case limits of
                         Just True  -> EOver False a b
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.13/src/Text/TeXMath/Writers/Typst.hs 
new/texmath-0.13.0.1/src/Text/TeXMath/Writers/Typst.hs
--- old/texmath-0.13/src/Text/TeXMath/Writers/Typst.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/texmath-0.13.0.1/src/Text/TeXMath/Writers/Typst.hs      2001-09-09 
03:46:40.000000000 +0200
@@ -141,11 +141,12 @@
 writeExp (ESuper b e1) = writeExpB b <>
   case S.toPrimes e1 of
     Just ps -> ps
-    _ -> "^" <> writeExpS e1
-writeExp (ESubsup b e1 e2) = writeExpB b <> "_" <> writeExpS e1 <>
-  case S.toPrimes e2 of
-    Just ps -> ps
-    _ -> "^" <> writeExpS e2
+    Nothing -> "^" <> writeExpS e1
+writeExp (ESubsup b e1 e2) =
+  writeExpB b <>
+    case S.toPrimes e2 of
+      Just ps -> ps <> "_" <> writeExpS e1
+      Nothing -> "_" <> writeExpS e1 <> "^" <> writeExpS e2
 writeExp (EOver _ (EOver _ b (ESymbol TOver "\9182")) e1) =
   "overbrace(" <> writeExp b <> ", " <> writeExp e1 <> ")"
 writeExp (EOver _ (EOver _ b (ESymbol TOver "\9140")) e1) =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.13/test/regression/273.test 
new/texmath-0.13.0.1/test/regression/273.test
--- old/texmath-0.13/test/regression/273.test   1970-01-01 01:00:00.000000000 
+0100
+++ new/texmath-0.13.0.1/test/regression/273.test       2001-09-09 
03:46:40.000000000 +0200
@@ -0,0 +1,5 @@
+<<< tex
+a_i'
+>>> native
+[ ESubsup (EIdentifier "a") (EIdentifier "i") (ESymbol Pun "\8242")
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/texmath-0.13/texmath.cabal 
new/texmath-0.13.0.1/texmath.cabal
--- old/texmath-0.13/texmath.cabal      2001-09-09 03:46:40.000000000 +0200
+++ new/texmath-0.13.0.1/texmath.cabal  2001-09-09 03:46:40.000000000 +0200
@@ -1,5 +1,5 @@
 Name:                texmath
-Version:             0.13
+Version:             0.13.0.1
 Cabal-Version:       >= 1.10
 Build-type:          Simple
 Synopsis:            Conversion between math formats.

Reply via email to