packages feed

texmath 0.12.8.5 → 0.12.8.6

raw patch · 31 files changed

+44/−32 lines, 31 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog view
@@ -1,3 +1,7 @@+texmath (0.12.8.6)++  * Typst writer: avoid redundant `lr`s (#233).+ texmath (0.12.8.5)    * Typst writer: use ASCII symbols when possible instead of symbols (#232).
src/Text/TeXMath/Writers/Typst.hs view
@@ -246,11 +246,19 @@    where toCase = (", " <>) . T.intercalate " & " . map writeExps writeExp (EDelimited open close es) =   if isDelim open && isDelim close-     then "lr" <> inParens (open <> body <> close)+     then+       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)      else esc open <> body <> esc close   where fromDelimited (Left e)  = e         fromDelimited (Right e) = writeExp e         isDelim c = c `elem` ["(",")","[","]","{","}","|","||"]+        matchedPair "(" ")" = True+        matchedPair "[" "]" = True+        matchedPair "{" "}" = True+        matchedPair _ _ = False         body = T.unwords (map fromDelimited es) writeExp (EArray _aligns rows)   = T.intercalate "\\\n" $ map mkRow rows
test/writer/typst/02.test view
@@ -22,4 +22,4 @@     ] ] >>> typst-2 = lr((frac(lr((3 - x)) times 2, 3 - x)))+2 = (frac((3 - x) times 2, 3 - x))
test/writer/typst/04.test view
@@ -17,4 +17,4 @@     (ENumber "2") ] >>> typst-S_(upright("new")) = S_(upright("old")) - lr((5 - T))^2 / 2+S_(upright("new")) = S_(upright("old")) - (5 - T)^2 / 2
test/writer/typst/05.test view
@@ -28,4 +28,4 @@ , EIdentifier "y" ] >>> typst-integral_a^x #h(-1em) #h(-1em) #h(-1em) integral_a^s f lr((y)) thin d y thin d s = integral_a^x f lr((y)) lr((x - y)) thin d y+integral_a^x #h(-1em) #h(-1em) #h(-1em) integral_a^s f (y) thin d y thin d s = integral_a^x f (y) (x - y) thin d y
test/writer/typst/06.test view
@@ -32,4 +32,4 @@        ]) ] >>> typst-sum_(m = 1)^oo sum_(n = 1)^oo frac(m^2 thin n, 3^m lr((m thin 3^n + n thin 3^m)))+sum_(m = 1)^oo sum_(n = 1)^oo frac(m^2 thin n, 3^m (m thin 3^n + n thin 3^m))
test/writer/typst/07.test view
@@ -20,4 +20,4 @@ , EIdentifier "a" ] >>> typst-u prime.double + p lr((x)) u prime + q lr((x)) u = f lr((x)) , quad x > a+u prime.double + p (x) u prime + q (x) u = f (x) , quad x > a
test/writer/typst/08.test view
@@ -30,4 +30,4 @@ , EDelimited "(" ")" [ Right (EIdentifier "z") ] ] >>> typst-lr(|z^(‾)|) = lr(|z|) , lr(|lr((z^(‾)))^n|) = lr(|z|)^n , arg lr((z^n)) = n arg lr((z))+lr(|z^(‾)|) = lr(|z|) , lr(|(z^(‾))^n|) = lr(|z|)^n , arg (z^n) = n arg (z)
test/writer/typst/09.test view
@@ -15,4 +15,4 @@     "(" ")" [ Right (ESub (EIdentifier "z") (ENumber "0")) ] ] >>> typst-lim_(z arrow.r z_0) f lr((z)) = f lr((z_0))+lim_(z arrow.r z_0) f (z) = f (z_0)
test/writer/typst/10.test view
@@ -42,4 +42,4 @@ , EIdentifier "R" ] >>> typst-phi.alt_n lr((kappa)) = frac(1, 4 pi^2 kappa^2) integral_0^oo frac(sin lr((kappa R)), kappa R) frac(diff, diff R) lr([R^2 frac(diff D_n lr((R)), diff R)]) thin d R+phi.alt_n (kappa) = frac(1, 4 pi^2 kappa^2) integral_0^oo frac(sin (kappa R), kappa R) frac(diff, diff R) [R^2 frac(diff D_n (R), diff R)] thin d R
test/writer/typst/11.test view
@@ -23,4 +23,4 @@     NormalFrac (ENumber "1") (ESub (EIdentifier "l") (ENumber "0")) ] >>> typst-phi.alt_n lr((kappa)) = 0.033 C_n^2 kappa^(- 11 \/ 3) , quad 1 / L_0 lt.double kappa lt.double 1 / l_0+phi.alt_n (kappa) = 0.033 C_n^2 kappa^(- 11 \/ 3) , quad 1 / L_0 lt.double kappa lt.double 1 / l_0
test/writer/typst/12.test view
@@ -30,4 +30,4 @@     ] ] >>> typst-f lr((x)) = cases(delim: "{", 1 & - 1 lt.eq x < 0, 1 / 2 & x = 0, 1 - x^2 & upright("otherwise"))+f (x) = cases(delim: "{", 1 & - 1 lt.eq x < 0, 1 / 2 & x = 0, 1 - x^2 & upright("otherwise"))
test/writer/typst/13.test view
@@ -54,4 +54,4 @@     (EGrouped [ EIdentifier "n" , ESymbol Ord "!" ]) ] >>> typst-zws_p F_q lr((a_1 , dots.h , a_p ; c_1 , dots.h , c_q ; z)) = sum_(n = 0)^oo frac(lr((a_1))_n dots.h.c lr((a_p))_n, lr((c_1))_n dots.h.c lr((c_q))_n) frac(z^n, n !)+zws_p F_q (a_1 , dots.h , a_p ; c_1 , dots.h , c_q ; z) = sum_(n = 0)^oo frac((a_1)_n dots.h.c (a_p)_n, (c_1)_n dots.h.c (c_q)_n) frac(z^n, n !)
test/writer/typst/axiom_of_power_set.test view
@@ -33,4 +33,4 @@     ] ] >>> typst-forall A thin exists P thin forall B thin lr([B in P arrow.l.r.double forall C thin lr((C in B arrow.r.double C in A))])+forall A thin exists P thin forall B thin [B in P arrow.l.r.double forall C thin (C in B arrow.r.double C in A)]
test/writer/typst/binomial_coefficient.test view
@@ -40,4 +40,4 @@        ]) ] >>> typst-bold(C) lr((n , k)) = bold(C)_k^n = zws_n bold(C)_k = binom(n, k) = frac(n !, k ! thin lr((n - k)) !)+bold(C) (n , k) = bold(C)_k^n = zws_n bold(C)_k = binom(n, k) = frac(n !, k ! thin (n - k) !)
test/writer/typst/chain2.test view
@@ -49,4 +49,4 @@ , EIdentifier "x" ] >>> typst-integral_0^1 f lr((x)) #h(0em) ⅆ x = sum_(i = 0)^oo x_i = product_(i = 0)^oo x_i = product.co_(i = 0)^oo x_i = integral.cont_0^1 f lr((x)) #h(0em) ⅆ x = integral.double_0^1 f lr((x)) #h(0em) ⅆ x = integral.triple_0^1 f lr((x)) #h(0em) ⅆ x+integral_0^1 f (x) #h(0em) ⅆ x = sum_(i = 0)^oo x_i = product_(i = 0)^oo x_i = product.co_(i = 0)^oo x_i = integral.cont_0^1 f (x) #h(0em) ⅆ x = integral.double_0^1 f (x) #h(0em) ⅆ x = integral.triple_0^1 f (x) #h(0em) ⅆ x
test/writer/typst/choose.test view
@@ -18,4 +18,4 @@     ] ] >>> typst-binom(a, lr({frac(b, c + 2)}))+binom(a, {frac(b, c + 2)})
test/writer/typst/complex1.test view
@@ -601,8 +601,8 @@     ] ] >>> typst-upright("Bernoulli Trials") & P \( E \) = lr((n / k)) p_()^k \( 1 - p \)_()^(n - k)\-upright("Cauchy-Schwarz Inequality") & lr((sum_(k = 1)^n a_k^() b_k^()))_()^2 lt.eq lr((sum_(k = 1)^n a_k^2)) lr((sum_(k = 1)^n b_k^2))\+upright("Bernoulli Trials") & P \( E \) = (n / k) p_()^k \( 1 - p \)_()^(n - k)\+upright("Cauchy-Schwarz Inequality") & (sum_(k = 1)^n a_k^() b_k^())_()^2 lt.eq (sum_(k = 1)^n a_k^2) (sum_(k = 1)^n b_k^2)\ upright("Cauchy Formula") & f \( z \) thin dot.c "Ind"_gamma^() \( z \) = frac(1, 2 pi i) integral.cont_gamma^() frac(f \( xi \), xi - z) thin d xi\ upright("Cross Product") & V_1^() times V_2^() = mat(delim: "|", i, j, k; frac(diff X, diff u), frac(diff Y, diff u), 0; frac(diff X, diff v), frac(diff Y, diff v), 0)\ upright("Vandermonde Determinant") & mat(delim: "|", 1, 1, dots.h.c, 1; v_1^(), v_2^(), dots.h.c, v_n^(); v_1^2, v_2^2, dots.h.c, v_n^2; dots.v, dots.v, dots.down, dots.v; v_1^(n - 1), v_2^(n - 1), dots.h.c, v_n^(n - 1)) = product_(1 lt.eq i < j lt.eq n)^() \( v_j^() - v_i^() \)\
test/writer/typst/complex2.test view
@@ -404,5 +404,5 @@ upright("Stacked exponents") & g \( z \) = e_()^(- sum_(i = 0)^oo z_()^(frac(2, a - i)))\ upright("Cross Product") & frac(x_1^() - x_2^(), x_3^() - x_4^()) frac(x_1^() - x_4^(), x_2^() - x_3^())\ upright("Cross Product") & \( frac(x_1^() - x_2^(), x_3^() - x_4^()) \) \( frac(x_1^() - x_4^(), x_2^() - x_3^()) \)\-upright("Cross Product") & lr((frac(x_1^() - x_2^(), x_3^() - x_4^()))) lr((frac(x_1^() - x_4^(), x_2^() - x_3^())))\+upright("Cross Product") & (frac(x_1^() - x_2^(), x_3^() - x_4^())) (frac(x_1^() - x_4^(), x_2^() - x_3^()))\ upright("Cross Product") & frac(\( x_1^() - x_2^() \) \( x_3^() - x_4^() \), \( x_1^() - x_4^() \) \( x_2^() - x_3^() \))
test/writer/typst/deMorgans_law.test view
@@ -36,4 +36,4 @@     (ESymbol TOver "\175") ] >>> typst-not lr((p and q)) arrow.l.r.double lr((not p)) or lr((not q)) overline(union.big_(i = 1)^n A_i) = sect.big_(i = 1)^n overline(A_i)+not (p and q) arrow.l.r.double (not p) or (not q) overline(union.big_(i = 1)^n A_i) = sect.big_(i = 1)^n overline(A_i)
test/writer/typst/differentiable_manifold.test view
@@ -59,5 +59,5 @@     ] ] >>> typst-gamma_1 equiv gamma_2 arrow.l.r.double {gamma_1 lr((0)) = gamma_2 lr((0)) = p , upright(" and ")\-frac(upright(d), upright(d) t) phi.alt circle.stroked.tiny gamma_1 lr((t))\|_(t = 0) = frac(upright(d), upright(d) t) phi.alt circle.stroked.tiny gamma_2 lr((t))\|_(t = 0)+gamma_1 equiv gamma_2 arrow.l.r.double {gamma_1 (0) = gamma_2 (0) = p , upright(" and ")\+frac(upright(d), upright(d) t) phi.alt circle.stroked.tiny gamma_1 (t)\|_(t = 0) = frac(upright(d), upright(d) t) phi.alt circle.stroked.tiny gamma_2 (t)\|_(t = 0)
test/writer/typst/doubleint1.test view
@@ -7,4 +7,4 @@ , EIdentifier "x" ] >>> typst-integral.double_0^1 f lr((x)) #h(0em) ⅆ x+integral.double_0^1 f (x) #h(0em) ⅆ x
test/writer/typst/genfrac.test view
@@ -6,4 +6,4 @@     ] ] >>> typst-lr({x / y})+{x / y}
test/writer/typst/oint1.test view
@@ -7,4 +7,4 @@ , EIdentifier "x" ] >>> typst-integral.cont_0^1 f lr((x)) #h(0em) ⅆ x+integral.cont_0^1 f (x) #h(0em) ⅆ x
test/writer/typst/phantom.test view
@@ -7,4 +7,4 @@     ] ] >>> typst-lr((#hide[1 / 2]))+(#hide[1 / 2])
test/writer/typst/schwinger_dyson.test view
@@ -54,4 +54,4 @@     ] ] >>> typst-⟨psi lr(|cal(T) lr({frac(delta, delta phi.alt) F lr([phi.alt])})|) psi⟩ = - upright(i) ⟨psi lr(|cal(T) lr({F lr([phi.alt]) frac(delta, delta phi.alt) S lr([phi.alt])})|) psi⟩+⟨psi lr(|cal(T) {frac(delta, delta phi.alt) F [phi.alt]}|) psi⟩ = - upright(i) ⟨psi lr(|cal(T) {F [phi.alt] frac(delta, delta phi.alt) S [phi.alt]}|) psi⟩
test/writer/typst/sophomores_dream.test view
@@ -22,4 +22,4 @@     ] ] >>> typst-integral_0^1 x^x thin upright(d) x = sum_(n = 1)^oo lr((- 1))^(n + 1) thin n^(- n)+integral_0^1 x^x thin upright(d) x = sum_(n = 1)^oo (- 1)^(n + 1) thin n^(- n)
test/writer/typst/sphere_volume.test view
@@ -128,6 +128,6 @@ >>> typst S = { 0 lt.eq phi.alt lt.eq 2 pi , med 0 lt.eq theta lt.eq pi , med 0 lt.eq rho lt.eq R } upright(V o l u m e) & = integral.triple_S #h(-1em) rho^2 sin theta thin upright(d) rho thin upright(d) theta thin upright(d) phi.alt\  & = integral_0^(2 pi) #h(-1em) upright(d) phi.alt thin integral_0^pi #h(-1em) sin theta thin upright(d) theta thin integral_0^R #h(-1em) rho^2 upright(d) rho\- & = phi.alt #scale(x: 180%, y: 180%)[\|]_0^(2 pi) med lr((- cos theta)) #scale(x: 180%, y: 180%)[\|]_0^pi med 1 / 3 rho^3 #scale(x: 180%, y: 180%)[\|]_0^R\+ & = phi.alt #scale(x: 180%, y: 180%)[\|]_0^(2 pi) med (- cos theta) #scale(x: 180%, y: 180%)[\|]_0^pi med 1 / 3 rho^3 #scale(x: 180%, y: 180%)[\|]_0^R\  & = 2 pi times 2 times 1 / 3 R^3\  & = 4 / 3 pi R^3
test/writer/typst/substack.test view
@@ -34,4 +34,4 @@ ] >>> typst sum_(0 < i < m\-0 < j < n) P lr((i , j))+0 < j < n) P (i , j)
test/writer/typst/tripleint2.test view
@@ -7,4 +7,4 @@ , EIdentifier "x" ] >>> typst-integral.triple_0^1 f lr((x)) #h(0em) ⅆ x+integral.triple_0^1 f (x) #h(0em) ⅆ x
texmath.cabal view
@@ -1,5 +1,5 @@ Name:                texmath-Version:             0.12.8.5+Version:             0.12.8.6 Cabal-Version:       >= 1.10 Build-type:          Simple Synopsis:            Conversion between math formats.