You can subscribe to this list here.
| 2001 | 
          Jan
           | 
        
        
        
        
          Feb
           | 
        
        
        
        
          Mar
           | 
        
        
        
        
          Apr
           | 
        
        
        
        
          May
           | 
        
        
        
        
          Jun
           | 
        
        
        
        
          Jul
           | 
        
        
        
        
          Aug
           | 
        
        
        
        
          Sep
           | 
        
        
        
        
          Oct
           | 
        
        
        
        
          Nov
           (20)  | 
        
        
        
        
          Dec
           (17)  | 
        
      
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 | 
          Jan
           (39)  | 
        
        
        
        
          Feb
           (21)  | 
        
        
        
        
          Mar
           (33)  | 
        
        
        
        
          Apr
           (135)  | 
        
        
        
        
          May
           (53)  | 
        
        
        
        
          Jun
           (88)  | 
        
        
        
        
          Jul
           (47)  | 
        
        
        
        
          Aug
           (59)  | 
        
        
        
        
          Sep
           (207)  | 
        
        
        
        
          Oct
           (40)  | 
        
        
        
        
          Nov
           (7)  | 
        
        
        
        
          Dec
           (26)  | 
        
      
| 2003 | 
          Jan
           (49)  | 
        
        
        
        
          Feb
           (39)  | 
        
        
        
        
          Mar
           (117)  | 
        
        
        
        
          Apr
           (50)  | 
        
        
        
        
          May
           (62)  | 
        
        
        
        
          Jun
           (6)  | 
        
        
        
        
          Jul
           (19)  | 
        
        
        
        
          Aug
           (24)  | 
        
        
        
        
          Sep
           (11)  | 
        
        
        
        
          Oct
           (11)  | 
        
        
        
        
          Nov
           (49)  | 
        
        
        
        
          Dec
           (9)  | 
        
      
| 2004 | 
          Jan
           (29)  | 
        
        
        
        
          Feb
           (123)  | 
        
        
        
        
          Mar
           (32)  | 
        
        
        
        
          Apr
           (53)  | 
        
        
        
        
          May
           (52)  | 
        
        
        
        
          Jun
           (19)  | 
        
        
        
        
          Jul
           (33)  | 
        
        
        
        
          Aug
           (10)  | 
        
        
        
        
          Sep
           (76)  | 
        
        
        
        
          Oct
           (86)  | 
        
        
        
        
          Nov
           (171)  | 
        
        
        
        
          Dec
           (163)  | 
        
      
| 2005 | 
          Jan
           (147)  | 
        
        
        
        
          Feb
           (121)  | 
        
        
        
        
          Mar
           (120)  | 
        
        
        
        
          Apr
           (126)  | 
        
        
        
        
          May
           (120)  | 
        
        
        
        
          Jun
           (213)  | 
        
        
        
        
          Jul
           (76)  | 
        
        
        
        
          Aug
           (79)  | 
        
        
        
        
          Sep
           (140)  | 
        
        
        
        
          Oct
           (83)  | 
        
        
        
        
          Nov
           (156)  | 
        
        
        
        
          Dec
           (202)  | 
        
      
| 2006 | 
          Jan
           (181)  | 
        
        
        
        
          Feb
           (171)  | 
        
        
        
        
          Mar
           (157)  | 
        
        
        
        
          Apr
           (98)  | 
        
        
        
        
          May
           (96)  | 
        
        
        
        
          Jun
           (97)  | 
        
        
        
        
          Jul
           (193)  | 
        
        
        
        
          Aug
           (76)  | 
        
        
        
        
          Sep
           (130)  | 
        
        
        
        
          Oct
           (63)  | 
        
        
        
        
          Nov
           (196)  | 
        
        
        
        
          Dec
           (253)  | 
        
      
| 2007 | 
          Jan
           (256)  | 
        
        
        
        
          Feb
           (293)  | 
        
        
        
        
          Mar
           (276)  | 
        
        
        
        
          Apr
           (258)  | 
        
        
        
        
          May
           (181)  | 
        
        
        
        
          Jun
           (91)  | 
        
        
        
        
          Jul
           (108)  | 
        
        
        
        
          Aug
           (69)  | 
        
        
        
        
          Sep
           (107)  | 
        
        
        
        
          Oct
           (179)  | 
        
        
        
        
          Nov
           (137)  | 
        
        
        
        
          Dec
           (121)  | 
        
      
| 2008 | 
          Jan
           (124)  | 
        
        
        
        
          Feb
           (129)  | 
        
        
        
        
          Mar
           (192)  | 
        
        
        
        
          Apr
           (201)  | 
        
        
        
        
          May
           (90)  | 
        
        
        
        
          Jun
           (86)  | 
        
        
        
        
          Jul
           (115)  | 
        
        
        
        
          Aug
           (142)  | 
        
        
        
        
          Sep
           (49)  | 
        
        
        
        
          Oct
           (91)  | 
        
        
        
        
          Nov
           (95)  | 
        
        
        
        
          Dec
           (218)  | 
        
      
| 2009 | 
          Jan
           (230)  | 
        
        
        
        
          Feb
           (149)  | 
        
        
        
        
          Mar
           (118)  | 
        
        
        
        
          Apr
           (72)  | 
        
        
        
        
          May
           (77)  | 
        
        
        
        
          Jun
           (68)  | 
        
        
        
        
          Jul
           (102)  | 
        
        
        
        
          Aug
           (72)  | 
        
        
        
        
          Sep
           (89)  | 
        
        
        
        
          Oct
           (76)  | 
        
        
        
        
          Nov
           (125)  | 
        
        
        
        
          Dec
           (86)  | 
        
      
| 2010 | 
          Jan
           (75)  | 
        
        
        
        
          Feb
           (90)  | 
        
        
        
        
          Mar
           (89)  | 
        
        
        
        
          Apr
           (121)  | 
        
        
        
        
          May
           (111)  | 
        
        
        
        
          Jun
           (66)  | 
        
        
        
        
          Jul
           (75)  | 
        
        
        
        
          Aug
           (66)  | 
        
        
        
        
          Sep
           (66)  | 
        
        
        
        
          Oct
           (166)  | 
        
        
        
        
          Nov
           (121)  | 
        
        
        
        
          Dec
           (73)  | 
        
      
| 2011 | 
          Jan
           (74)  | 
        
        
        
        
          Feb
           | 
        
        
        
        
          Mar
           | 
        
        
        
        
          Apr
           (14)  | 
        
        
        
        
          May
           (22)  | 
        
        
        
        
          Jun
           (31)  | 
        
        
        
        
          Jul
           (53)  | 
        
        
        
        
          Aug
           (37)  | 
        
        
        
        
          Sep
           (23)  | 
        
        
        
        
          Oct
           (25)  | 
        
        
        
        
          Nov
           (31)  | 
        
        
        
        
          Dec
           (28)  | 
        
      
| 2012 | 
          Jan
           (18)  | 
        
        
        
        
          Feb
           (11)  | 
        
        
        
        
          Mar
           (32)  | 
        
        
        
        
          Apr
           (17)  | 
        
        
        
        
          May
           (48)  | 
        
        
        
        
          Jun
           (37)  | 
        
        
        
        
          Jul
           (23)  | 
        
        
        
        
          Aug
           (54)  | 
        
        
        
        
          Sep
           (15)  | 
        
        
        
        
          Oct
           (11)  | 
        
        
        
        
          Nov
           (19)  | 
        
        
        
        
          Dec
           (22)  | 
        
      
| 2013 | 
          Jan
           (11)  | 
        
        
        
        
          Feb
           (32)  | 
        
        
        
        
          Mar
           (24)  | 
        
        
        
        
          Apr
           (37)  | 
        
        
        
        
          May
           (31)  | 
        
        
        
        
          Jun
           (14)  | 
        
        
        
        
          Jul
           (26)  | 
        
        
        
        
          Aug
           (33)  | 
        
        
        
        
          Sep
           (40)  | 
        
        
        
        
          Oct
           (21)  | 
        
        
        
        
          Nov
           (36)  | 
        
        
        
        
          Dec
           (84)  | 
        
      
| 2014 | 
          Jan
           (23)  | 
        
        
        
        
          Feb
           (20)  | 
        
        
        
        
          Mar
           (27)  | 
        
        
        
        
          Apr
           (24)  | 
        
        
        
        
          May
           (31)  | 
        
        
        
        
          Jun
           (27)  | 
        
        
        
        
          Jul
           (34)  | 
        
        
        
        
          Aug
           (26)  | 
        
        
        
        
          Sep
           (21)  | 
        
        
        
        
          Oct
           (45)  | 
        
        
        
        
          Nov
           (23)  | 
        
        
        
        
          Dec
           (73)  | 
        
      
| 2015 | 
          Jan
           (33)  | 
        
        
        
        
          Feb
           (8)  | 
        
        
        
        
          Mar
           (24)  | 
        
        
        
        
          Apr
           (45)  | 
        
        
        
        
          May
           (27)  | 
        
        
        
        
          Jun
           (19)  | 
        
        
        
        
          Jul
           (21)  | 
        
        
        
        
          Aug
           (51)  | 
        
        
        
        
          Sep
           (43)  | 
        
        
        
        
          Oct
           (29)  | 
        
        
        
        
          Nov
           (61)  | 
        
        
        
        
          Dec
           (86)  | 
        
      
| 2016 | 
          Jan
           (99)  | 
        
        
        
        
          Feb
           (52)  | 
        
        
        
        
          Mar
           (80)  | 
        
        
        
        
          Apr
           (61)  | 
        
        
        
        
          May
           (24)  | 
        
        
        
        
          Jun
           (23)  | 
        
        
        
        
          Jul
           (36)  | 
        
        
        
        
          Aug
           (30)  | 
        
        
        
        
          Sep
           (41)  | 
        
        
        
        
          Oct
           (43)  | 
        
        
        
        
          Nov
           (27)  | 
        
        
        
        
          Dec
           (46)  | 
        
      
| 2017 | 
          Jan
           (57)  | 
        
        
        
        
          Feb
           (34)  | 
        
        
        
        
          Mar
           (40)  | 
        
        
        
        
          Apr
           (31)  | 
        
        
        
        
          May
           (78)  | 
        
        
        
        
          Jun
           (49)  | 
        
        
        
        
          Jul
           (72)  | 
        
        
        
        
          Aug
           (33)  | 
        
        
        
        
          Sep
           (26)  | 
        
        
        
        
          Oct
           (82)  | 
        
        
        
        
          Nov
           (69)  | 
        
        
        
        
          Dec
           (29)  | 
        
      
| 2018 | 
          Jan
           (43)  | 
        
        
        
        
          Feb
           (9)  | 
        
        
        
        
          Mar
           | 
        
        
        
        
          Apr
           (40)  | 
        
        
        
        
          May
           (34)  | 
        
        
        
        
          Jun
           (49)  | 
        
        
        
        
          Jul
           (45)  | 
        
        
        
        
          Aug
           (8)  | 
        
        
        
        
          Sep
           (51)  | 
        
        
        
        
          Oct
           (75)  | 
        
        
        
        
          Nov
           (103)  | 
        
        
        
        
          Dec
           (80)  | 
        
      
| 2019 | 
          Jan
           (153)  | 
        
        
        
        
          Feb
           (78)  | 
        
        
        
        
          Mar
           (47)  | 
        
        
        
        
          Apr
           (48)  | 
        
        
        
        
          May
           (63)  | 
        
        
        
        
          Jun
           (54)  | 
        
        
        
        
          Jul
           (10)  | 
        
        
        
        
          Aug
           (7)  | 
        
        
        
        
          Sep
           (17)  | 
        
        
        
        
          Oct
           (24)  | 
        
        
        
        
          Nov
           (29)  | 
        
        
        
        
          Dec
           (17)  | 
        
      
| 2020 | 
          Jan
           (22)  | 
        
        
        
        
          Feb
           (74)  | 
        
        
        
        
          Mar
           (47)  | 
        
        
        
        
          Apr
           (48)  | 
        
        
        
        
          May
           (12)  | 
        
        
        
        
          Jun
           (44)  | 
        
        
        
        
          Jul
           (13)  | 
        
        
        
        
          Aug
           (18)  | 
        
        
        
        
          Sep
           (26)  | 
        
        
        
        
          Oct
           (36)  | 
        
        
        
        
          Nov
           (25)  | 
        
        
        
        
          Dec
           (23)  | 
        
      
| 2021 | 
          Jan
           (28)  | 
        
        
        
        
          Feb
           (25)  | 
        
        
        
        
          Mar
           (58)  | 
        
        
        
        
          Apr
           (76)  | 
        
        
        
        
          May
           (72)  | 
        
        
        
        
          Jun
           (70)  | 
        
        
        
        
          Jul
           (25)  | 
        
        
        
        
          Aug
           (67)  | 
        
        
        
        
          Sep
           (17)  | 
        
        
        
        
          Oct
           (24)  | 
        
        
        
        
          Nov
           (30)  | 
        
        
        
        
          Dec
           (30)  | 
        
      
| 2022 | 
          Jan
           (51)  | 
        
        
        
        
          Feb
           (39)  | 
        
        
        
        
          Mar
           (72)  | 
        
        
        
        
          Apr
           (65)  | 
        
        
        
        
          May
           (30)  | 
        
        
        
        
          Jun
           (72)  | 
        
        
        
        
          Jul
           (129)  | 
        
        
        
        
          Aug
           (44)  | 
        
        
        
        
          Sep
           (45)  | 
        
        
        
        
          Oct
           (30)  | 
        
        
        
        
          Nov
           (48)  | 
        
        
        
        
          Dec
           (275)  | 
        
      
| 2023 | 
          Jan
           (235)  | 
        
        
        
        
          Feb
           (232)  | 
        
        
        
        
          Mar
           (68)  | 
        
        
        
        
          Apr
           (16)  | 
        
        
        
        
          May
           (52)  | 
        
        
        
        
          Jun
           (87)  | 
        
        
        
        
          Jul
           (143)  | 
        
        
        
        
          Aug
           (32)  | 
        
        
        
        
          Sep
           (26)  | 
        
        
        
        
          Oct
           (15)  | 
        
        
        
        
          Nov
           (20)  | 
        
        
        
        
          Dec
           (74)  | 
        
      
| 2024 | 
          Jan
           (119)  | 
        
        
        
        
          Feb
           (32)  | 
        
        
        
        
          Mar
           (64)  | 
        
        
        
        
          Apr
           (68)  | 
        
        
        
        
          May
           (30)  | 
        
        
        
        
          Jun
           (50)  | 
        
        
        
        
          Jul
           (37)  | 
        
        
        
        
          Aug
           (32)  | 
        
        
        
        
          Sep
           (10)  | 
        
        
        
        
          Oct
           (27)  | 
        
        
        
        
          Nov
           (47)  | 
        
        
        
        
          Dec
           (36)  | 
        
      
| 2025 | 
          Jan
           (94)  | 
        
        
        
        
          Feb
           (68)  | 
        
        
        
        
          Mar
           (79)  | 
        
        
        
        
          Apr
           (66)  | 
        
        
        
        
          May
           (46)  | 
        
        
        
        
          Jun
           (21)  | 
        
        
        
        
          Jul
           (134)  | 
        
        
        
        
          Aug
           (134)  | 
        
        
        
        
          Sep
           (53)  | 
        
        
        
        
          Oct
           (24)  | 
        
        
        
        
          Nov
           (9)  | 
        
        
        
        
          Dec
           | 
        
      
| 
     
      
      
      From: peterpall <pet...@us...> - 2025-09-11 07:20:54
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  db363e9acd3412d1e0bd1f8e2f04fa1f1fd3d886 (commit)
      from  9ab39fcc3b33194ee7e818e65877337cd8c4a9f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit db363e9acd3412d1e0bd1f8e2f04fa1f1fd3d886
Author: Gunter Königsmann <gu...@pe...>
Date:   Thu Sep 11 09:20:37 2025 +0200
    wrstcse: Documented the new command
diff --git a/doc/info/wrstcse.texi b/doc/info/wrstcse.texi
index 453503f5b..a156d2949 100644
--- a/doc/info/wrstcse.texi
+++ b/doc/info/wrstcse.texi
@@ -271,7 +271,7 @@ Note that changing the number of @var{tol[n]} will change the statistical distri
 of the results over the @var{tol[n]} space and therefore will change the statistical
 distribution of the montecarlo method and the results of the root sum square functions.
 
-See also @mref{wc_mintypmax} and @mrefdot{wc_montecarlo}
+See also @mrefcomma{wc_toltaylor} @mref{wc_mintypmax} and @mrefdot{wc_montecarlo}
 
 Example:
 @c ===beg===
@@ -358,6 +358,64 @@ Example:
 @end example
 @end deffn
 
+@anchor{wc_toltaylor}
+@deffn {Function} wc_toltaylor (@var{expression}, [n])
+
+Tries to approximate the dependence of @code{expr} of all @var{tol[n]} it contains
+by a tailor series.
+
+If the dependence is different for positive and negative @var{tol[n]} the higher
+dependence is used as a worst-case assumption.
+
+See also @mrefdot{wc_ewc_simplify}
+
+Example:
+@c ===beg===
+@c vals:[
+@c     R_1=100*(1+.01*tol[1]),
+@c     R_2=200*(1+.01*tol[2])
+@c ];
+@c ic:I_Out=exp(R_1/(R_1+R_2));
+@c subst(vals,ic);
+@c float(wc_toltaylor(rhs(%),2));
+@c ===end===
+@example maxima
+@group
+(%i1) vals:[
+    R_1=100*(1+.01*tol[1]),
+    R_2=200*(1+.01*tol[2])
+(%o1) [R_1 = 100 (0.01 tol  + 1), R_2 = 200 (0.01 tol  + 1)]
+                          1                          2
+@end group
+@group
+(%i2) ];
+                                    R_1
+                                 ---------
+                                 R_2 + R_1
+(%o2)                  I_Out = %e
+@end group
+@group
+(%i3) ic:I_Out=exp(R_1/(R_1+R_2));
+                            100 (0.01 tol  + 1)
+                                         1
+                 -----------------------------------------
+                 200 (0.01 tol  + 1) + 100 (0.01 tol  + 1)
+                              2                     1
+(%o3)  I_Out = %e
+@end group
+@group
+(%i4) subst(vals,ic);
+(%o4) wc_toltaylor(expt(2.718281828459045, 
+                            100 (0.01 tol  + 1)
+                                         1
+                 -----------------------------------------), 2.0)
+                 200 (0.01 tol  + 1) + 100 (0.01 tol  + 1)
+                              2                     1
+@end group
+(%i5) float(wc_toltaylor(rhs(%),2));
+@end example
+@end deffn
+
 @anchor{wc_montecarlo}
 @deffn {Function} wc_montecarlo (@var{expression}, @var{num})
 
@@ -405,6 +463,7 @@ Example:
 @end example
 @end deffn
 
+
 @anchor{wc_mintypmax}
 @deffn {Function} wc_mintypmax (@var{expr}, [@var{n}])
 
-----------------------------------------------------------------------
Summary of changes:
 doc/info/wrstcse.texi | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: peterpall <pet...@us...> - 2025-09-11 06:51:21
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  9ab39fcc3b33194ee7e818e65877337cd8c4a9f4 (commit)
      from  1d2475070c8162d444ebba633bcf90db07023a70 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9ab39fcc3b33194ee7e818e65877337cd8c4a9f4
Author: Gunter Königsmann <gu...@pe...>
Date:   Thu Sep 11 08:51:01 2025 +0200
    wrstcse: Added a new command that creates taylor series of tolerance dependencies
    
    Sometimes in engineering the trick is to simplify stuff by linearizing it.
diff --git a/share/contrib/wrstcse.mac b/share/contrib/wrstcse.mac
index dc79cc930..b95edae5c 100644
--- a/share/contrib/wrstcse.mac
+++ b/share/contrib/wrstcse.mac
@@ -366,6 +366,53 @@ wc_ewc_simplify(x):=block(
     return(x)
 );
 
+/* Sometimes the secret of engineering is simplifying something, for example by
+approximating it by a taylor series. This is what this function does do */
+wc_toltaylor(x,[maxorder]):=block(
+    [
+        /* The derivate of x to the tol[n] we currently look at */
+        wc_diffofwctol,
+        /* wc_diffofwctol for the current tol being 0 */
+        wc_diffofwctollimit,
+        retval:wc_typicalvalues(x)
+    ],
+    /* Determine the order of the taylor series we want to generate */
+    if maxorder = [] then maxorder:[1],
+    if length(maxorder) > 1 then error("wc_toltaylor: more than 2 arguments!"),
+    maxorder:maxorder[1],
+    if not numberp(maxorder) then error("wc_toltaylor: The 2nd argument must be a number!"),
+    if maxorder<0 then error("wc_toltaylor: The 2nd argument must not be negative!"),
+
+    /* Perform the taylor series for all tolerances */
+    for wc_tol in %wc_tols(x) do
+        for wc_difforder:1 thru maxorder do
+        (
+            /* Let's see if we can get the derivate we need the naive way */
+            wc_diffofwctol:%wc_typicalvalues(diff(x,wc_tol,wc_difforder),wc_tol),
+            wc_diffofwctollimit:limit(wc_diffofwctol,wc_tol,0),
+
+            /* If the derivate is 'ind we have two derivates at tol[n]=0 */
+            if wc_diffofwctollimit='ind then block([wc_poslimit,wc_neglimit],
+               /* We have two derivates. As we are performing a worst case
+                  calculation we make a worst-case assumption and use the bigger
+                  one ignoring its sign */
+               wc_poslimit:limit(wc_diffofwctol,wc_tol,0,'plus),
+               wc_neglimit:limit(wc_diffofwctol,wc_tol,0,'minus),
+               wc_diffofwctollimit:max(abs(wc_poslimit),abs(wc_neglimit)),
+               /* If we can determine which of the limits is bigger we can
+                  do without the abs() */
+               if abs(wc_poslimit) > abs(wc_neglimit) then
+                  wc_diffofwctollimit:wc_poslimit,
+               if abs(wc_poslimit) < abs(wc_neglimit) then
+                  wc_diffofwctollimit:wc_neglimit
+           ),
+           /* Add the taylor term we just learned about to the result */
+           retval:retval+wc_tol^wc_difforder/wc_difforder*wc_typicalvalues(wc_diffofwctollimit)
+        ),
+   return(retval)
+);
+
+
 wc_sensitivities(expr):=block([tols:[],wc_tol,wc_typ:wc_typicalvalues(expr),wc_result:[]],
     /* Compile a list of tol[n] */
     for i in listofvars(expr) do
-----------------------------------------------------------------------
Summary of changes:
 share/contrib/wrstcse.mac | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-10 14:58:06
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, bug-4607-cf-issues has been updated
       via  e93381d18333625d565408939cf54a709973166b (commit)
      from  066bd4ad705cf0cd2557d9149bbbfc292f3330d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e93381d18333625d565408939cf54a709973166b
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 10 07:55:11 2025 -0700
    Add some tests for cf
    
    These were taken from the mailing list.  These previously produced
    errors, but Michel mentioned that these are now fixed and I can
    confirm that they are.
diff --git a/tests/rtest10.mac b/tests/rtest10.mac
index c0822aec1..6acd000ab 100644
--- a/tests/rtest10.mac
+++ b/tests/rtest10.mac
@@ -83,6 +83,13 @@ cflength:3;
 cf(sqrt(8));
 [2, 1, 4, 1, 4, 1, 4]$
 
+/* Bug 4607 */
+cf(1/sqrt(2));
+[0, 1, 2, 2, 2];
+
+cf([1,3]*[1,3]);
+[1, 1, 3, 2];
+
 (reset (ratepsilon), 0);
 0;
 
-----------------------------------------------------------------------
Summary of changes:
 tests/rtest10.mac | 7 +++++++
 1 file changed, 7 insertions(+)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-09 15:17:10
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, bug-4607-cf-issues has been created
        at  066bd4ad705cf0cd2557d9149bbbfc292f3330d8 (commit)
- Log -----------------------------------------------------------------
commit 066bd4ad705cf0cd2557d9149bbbfc292f3330d8
Author: Raymond Toy <toy...@gm...>
Date:   Tue Sep 9 08:14:50 2025 -0700
    Fix #4607:  CF issues
    
    This fixes the issues raised in bug #4607.  This is the solution
    provided by Michel Talon on the mailing list Sep 8, 2025.  I applied
    it unchanged.
diff --git a/src/combin.lisp b/src/combin.lisp
index f2b46865c..b70b66ccd 100644
--- a/src/combin.lisp
+++ b/src/combin.lisp
@@ -833,7 +833,7 @@
 	  ((floatp a)
 	   (let ((a (maxima-rationalize a)))
 	     (cons '(mlist cf) (ratcf (car a) (cdr a)))))
-	  (($bfloatp a)
+	  ((and (eq (caar a) 'bigfloat) ($bfloatp a))
 	   (let (($bftorat t))
 	     (setq a (bigfloat2rat a))
 	     (cons '(mlist cf) (ratcf (car a) (cdr a)))))
@@ -844,16 +844,23 @@
 	  ((eq (caar a) 'mlist)
 	   (cfratsimp a))
 	  ;;the following doesn't work for non standard form
-	  ;;		(cfplus a '((mlist) 0)))
-	  ((and (mtimesp a) (cddr a) (null (cdddr a))
+	  ;;		(cfplus a '((mlist) 0)))  ??? seems to work
+	  ((and (eq (caar a) 'mtimes) (mtimesp a) (cddr a) (null (cdddr a))
 		(fixnump (cadr a))
 		(mexptp (caddr a))
 		(fixnump (cadr (caddr a)))
 		(alike1 (caddr (caddr a)) '((rat) 1 2)))
 	   (cfsqrt (cfeval (* (expt (cadr a) 2) (cadr (caddr a))))))
+	  ;; case when a continuous fraction is raised to an integer power
+	  ;; example ((MEXPT . #1=(SIMP)) ((MLIST . #1#) 1 3) 2)
+	  ((and (eq (caar a) 'mexpt) (integerp (caddr a)) (> (caddr a) 0))
+	   (cfexpt (cadr a) (caddr a)))	  
 	  ((eq (caar a) 'mexpt)
 	   (cond ((alike1 (caddr a) '((rat) 1 2))
-		  (cfsqrt (cfeval (cadr a))))
+		  (cfsqrt (cfeval (cadr a)))) ; square root of an integer
+		 ((alike1 (caddr a) '((rat) -1 2))
+		  (cfquot 1 (cfsqrt (cfeval (cadr a))))) ; inverse square root 
+		 ;;case when an integer is raised to some half integer power
 		 ((integerp (m* 2 (caddr a))) ; a^(n/2) was sqrt(a^n)
                   (cfsqrt (cfeval (cfexpt (cadr a) (m* 2 (caddr a))))))
 		 ((integerp (cadr a)) (cfnroot a)) ; <=== new case x
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-08 18:52:13
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-highlightjs-dark-mode has been created
        at  5d25a7ff85f81f4a4014341aa8bd2cc006eff666 (commit)
- Log -----------------------------------------------------------------
commit 5d25a7ff85f81f4a4014341aa8bd2cc006eff666
Author: Raymond Toy <toy...@gm...>
Date:   Mon Sep 8 11:49:06 2025 -0700
    Allow highlightjs to use github-dark when in dark mode.
    
    For dark mode with highlightjs, we use github-dark (since we're using
    github for light mode).
    
    This is done by adding a new link tag to
    HIGHLIGHT1 in configure.ac to specify github-dark when dark mode is
    preferred.  We also update the existing link to github to specify
    light mode for this.
    
    This doesn't look very good in dark mode, though because the default
    example background is a dark gray.
    
    But this is a step in supporting dark mode when using highlightjs for
    the examples.
diff --git a/configure.ac b/configure.ac
index 7cb032981..34ce9a55c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -745,7 +745,7 @@ if test x"${enable_build_docs}" = xtrue ; then
            TEXI_EXTRA_TAIL=')'
         fi
         if test x${syntax_highlighting} = xhighlightjs; then
-	   HIGHLIGHT1='<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/github.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/languages/maxima.min.js"> </script>
+	   HIGHLIGHT1='<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/github.min.css" media="(prefers-color-scheme: light)"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/github-dark.min.css" media="(prefers-color-scheme: dark")>  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/languages/maxima.min.js"> </script>
 '
 	   HIGHLIGHT2="<script> hljs.configure({languages: [['Maxima']], cssSelector: ${HLJS_CSS_SELECTOR}}); hljs.highlightAll(); </script>
 "
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-07 14:44:51
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  1d2475070c8162d444ebba633bcf90db07023a70 (commit)
       via  e80b340145db2c0bc66579c385b42e705a106afe (commit)
       via  428d4eb325e23eb4f70e974e2af19fd07214cdf1 (commit)
       via  13f0dd47c1be13020c7c4145b5158b37481810ae (commit)
       via  a432b864aaf9d7f60af4be10ae67235b739e88b1 (commit)
       via  75f7ba5205921ccf11d6dce83148934b69f8b4e3 (commit)
      from  4f1f500052144c095d6fe059f71af157bdd31d85 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
 doc/info/trigtools.texi.m4 | 1422 ++++++++++++++++++++++++++++++--------------
 1 file changed, 974 insertions(+), 448 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-05 14:58:10
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-trigtools-update-examples has been updated
       via  1d2475070c8162d444ebba633bcf90db07023a70 (commit)
       via  e80b340145db2c0bc66579c385b42e705a106afe (commit)
      from  428d4eb325e23eb4f70e974e2af19fd07214cdf1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1d2475070c8162d444ebba633bcf90db07023a70
Author: Raymond Toy <toy...@gm...>
Date:   Fri Sep 5 07:57:41 2025 -0700
    Fix typo in example
    
    We were loading trigtools twice in one example.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index 46021b7d2..036afea6e 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -1103,7 +1103,6 @@ Examples:
 @item Values of trigonometric functions
 @c ===beg===
 @c load("trigtools")$
-@c load(trigtools)$
 @c trigvalue(sin(%pi/10));
 @c trigvalue(cos(%pi/10));
 @c trigvalue(tan(%pi/10));
commit e80b340145db2c0bc66579c385b42e705a106afe
Author: Raymond Toy <toy...@gm...>
Date:   Fri Sep 5 07:55:53 2025 -0700
    Add more comment blocks for examples and regenerate them
    
    We missed a few.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index cc1c061ed..46021b7d2 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -126,43 +126,80 @@ Examples:
 
 Example. Solve trigonometric equation
 
-@example
+@c ===beg===
+@c eq:3*sin(x)+4*cos(x)=2;
+@c plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@c ===end===
+@example maxima
 @group
-(%i10) eq:3*sin(x)+4*cos(x)=2;
-(%o10)                      3 sin(x) + 4 cos(x) = 2
+(%i1) eq:3*sin(x)+4*cos(x)=2;
+(%o1)                3 sin(x) + 4 cos(x) = 2
 @end group
-
-(%i11) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@group
+(%i2) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+(%o2)                         false
+@end group
+@end example
 
 @center @image{figures/trigtools-1,5in,,plot1}
 
-(%i12) eq1:c2sin(lhs(eq))=2;
-                                           4
-(%o35)                      5 sin(x + atan(-)) = 2
-                                           3
-(%i13) solvetrigwarn:false$
-(%i14) solve(eq1)[1]$ x1:rhs(%);
-                                    2         4
-(%o15)                         asin(-) - atan(-)
-                                    5         3
-(%i16) float(%), numer;
-(%o39)                       - 0.5157783719341241
-(%i17) eq2:c2cos(lhs(eq))=2;
-                                           3
-(%o17)                      5 cos(x - atan(-)) = 2
-(%i18) solve(eq2,x)[1]$ x2:rhs(%);
-                                    3         2
-(%o19)                         atan(-) + acos(-)
-                                    4         5
-(%i20) float(%), numer;
-(%o20)                         1.802780589520693
-
-(%i21) sol:[x1,x2];
-                          2         4        3         2
-(%o44)              [asin(-) - atan(-), atan(-) + acos(-)]
-                          5         3        4         5
+@c ===beg===
+@c load("trigtools")$
+@c eq:3*sin(x)+4*cos(x)=2$
+@c eq1:c2sin(lhs(eq))=2;
+@c solvetrigwarn:false$
+@c solve(eq1)[1]$ x1:rhs(%);
+@c float(%), numer;
+@c eq2:c2cos(lhs(eq))=2;
+@c solve(eq2,x)[1]$ x2:rhs(%);
+@c float(%), numer;
+@c sol:[x1,x2];
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:3*sin(x)+4*cos(x)=2$
+@group
+(%i3) eq1:c2sin(lhs(eq))=2;
+                                    4
+(%o3)                5 sin(x + atan(-)) = 2
+                                    3
+@end group
+(%i4) solvetrigwarn:false$
+@group
+(%i5) solve(eq1)[1]$ x1:rhs(%);
+                             2         4
+(%o6)                   asin(-) - atan(-)
+                             5         3
+@end group
+@group
+(%i7) float(%), numer;
+(%o7)                 - 0.5157783719341241
+@end group
+@group
+(%i8) eq2:c2cos(lhs(eq))=2;
+                                    3
+(%o8)                5 cos(x - atan(-)) = 2
+                                    4
+@end group
+@group
+(%i9) solve(eq2,x)[1]$ x2:rhs(%);
+                             3         2
+(%o10)                  atan(-) + acos(-)
+                             4         5
+@end group
+@group
+(%i11) float(%), numer;
+(%o11)                  1.802780589520693
+@end group
+@group
+(%i12) sol:[x1,x2];
+                   2         4        3         2
+(%o12)       [asin(-) - atan(-), atan(-) + acos(-)]
+                   5         3        4         5
+@end group
 @end example
 
+
 Answ.: 
 m4_mathcomma(<<<x = x_1 + 2\pi k>>>,<<<x = x1 + 2*%pi*k>>>)
 m4_mathcomma(<<<x_1 = \sin^{-1}{2\over 5} - \tan^{-1}{4\over
@@ -245,13 +282,26 @@ Examples:
 @end example
 
 @item @w{ }
-@example
-(%i9) sin(a+b*%i);
-(%o9)                           sin(%i b + a)
-(%i10) trigexpand(%);
-(%o10)                %i cos(a) sinh(b) + sin(a) cosh(b)
-(%i11) c2trig(%);
-(%o11)                           sin(%i b + a)
+@c ===beg===
+@c load("trigtools")$
+@c sin(a+b*%i);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) sin(a+b*%i);
+(%o2)                     sin(%i b + a)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3)          %i cos(a) sinh(b) + sin(a) cosh(b)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4)                     sin(%i b + a)
+@end group
 @end example
 
 @item @w{ }
@@ -415,16 +465,22 @@ Examples:
 @end example
 
 @item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(x)+cos(y));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
 @group
-(%i4) trigfactor(sin(x)+cos(y));
-                           y   x   %pi      y   x   %pi
-(%o4)                2 cos(- - - + ---) cos(- + - - ---)
-                           2   2    4       2   2    4
+(%i2) trigfactor(sin(x)+cos(y));
+                     y   x   %pi      y   x   %pi
+(%o2)          2 cos(- - - + ---) cos(- + - - ---)
+                     2   2    4       2   2    4
 @end group
 @group
-(%i5) trigrat(%);
-(%o5)                          cos(y) + sin(x)
+(%i3) trigrat(%);
+(%o3)                    cos(y) + sin(x)
 @end group
 @end example
 
@@ -492,11 +548,21 @@ Examples:
 @end example
 
 @item @w{ }
-@example
-(%i12) sin(alpha)-sin(beta)=trigfactor(sin(alpha)-sin(beta));
-                                        beta   alpha      beta   alpha
-(%o12) sin(alpha) - sin(beta) = - 2 sin(---- - -----) cos(---- + -----)
-                                         2       2         2       2
+@c ===beg===
+@c load("trigtools")$
+@c sin(alpha)-sin(beta)=trigfactor(sin(alpha)-sin(beta));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) sin(alpha)-sin(beta)=trigfactor(sin(alpha)-sin(beta));
+                                       beta   alpha
+(%o2) sin(alpha) - sin(beta) = - 2 sin(---- - -----)
+                                        2       2
+                                                    beta   alpha
+                                                cos(---- + -----)
+                                                     2       2
+@end group
 @end example
 
 @item @w{ }
-----------------------------------------------------------------------
Summary of changes:
 doc/info/trigtools.texi.m4 | 165 +++++++++++++++++++++++++++++++--------------
 1 file changed, 115 insertions(+), 50 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-05 02:23:40
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-trigtools-update-examples has been updated
       via  428d4eb325e23eb4f70e974e2af19fd07214cdf1 (commit)
       via  13f0dd47c1be13020c7c4145b5158b37481810ae (commit)
      from  a432b864aaf9d7f60af4be10ae67235b739e88b1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 428d4eb325e23eb4f70e974e2af19fd07214cdf1
Author: Raymond Toy <toy...@gm...>
Date:   Thu Sep 4 19:23:03 2025 -0700
    Add more comment blocks for examples and regenerate them
    
    This is the last set.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index 0cc54718f..cc1c061ed 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -1035,171 +1035,237 @@ in radicals.
 Examples:
 @enumerate
 @item Values of trigonometric functions
-@example
-(%i1) load(trigtools)$
+@c ===beg===
+@c load("trigtools")$
+@c load(trigtools)$
+@c trigvalue(sin(%pi/10));
+@c trigvalue(cos(%pi/10));
+@c trigvalue(tan(%pi/10));
+@c float(%), numer;
+@c float(tan(%pi/10)), numer;
+@c trigvalue(cot(%pi/10));
+@c float(%), numer;
+@c float(cot(%pi/10)), numer;
+@c trigvalue(sin(%pi/32));
+@c trigvalue(cos(%pi/32));
+@c trigvalue(cos(%pi/256));
+@c trigvalue(cos(%pi/60));
+@c trigvalue(sin(%pi/60));
+@c trigvalue(sin(%pi/18));
+@c trigvalue(sin(%pi/20));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) load(trigtools)$
 @group
-(%i2) trigvalue(sin(%pi/10));
-                                  sqrt(5) - 1
-(%o2)                             -----------
-                                       4
+(%i3) trigvalue(sin(%pi/10));
+                           sqrt(5) - 1
+(%o3)                      -----------
+                                4
+@end group
+@group
+(%i4) trigvalue(cos(%pi/10));
+                        sqrt(sqrt(5) + 5)
+(%o4)                   -----------------
+                               3/2
+                              2
+@end group
+@group
+(%i5) trigvalue(tan(%pi/10));
+                       sqrt(5 - 2 sqrt(5))
+(%o5)                  -------------------
+                             sqrt(5)
+@end group
+@group
+(%i6) float(%), numer;
+(%o6)                  0.3249196962329063
+@end group
+@group
+(%i7) float(tan(%pi/10)), numer;
+(%o7)                  0.3249196962329063
+@end group
+@group
+(%i8) trigvalue(cot(%pi/10));
+(%o8)                  sqrt(2 sqrt(5) + 5)
+@end group
+@group
+(%i9) float(%), numer;
+(%o9)                  3.0776835371752536
 @end group
 @group
-(%i3) trigvalue(cos(%pi/10));
-                               sqrt(sqrt(5) + 5)
-(%o3)                          -----------------
-                                      3/2
-                                     2
-@end group
-@group
-(%i4) trigvalue(tan(%pi/10));
-                              sqrt(5 - 2 sqrt(5))
-(%o4)                         -------------------
-                                    sqrt(5)
-@end group
-(%i5) float(%), numer;
-(%o5)                         0.3249196962329063
-(%i6) float(tan(%pi/10)), numer;
-(%o6)                         0.3249196962329063
-(%i7) trigvalue(cot(%pi/10));
-(%o7)                         sqrt(2 sqrt(5) + 5)
-(%i8) float(%), numer;
-(%o8)                          3.077683537175254
-(%i9) float(cot(%pi/10)), numer;
-(%o9)                          3.077683537175254
-(%i10) trigvalue(sin(%pi/32));
-                     sqrt(2 - sqrt(sqrt(sqrt(2) + 2) + 2))
-(%o10)               -------------------------------------
-                                       2
-(%i11) trigvalue(cos(%pi/32));
-                     sqrt(sqrt(sqrt(sqrt(2) + 2) + 2) + 2)
-(%o11)               -------------------------------------
-                                       2
-(%i12) trigvalue(cos(%pi/256));
-       sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(2) + 2) + 2) + 2) + 2) + 2) + 2)
-(%o12) -------------------------------------------------------------------
-                                        2
-(%i13) trigvalue(cos(%pi/60));
-        sqrt(sqrt(sqrt(2) sqrt(3) sqrt(sqrt(5) + 5) + sqrt(5) + 7) + 4)
-(%o13)  ---------------------------------------------------------------
-                                      3/2
-                                     2
-@group
-(%i14) trigvalue(sin(%pi/60));
-        sqrt(4 - sqrt(sqrt(2) sqrt(3) sqrt(sqrt(5) + 5) + sqrt(5) + 7))
-(%o14)  ---------------------------------------------------------------
-                                      3/2
-                                     2
-@end group
-@group
-(%i15) trigvalue(sin(%pi/18));
-                                       %pi
-(%o15)                             sin(---)
-                                       18
-@end group
-@group
-(%i16) trigvalue(sin(%pi/20));
-                      sqrt(4 - sqrt(2) sqrt(sqrt(5) + 5))
-(%o16)                -----------------------------------
-                                      3/2
-                                     2
+(%i10) float(cot(%pi/10)), numer;
+(%o10)                  3.077683537175254
+@end group
+@group
+(%i11) trigvalue(sin(%pi/32));
+              sqrt(2 - sqrt(sqrt(sqrt(2) + 2) + 2))
+(%o11)        -------------------------------------
+                                2
+@end group
+@group
+(%i12) trigvalue(cos(%pi/32));
+              sqrt(sqrt(sqrt(sqrt(2) + 2) + 2) + 2)
+(%o12)        -------------------------------------
+                                2
+@end group
+@group
+(%i13) trigvalue(cos(%pi/256));
+(%o13) sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(sqrt(2) + 2) + 2) + 2) + 2)
+                                                      + 2) + 2)/2
+@end group
+@group
+(%i14) trigvalue(cos(%pi/60));
+(%o14) 
+  sqrt(sqrt(sqrt(2) sqrt(3) sqrt(sqrt(5) + 5) + sqrt(5) + 7) + 4)
+  ---------------------------------------------------------------
+                                3/2
+                               2
+@end group
+@group
+(%i15) trigvalue(sin(%pi/60));
+(%o15) 
+  sqrt(4 - sqrt(sqrt(2) sqrt(3) sqrt(sqrt(5) + 5) + sqrt(5) + 7))
+  ---------------------------------------------------------------
+                                3/2
+                               2
+@end group
+@group
+(%i16) trigvalue(sin(%pi/18));
+                                %pi
+(%o16)                      sin(---)
+                                18
+@end group
+@group
+(%i17) trigvalue(sin(%pi/20));
+               sqrt(4 - sqrt(2) sqrt(sqrt(5) + 5))
+(%o17)         -----------------------------------
+                               3/2
+                              2
 @end group
 @end example
 
 @item ode example
-@example
-(%i17) load(odes)$
-@group
-(%i18) eq:'diff(y,x,5)+2*y=0;
-                                  5
-                                 d y
-(%o18)                           --- + 2 y = 0
-                                   5
-                                 dx
-@end group
-(%i19) odeL(eq,y,x);
-@group
-                   1/5     4 %pi
-                - 2    cos(-----) x
-                             5           1/5     4 %pi
-(%o19) y = C5 %e                    sin(2    sin(-----) x)
-                                                   5
-           1/5     4 %pi
-        - 2    cos(-----) x
-                     5           1/5     4 %pi
- + C4 %e                    cos(2    sin(-----) x)
+@c ===beg===
+@c load("trigtools")$
+@c load(odes)$
+@c eq:'diff(y,x,5)+2*y=0;
+@c odeL(eq,y,x);
+@c sol:trigeval(%);
+@c subst(sol,eq)$
+@c ev(%, nouns)$
+@c radcan(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) load(odes)$
+@group
+(%i3) eq:'diff(y,x,5)+2*y=0;
+                           5
+                          d y
+(%o3)                     --- + 2 y = 0
+                            5
+                          dx
+@end group
+@group
+(%i4) odeL(eq,y,x);
+               1/5     4 %pi
+            - 2    cos(-----) x
+                         5              1/5     4 %pi
+(%o4) y = %e                    C5 sin(2    sin(-----) x)
+                                                  5
+        1/5     4 %pi
+     - 2    cos(-----) x
+                  5              1/5     4 %pi
+ + %e                    C4 cos(2    sin(-----) x)
                                            5
-           1/5     2 %pi
-        - 2    cos(-----) x
-                     5           1/5     2 %pi
- + C3 %e                    sin(2    sin(-----) x)
+        1/5     2 %pi
+     - 2    cos(-----) x
+                  5              1/5     2 %pi
+ + %e                    C3 sin(2    sin(-----) x)
                                            5
-           1/5     2 %pi
-        - 2    cos(-----) x                                  1/5
-                     5           1/5     2 %pi            - 2    x
- + C2 %e                    cos(2    sin(-----) x) + C1 %e
+        1/5     2 %pi
+     - 2    cos(-----) x
+                  5              1/5     2 %pi
+ + %e                    C2 cos(2    sin(-----) x)
                                            5
-@end group
-@group
-(%i20) sol:trigeval(%);
-                  (sqrt(5) - 1) x
-                - ---------------
-                        9/5
-                       2              sqrt(sqrt(5) + 5) x
-(%o20) y = C3 %e                  sin(-------------------)
-                                             13/10
-                                            2
-          (sqrt(5) - 1) x
-        - ---------------
-                9/5
-               2              sqrt(sqrt(5) + 5) x
- + C2 %e                  cos(-------------------)
+        1/5
+     - 2    x
+ + %e         C1
+@end group
+@group
+(%i5) sol:trigeval(%);
+              (sqrt(5) - 1) x
+            - ---------------
+                    9/5
+                   2                 sqrt(sqrt(5) + 5) x
+(%o5) y = %e                  C3 sin(-------------------)
+                                            13/10
+                                           2
+       (sqrt(5) - 1) x
+     - ---------------
+             9/5
+            2                 sqrt(sqrt(5) + 5) x
+ + %e                  C2 cos(-------------------)
                                      13/10
                                     2
-        (sqrt(5) + 1) x
-        ---------------
-              9/5
-             2              sqrt(5 - sqrt(5)) x
- + C5 %e                sin(-------------------)
+     (sqrt(5) + 1) x
+     ---------------
+           9/5
+          2                 sqrt(5 - sqrt(5)) x
+ + %e                C5 sin(-------------------)
                                    13/10
                                   2
-        (sqrt(5) + 1) x
-        ---------------
-              9/5                                          1/5
-             2              sqrt(5 - sqrt(5)) x         - 2    x
- + C4 %e                cos(-------------------) + C1 %e
+     (sqrt(5) + 1) x
+     ---------------
+           9/5                                          1/5
+          2                 sqrt(5 - sqrt(5)) x      - 2    x
+ + %e                C4 cos(-------------------) + %e         C1
                                    13/10
                                   2
 @end group
-(%i21) subst(sol,eq)$
-(%i22) ev(%, nouns)$
-(%i23) radcan(%);
-(%o23)                               0 = 0
+(%i6) subst(sol,eq)$
+(%i7) ev(%, nouns)$
+@group
+(%i8) radcan(%);
+(%o8)                         0 = 0
+@end group
 @end example
 
 @item n-th root of complex number
 
 Example. Find the 4-th roots of %i
-@example
-(%i24) solve(x^4=%i,x);
-                 1/8                1/8             1/8              1/8
-(%o24) [x = (- 1)    %i, x = - (- 1)   , x = - (- 1)    %i, x = (- 1)   ]
-@group
-(%i25) rectform(%);
-                   %pi        %pi                 %pi         %pi
-(%o25) [x = %i cos(---) - sin(---), x = (- %i sin(---)) - cos(---), 
-                    8          8                   8           8
-                                %pi           %pi              %pi        %pi
-                        x = sin(---) - %i cos(---), x = %i sin(---) + cos(---)]
-                                 8             8                8          8
-@end group
-@group
-(%i26) trigeval(%);
-            sqrt(sqrt(2) + 2) %i   sqrt(2 - sqrt(2))
-(%o26) [x = -------------------- - -----------------, 
-                     2                     2
-       sqrt(2 - sqrt(2)) %i    sqrt(sqrt(2) + 2)
-x = (- --------------------) - -----------------, 
-                2                      2
+@c ===beg===
+@c load("trigtools")$
+@c solve(x^4=%i,x);
+@c rectform(%);
+@c trigeval(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) solve(x^4=%i,x);
+                1/8                1/8             1/8
+(%o2) [x = (- 1)    %i, x = - (- 1)   , x = - (- 1)    %i, 
+                                                             1/8
+                                                    x = (- 1)   ]
+@end group
+@group
+(%i3) rectform(%);
+                  %pi        %pi                %pi        %pi
+(%o3) [x = %i cos(---) - sin(---), x = - %i sin(---) - cos(---), 
+                   8          8                  8          8
+                  %pi           %pi              %pi        %pi
+          x = sin(---) - %i cos(---), x = %i sin(---) + cos(---)]
+                   8             8                8          8
+@end group
+@group
+(%i4) trigeval(%);
+           sqrt(sqrt(2) + 2) %i   sqrt(2 - sqrt(2))
+(%o4) [x = -------------------- - -----------------, 
+                    2                     2
+      sqrt(2 - sqrt(2)) %i   sqrt(sqrt(2) + 2)
+x = - -------------------- - -----------------, 
+               2                     2
     sqrt(2 - sqrt(2))   sqrt(sqrt(2) + 2) %i
 x = ----------------- - --------------------, 
             2                    2
@@ -1228,45 +1294,78 @@ m4_mathdot(<<<|r| < {\pi\over 2}>>>, <<<abs(r)<%pi/2>>>)
 
 
 Examples:
-@example
-(%i1) load(trigtools)$
-@end example
 
 @enumerate
 @item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c atan_contract(atan(x)+atan(y));
+@c assume(abs(atan(x)+atan(y))<%pi/2)$
+@c atan(x)+atan(y)=atan_contract(atan(x)+atan(y));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
 (%i2) atan_contract(atan(x)+atan(y));
-(%o2)                          atan(y) + atan(x)
+(%o2)                   atan(y) + atan(x)
+@end group
 (%i3) assume(abs(atan(x)+atan(y))<%pi/2)$
+@group
 (%i4) atan(x)+atan(y)=atan_contract(atan(x)+atan(y));
-                                                 y + x
-(%o4)                  atan(y) + atan(x) = atan(-------)
-                                                1 - x y
+                                          y + x
+(%o4)           atan(y) + atan(x) = atan(-------)
+                                         1 - x y
+@end group
 @end example
 
 @item @w{ }
-@example
-(%i5) atan(1/3)+atan(1/5)+atan(1/7)+atan(1/8)$ %=atan_contract(%);
-                       1         1         1         1    %pi
-(%o6)             atan(-) + atan(-) + atan(-) + atan(-) = ---
-                       3         5         7         8     4
+@c ===beg===
+@c load("trigtools")$
+@c atan(1/3)+atan(1/5)+atan(1/7)+atan(1/8)$ %=atan_contract(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) atan(1/3)+atan(1/5)+atan(1/7)+atan(1/8)$ %=atan_contract(%);
+                1         1         1         1    %pi
+(%o3)      atan(-) + atan(-) + atan(-) + atan(-) = ---
+                3         5         7         8     4
+@end group
 @end example
 
 @item Machin's formulae
-@example
-(%i7) 4*atan(1/5)-atan(1/239)=atan_contract(4*atan(1/5)-atan(1/239));
-                                 1          1     %pi
-(%o7)                     4 atan(-) - atan(---) = ---
-                                 5         239     4
+@c ===beg===
+@c load("trigtools")$
+@c 4*atan(1/5)-atan(1/239)=atan_contract(4*atan(1/5)-atan(1/239));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) 4*atan(1/5)-atan(1/239)=atan_contract(4*atan(1/5)-atan(1/239));
+                          1          1     %pi
+(%o2)              4 atan(-) - atan(---) = ---
+                          5         239     4
+@end group
 @end example
 
 @item see @url{https://en.wikipedia.org/wiki/Machin-like_formula}
-@example
-(%i8) 12*atan(1/49)+32*atan(1/57)-5*atan(1/239)+12*atan(1/110443)$
-%=atan_contract(%);
-                1             1             1               1       %pi
-(%o9)   12 atan(--) + 32 atan(--) - 5 atan(---) + 12 atan(------) = ---
-                49            57           239            110443     4
+@c ===beg===
+@c load("trigtools")$
+@c 12*atan(1/49)+32*atan(1/57)-5*atan(1/239)+12*atan(1/110443)$
+@c %=atan_contract(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) 12*atan(1/49)+32*atan(1/57)-5*atan(1/239)+12*atan(1/110443)$
+@group
+(%i3) %=atan_contract(%);
+              1             1             1
+(%o3) 12 atan(--) + 32 atan(--) - 5 atan(---)
+              49            57           239
+                                                      1       %pi
+                                          + 12 atan(------) = ---
+                                                    110443     4
+@end group
 @end example
 @end enumerate
 
commit 13f0dd47c1be13020c7c4145b5158b37481810ae
Author: Raymond Toy <toy...@gm...>
Date:   Thu Sep 4 19:12:28 2025 -0700
    Add more comment blocks for examples and regenerate them
    
    There are still many left to do.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index 11ab4969e..0cc54718f 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -796,57 +796,108 @@ m4_mathcomma(<<<x = a + 2\pi k>>>, <<<x = a+2*%pi*k>>>)
 where @math{a} any from @math{S}, @math{k} any integer.
 
 @item @w{ }
-@example
-(%i19) eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0;
-(%o19)               8 cos(x) cos(4 x) cos(5 x) - 1 = 0
-
-(%i20) trigrat(%);
-(%o20)          2 cos(10 x) + 2 cos(8 x) + 2 cos(2 x) + 1 = 0
+@c ===beg===
+@c load("trigtools")$
+@c eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0;
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0;
+(%o2)          8 cos(x) cos(4 x) cos(5 x) - 1 = 0
+@end group
+@group
+(%i3) trigrat(%);
+(%o3)     2 cos(10 x) + 2 cos(8 x) + 2 cos(2 x) + 1 = 0
+@end group
 @end example
 
 Left side is periodic with period 
 m4_mathdot(<<<T=\pi>>>, <<<T=%pi>>>)
 
 We have 10 solutions from [0, pi].
-@example
-(%i21) plot2d([lhs(eq),rhs(eq)],[x,0,%pi]);
+@c ===beg===
+@c load("trigtools")$
+@c eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
+@c plot2d([lhs(eq),rhs(eq)],[x,0,%pi]);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
+@group
+(%i3) plot2d([lhs(eq),rhs(eq)],[x,0,%pi]);
+(%o3)                         false
+@end group
+@end example
 
 @center @image{figures/trigtools-6,5in,,plot6}
 
-(%i22) x4:find_root(eq, x, 1.3, 1.32);
-(%o22)                        1.308996938995747
-(%i23) x5:find_root(eq, x, 1.32, 1.35);
-(%o23)                        1.346396851538483
-(%i24) plot2d([lhs(eq),0], [x,1.3,1.35], [gnuplot_preamble, "set grid;"]);
+@c ===beg===
+@c load("trigtools")$
+@c eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
+@c x4:find_root(eq, x, 1.3, 1.32);
+@c x5:find_root(eq, x, 1.32, 1.35);
+@c plot2d([lhs(eq),0], [x,1.3,1.35], [gnuplot_preamble, "set grid;"]);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
+@group
+(%i3) x4:find_root(eq, x, 1.3, 1.32);
+(%o3)                  1.3089969389957472
+@end group
+@group
+(%i4) x5:find_root(eq, x, 1.32, 1.35);
+(%o4)                  1.3463968515384828
+@end group
+@group
+(%i5) plot2d([lhs(eq),0], [x,1.3,1.35], [gnuplot_preamble, "set grid;"]);
+(%o5)                         false
+@end group
+@end example
 
 @center @image{figures/trigtools-7,5in,,plot7}
 
-@end example
-
 Equation we multiply by 
 m4_mathpunc(:, <<<2\sin x\cos 2x>>>, <<<2*sin(x)*cos(2*x)>>>)
 
 
-@example
-(%i25) eq*2*sin(x)*cos(2*x);
-(%o25)     2 sin(x) cos(2 x) (8 cos(x) cos(4 x) cos(5 x) - 1) = 0
-(%i26) eq1:trigreduce(%),expand;
-(%o26)                     sin(13 x) + sin(x) = 0
+@c ===beg===
+@c load("trigtools")$
+@c eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
+@c eq*2*sin(x)*cos(2*x);
+@c eq1:trigreduce(%),expand;
+@c trigfactor(lhs(eq1))=0;
+@c S1:trigsolve(cos(6*x),0,%pi);
+@c S2:trigsolve(sin(7*x),0,%pi);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:8*cos(x)*cos(4*x)*cos(5*x)-1=0$
 @group
-(%i27) trigfactor(lhs(eq1))=0;
-(%o27)                     2 cos(6 x) sin(7 x) = 0
+(%i3) eq*2*sin(x)*cos(2*x);
+(%o3) 2 sin(x) cos(2 x) (8 cos(x) cos(4 x) cos(5 x) - 1) = 0
 @end group
 @group
-(%i28) S1:trigsolve(cos(6*x),0,%pi);
-                    %pi  %pi  5 %pi  7 %pi  3 %pi  11 %pi
-(%o28)             @{---, ---, -----, -----, -----, ------@}
-                    12    4    12     12      4      12
+(%i4) eq1:trigreduce(%),expand;
+(%o4)                sin(13 x) + sin(x) = 0
 @end group
 @group
-(%i29) S2:trigsolve(sin(7*x),0,%pi);
-                     %pi  2 %pi  3 %pi  4 %pi  5 %pi  6 %pi
-(%o29)           @{0, ---, -----, -----, -----, -----, -----@}
-                      7     7      7      7      7      7
+(%i5) trigfactor(lhs(eq1))=0;
+(%o5)                2 cos(6 x) sin(7 x) = 0
+@end group
+@group
+(%i6) S1:trigsolve(cos(6*x),0,%pi);
+              %pi  %pi  5 %pi  7 %pi  3 %pi  11 %pi
+(%o6)        @{---, ---, -----, -----, -----, ------@}
+              12    4    12     12      4      12
+@end group
+@group
+(%i7) S2:trigsolve(sin(7*x),0,%pi);
+               %pi  2 %pi  3 %pi  4 %pi  5 %pi  6 %pi
+(%o7)      @{0, ---, -----, -----, -----, -----, -----@}
+                7     7      7      7      7      7
 @end group
 @end example
 
@@ -855,37 +906,78 @@ m4_math(<<<\sin x = 0>>>, <<<sin(x)=0>>>)
 and
 m4_mathdot(<<<\cos 2x = 0>>>, <<<cos(2*x) = 0>>>)
 
-@example
-(%i30) S3:trigsolve(sin(x),0,%pi);
-(%o30)                               @{0@}
-(%i31) S4:trigsolve(cos(2*x),0,%pi);
-                                 %pi  3 %pi
-(%o31)                          @{---, -----@}
-                                  4     4
+@c ===beg===
+@c load("trigtools")$
+@c S1:trigsolve(cos(6*x),0,%pi)$
+@c S2:trigsolve(sin(7*x),0,%pi)$
+@c S3:trigsolve(sin(x),0,%pi);
+@c S4:trigsolve(cos(2*x),0,%pi);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) S1:trigsolve(cos(6*x),0,%pi)$
+(%i3) S2:trigsolve(sin(7*x),0,%pi)$
+@group
+(%i4) S3:trigsolve(sin(x),0,%pi);
+(%o4)                          @{0@}
+@end group
+@group
+(%i5) S4:trigsolve(cos(2*x),0,%pi);
+                           %pi  3 %pi
+(%o5)                     @{---, -----@}
+                            4     4
+@end group
 @end example
 
 We find 10 solutions from 
 m4_mathpunc(:,<<<[0, \pi]>>>,<<<[0, %pi]>>>)
 
-@example
+@c ===beg===
+@c load("trigtools")$
+@c S1:trigsolve(cos(6*x),0,%pi)$
+@c S2:trigsolve(sin(7*x),0,%pi)$
+@c S3:trigsolve(sin(x),0,%pi)$
+@c S4:trigsolve(cos(2*x),0,%pi)$
+@c union(S1,S2)$ setdifference(%,S3)$ setdifference(%,S4);
+@c S:listify(%);
+@c length(S);
+@c float(S), numer;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) S1:trigsolve(cos(6*x),0,%pi)$
+(%i3) S2:trigsolve(sin(7*x),0,%pi)$
+(%i4) S3:trigsolve(sin(x),0,%pi)$
+(%i5) S4:trigsolve(cos(2*x),0,%pi)$
+@group
+(%i6) union(S1,S2)$ setdifference(%,S3)$ setdifference(%,S4);
+       %pi  %pi  2 %pi  5 %pi  3 %pi  4 %pi  7 %pi  5 %pi
+(%o8) @{---, ---, -----, -----, -----, -----, -----, -----, 
+       12    7     7     12      7      7     12      7
+                                                   6 %pi  11 %pi
+                                                   -----, ------@}
+                                                     7      12
+@end group
+@group
+(%i9) S:listify(%);
+       %pi  %pi  2 %pi  5 %pi  3 %pi  4 %pi  7 %pi  5 %pi
+(%o9) [---, ---, -----, -----, -----, -----, -----, -----, 
+       12    7     7     12      7      7     12      7
+                                                   6 %pi  11 %pi
+                                                   -----, ------]
+                                                     7      12
+@end group
 @group
-(%i32) union(S1,S2)$ setdifference(%,S3)$ setdifference(%,S4);
-         %pi  %pi  2 %pi  5 %pi  3 %pi  4 %pi  7 %pi  5 %pi  6 %pi  11 %pi
-(%o34) @{---, ---, -----, -----, -----, -----, -----, -----, -----, ------@}
-         12    7     7     12      7      7     12      7      7      12
+(%i10) length(S);
+(%o10)                         10
 @end group
 @group
-(%i35) S:listify(%);
-        %pi  %pi  2 %pi  5 %pi  3 %pi  4 %pi  7 %pi  5 %pi  6 %pi  11 %pi
-(%o35) [---, ---, -----, -----, -----, -----, -----, -----, -----, ------]
-        12    7     7     12      7      7     12      7      7      12
+(%i11) float(S), numer;
+(%o11) [0.2617993877991494, 0.4487989505128276, 
+0.8975979010256552, 1.3089969389957472, 1.3463968515384828, 
+1.7951958020513104, 1.8325957145940461, 2.243994752564138, 
+2.6927937030769655, 2.8797932657906435]
 @end group
-(%i36) length(S);
-(%o36)                               10
-(%i37) float(S), numer;
-(%o37) [0.2617993877991494, 0.4487989505128276, 0.8975979010256552, 
-1.308996938995747, 1.346396851538483, 1.79519580205131, 1.832595714594046, 
-2.243994752564138, 2.692793703076966, 2.879793265790644]
 @end example
 Answer: 
 m4_mathcomma(<<<x = a + 2\pi k>>>, <<<x = a+2*%pi*k>>>)
-----------------------------------------------------------------------
Summary of changes:
 doc/info/trigtools.texi.m4 | 629 +++++++++++++++++++++++++++++----------------
 1 file changed, 410 insertions(+), 219 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-04 22:53:32
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-trigtools-update-examples has been created
        at  a432b864aaf9d7f60af4be10ae67235b739e88b1 (commit)
- Log -----------------------------------------------------------------
commit a432b864aaf9d7f60af4be10ae67235b739e88b1
Author: Raymond Toy <toy...@gm...>
Date:   Thu Sep 4 15:52:08 2025 -0700
    Add more comment blocks for examples and regenerate them
    
    There are still many left to do.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index cb46c63d4..11ab4969e 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -600,21 +600,42 @@ m4_mathdot(<<<[a,b)>>>, <<<[a, b)>>>)
 Examples:
 @enumerate
 @item @w{ }
-@example
-(%i38) eq:eq:3*sin(x)+4*cos(x)=2;
-(%o38)                      3 sin(x) + 4 cos(x) = 2
-
-(%i39) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@c ===beg===
+@c eq:eq:3*sin(x)+4*cos(x)=2;
+@c plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+@c ===end===
+@example maxima
+@group
+(%i1) eq:eq:3*sin(x)+4*cos(x)=2;
+(%o1)                3 sin(x) + 4 cos(x) = 2
+@end group
+@group
+(%i2) plot2d([3*sin(x)+4*cos(x),2],[x,-%pi,%pi]);
+(%o2)                         false
+@end group
+@end example
 
 @center @image{figures/trigtools-2,5in,,plot2}
 
-(%o39)
-(%i40) sol:trigsolve(eq,-%pi,%pi);
-                  2 sqrt(21)   12              2 sqrt(21)   12
-(%o40)      @{atan(---------- - --), %pi - atan(---------- + --)@}
-                      5        5                   5        5
-(%i41) float(%), numer;
-(%o41)            @{- 0.5157783719341241, 1.802780589520693@}
+@c ===beg===
+@c load("trigtools")$
+@c eq:eq:3*sin(x)+4*cos(x)=2$
+@c sol:trigsolve(eq,-%pi,%pi);
+@c float(%), numer;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:eq:3*sin(x)+4*cos(x)=2$
+@group
+(%i3) sol:trigsolve(eq,-%pi,%pi);
+            2 sqrt(21)   12              2 sqrt(21)   12
+(%o3) @{atan(---------- - --), %pi - atan(---------- + --)@}
+                5        5                   5        5
+@end group
+@group
+(%i4) float(%), numer;
+(%o4)      @{- 0.5157783719341241, 1.8027805895206928@}
+@end group
 @end example
 
 Answ. : 
@@ -627,70 +648,147 @@ m4_mathcomma(<<<x = \pi - \tan^{-1}\left({2\sqrt{21}\over 5} +
 @math{k} -- any integer.
 
 @item @w{ }
-@example
-(%i6) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
-(%o6)         cos(3 x) - sin(x) = sqrt(3) (cos(x) - sin(3 x))
-(%i7) plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
+@c plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x));
+(%o2)    cos(3 x) - sin(x) = sqrt(3) (cos(x) - sin(3 x))
+@end group
+(%i3) plot2d([lhs(eq)-rhs(eq)], [x,0,2*%pi])$
+@end example
 
 @center @image{figures/trigtools-3,5in,,plot3}
 
-@end example
-
 We have 6 solutions from [0, 2*pi].
-@example
-(%i8) plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5]);
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+(%i3) plot2d([lhs(eq)-rhs(eq)], [x,0.2,0.5])$
+@end example
 
 @center @image{figures/trigtools-4,5in,,plot4}
 
-(%i9) plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6]);
+@c ===beg===
+@c load("trigtools")$
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6])$
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) load("trigtools")$
+(%i3) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+(%i4) plot2d([lhs(eq)-rhs(eq)], [x,3.3,3.6])$
+@end example
 
 @center @image{figures/trigtools-5,5in,,plot4}
 
-(%i10) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
-                   %pi            %pi                      %pi            %pi
-(%o15) - 2 sin(x + ---) sin(2 x - ---) = 2 sqrt(3) sin(x - ---) sin(2 x - ---)
-                    4              4                        4              4
-(%i11) factor(lhs(%)-rhs(%));
-                 4 x + %pi                4 x - %pi       8 x - %pi
-(%o11)  - 2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
-                     4                        4               4
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+@c factor(lhs(%)-rhs(%));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@group
+(%i3) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+                  %pi            %pi
+(%o3) - 2 sin(x + ---) sin(2 x - ---) = 
+                   4              4
+                                              %pi            %pi
+                            2 sqrt(3) sin(x - ---) sin(2 x - ---)
+                                               4              4
+@end group
+@group
+(%i4) factor(lhs(%)-rhs(%));
+               4 x + %pi                4 x - %pi
+(%o4) - 2 (sin(---------) + sqrt(3) sin(---------))
+                   4                        4
+                                                       8 x - %pi
+                                                   sin(---------)
+                                                           4
+@end group
 @end example
 
 Equation is equivalent to
-@example
+@c ===beg===
+@c load("trigtools")$
+@c eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@c trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+@c L:factor(rhs(%)-lhs(%));
+@c eq1:part(L,2)=0;
+@c eq2:part(L,3)=0;
+@c S1:trigsolve(eq1,0,2*%pi);
+@c S2:trigsolve(eq2,0,2*%pi);
+@c S:listify(union(S1,S2));
+@c float(%), numer;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+(%i2) eq:cos(3*x)-sin(x)=sqrt(3)*(cos(x)-sin(3*x))$
+@group
+(%i3) trigfactor(lhs(eq))=map(trigfactor,rhs(eq));
+                  %pi            %pi
+(%o3) - 2 sin(x + ---) sin(2 x - ---) = 
+                   4              4
+                                              %pi            %pi
+                            2 sqrt(3) sin(x - ---) sin(2 x - ---)
+                                               4              4
+@end group
+@group
+(%i4) L:factor(rhs(%)-lhs(%));
+             4 x + %pi                4 x - %pi       8 x - %pi
+(%o4) 2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
+                 4                        4               4
+@end group
+@group
+(%i5) eq1:part(L,2)=0;
+               4 x + %pi                4 x - %pi
+(%o5)      sin(---------) + sqrt(3) sin(---------) = 0
+                   4                        4
+@end group
 @group
-(%i12) L:factor(rhs(%)-lhs(%));
-                4 x + %pi                4 x - %pi       8 x - %pi
-(%o12)   2 (sin(---------) + sqrt(3) sin(---------)) sin(---------)
-                    4                        4               4
-@end group
-@group
-(%i13) eq1:part(L,2)=0;
-                     4 x + %pi                4 x - %pi
-(%o13)           sin(---------) + sqrt(3) sin(---------) = 0
-                         4                        4
-@end group
-@group
-(%i14) eq2:part(L,3)=0;
-                                 8 x - %pi
-(%o14)                       sin(---------) = 0
-                                     4
-@end group
-(%i15) S1:trigsolve(eq1,0,2*%pi);
-                                 %pi  13 %pi
-(%o15)                         @{---, ------@}
-                                 12     12
-(%i16) S2:trigsolve(eq2,0,2*%pi);
-                           %pi  5 %pi  9 %pi  13 %pi
-(%o16)                   @{---, -----, -----, ------@}
-                            8     8      8      8
-(%i17) S:listify(union(S1,S2));
-                   %pi  %pi  5 %pi  13 %pi  9 %pi  13 %pi
-(%o17)            [---, ---, -----, ------, -----, ------]
-                   12    8     8      12      8      8
-(%i18) float(%), numer;
-(%o18) [0.2617993877991494, 0.3926990816987241, 1.963495408493621, 
-                      3.403392041388942, 3.534291735288517, 5.105088062083414]
+(%i6) eq2:part(L,3)=0;
+                           8 x - %pi
+(%o6)                  sin(---------) = 0
+                               4
+@end group
+@group
+(%i7) S1:trigsolve(eq1,0,2*%pi);
+                           %pi  13 %pi
+(%o7)                     @{---, ------@}
+                           12     12
+@end group
+@group
+(%i8) S2:trigsolve(eq2,0,2*%pi);
+                    %pi  5 %pi  9 %pi  13 %pi
+(%o8)              @{---, -----, -----, ------@}
+                     8     8      8      8
+@end group
+@group
+(%i9) S:listify(union(S1,S2));
+             %pi  %pi  5 %pi  13 %pi  9 %pi  13 %pi
+(%o9)       [---, ---, -----, ------, -----, ------]
+             12    8     8      12      8      8
+@end group
+@group
+(%i10) float(%), numer;
+(%o10) [0.2617993877991494, 0.39269908169872414, 
+1.9634954084936207, 3.4033920413889422, 3.5342917352885173, 
+5.105088062083414]
+@end group
 @end example
 
 Answer: 
commit 75f7ba5205921ccf11d6dce83148934b69f8b4e3
Author: Raymond Toy <toy...@gm...>
Date:   Thu Sep 4 15:29:42 2025 -0700
    Add new comment blocks for examples and regenerate them
    
    There are still many left to do.
diff --git a/doc/info/trigtools.texi.m4 b/doc/info/trigtools.texi.m4
index 949e818a0..cb46c63d4 100644
--- a/doc/info/trigtools.texi.m4
+++ b/doc/info/trigtools.texi.m4
@@ -69,40 +69,58 @@ m4_mathdot(<<<r\cos(x-\phi)>>>, <<<@math{r*cos(x-phi)}>>>)
 @code{load("trigtools")} loads these functions.
 
 Examples:
-@example
+@c ===beg===
+@c load("trigtools")$
+@c c2sin(3*sin(x)+4*cos(x));
+@c trigexpand(%),expand;
+@c c2cos(3*sin(x)-4*cos(x));
+@c trigexpand(%),expand;
+@c c2sin(sin(x)+cos(x));
+@c trigexpand(%),expand;
+@c c2cos(sin(x)+cos(x));
+@c trigexpand(%),expand;
+@c ===end===
+@example maxima
 (%i1) load("trigtools")$
+@group
 (%i2) c2sin(3*sin(x)+4*cos(x));
-                                            4
-(%o2)                        5 sin(x + atan(-))
-                                            3
+                                      4
+(%o2)                  5 sin(x + atan(-))
+                                      3
+@end group
+@group
 (%i3) trigexpand(%),expand;
-(%o3)                        3 sin(x) + 4 cos(x)
-
+(%o3)                  3 sin(x) + 4 cos(x)
+@end group
 @group
 (%i4) c2cos(3*sin(x)-4*cos(x));
-                                             3
-(%o4)                       - 5 cos(x + atan(-))
-                                             4
+                                       3
+(%o4)                 - 5 cos(x + atan(-))
+                                       4
 @end group
 @group
 (%i5) trigexpand(%),expand;
-(%o5)                        3 sin(x) - 4 cos(x)
+(%o5)                  3 sin(x) - 4 cos(x)
 @end group
 @group
 (%i6) c2sin(sin(x)+cos(x));
-                                            %pi
-(%o6)                       sqrt(2) sin(x + ---)
-                                             4
+                                      %pi
+(%o6)                 sqrt(2) sin(x + ---)
+                                       4
 @end group
+@group
 (%i7) trigexpand(%),expand;
-(%o7)                          sin(x) + cos(x)
+(%o7)                    sin(x) + cos(x)
+@end group
+@group
 (%i8) c2cos(sin(x)+cos(x));
-                                            %pi
-(%o8)                       sqrt(2) cos(x - ---)
-                                             4
+                                      %pi
+(%o8)                 sqrt(2) cos(x - ---)
+                                       4
+@end group
 @group
 (%i9) trigexpand(%),expand;
-(%o9)                          sin(x) + cos(x)
+(%o9)                    sin(x) + cos(x)
 @end group
 @end example
 
@@ -176,26 +194,54 @@ Examples:
 @enumerate
 
 @item @w{ }
-@example
+@c ===beg===
+@c load(trigtools)$
+@c sinh(x)=c2trig(sinh(x));
+@c cosh(x)=c2trig(cosh(x));
+@c tanh(x)=c2trig(tanh(x));
+@c coth(x)=c2trig(coth(x));
+@c ===end===
+@example maxima
 (%i1) load(trigtools)$
+@group
 (%i2) sinh(x)=c2trig(sinh(x));
-cosh(x)=c2trig(cosh(x));
-tanh(x)=c2trig(tanh(x));
-coth(x)=c2trig(coth(x));
-(%o2)                     sinh(x) = - %i sin(%i x)
-(%o3)                        cosh(x) = cos(%i x)
-(%o4)                     tanh(x) = - %i tan(%i x)
-(%o5)                      coth(x) = %i cot(%i x)
+(%o2)               sinh(x) = - %i sin(%i x)
+@end group
+@group
+(%i3) cosh(x)=c2trig(cosh(x));
+(%o3)                  cosh(x) = cos(%i x)
+@end group
+@group
+(%i4) tanh(x)=c2trig(tanh(x));
+(%o4)               tanh(x) = - %i tan(%i x)
+@end group
+@group
+(%i5) coth(x)=c2trig(coth(x));
+(%o5)                coth(x) = %i cot(%i x)
+@end group
 @end example
 
 @item see @url{https://maxima.sourceforge.io/ext/list_archives/2013/msg03230.html}
-@example
-(%i6) cos(p+q*%i);
-(%o6)                           cos(%i q + p)
-(%i7) trigexpand(%);
-(%o7)                cos(p) cosh(q) - %i sin(p) sinh(q)
-(%i8) c2trig(%);
-(%o8)                           cos(%i q + p)
+@c ===beg===
+@c load("trigtools")$
+@c cos(p+q*%i);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(p+q*%i);
+(%o2)                     cos(%i q + p)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3)          cos(p) cosh(q) - %i sin(p) sinh(q)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4)                     cos(%i q + p)
+@end group
 @end example
 
 @item @w{ }
@@ -209,42 +255,77 @@ coth(x)=c2trig(coth(x));
 @end example
 
 @item @w{ }
-@example
-(%i12) cos(a*%i+b*%i);
-(%o12)                         cos(%i b + %i a)
-(%i13) trigexpand(%);
-(%o13)                 sinh(a) sinh(b) + cosh(a) cosh(b)
-(%i14) c2trig(%);
-(%o14)                         cos(%i b + %i a)
+@c ===beg===
+@c load("trigtools")$
+@c cos(a*%i+b*%i);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(a*%i+b*%i);
+(%o2)                   cos(%i b + %i a)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3)           sinh(a) sinh(b) + cosh(a) cosh(b)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4)                   cos(%i b + %i a)
+@end group
 @end example
 
 @item @w{ }
-@example
-(%i15) tan(a+%i*b);
-(%o15)                           tan(%i b + a)
+@c ===beg===
+@c load("trigtools")$
+@c tan(a+%i*b);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) tan(a+%i*b);
+(%o2)                     tan(%i b + a)
+@end group
 @group
-(%i16) trigexpand(%);
-                              %i tanh(b) + tan(a)
-(%o16)                       ---------------------
-                             1 - %i tan(a) tanh(b)
+(%i3) trigexpand(%);
+                       %i tanh(b) + tan(a)
+(%o3)                 ---------------------
+                      1 - %i tan(a) tanh(b)
 @end group
 @group
-(%i17) c2trig(%);
-(%o217)                           tan(%i b + a)
+(%i4) c2trig(%);
+(%o4)                     tan(%i b + a)
 @end group
 @end example
 
 @item @w{ }
 
-@example
-(%i18) cot(x+%i*y);
-(%o18)                           cot(%i y + x)
-(%i19) trigexpand(%);
-                           (- %i cot(x) coth(y)) - 1
-(%o19)                     -------------------------
-                              cot(x) - %i coth(y)
-(%i20) c2trig(%);
-(%o20)                           cot(%i y + x)
+@c ===beg===
+@c load("trigtools")$
+@c cot(x+%i*y);
+@c trigexpand(%);
+@c c2trig(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cot(x+%i*y);
+(%o2)                     cot(%i y + x)
+@end group
+@group
+(%i3) trigexpand(%);
+                     - %i cot(x) coth(y) - 1
+(%o3)                -----------------------
+                       cot(x) - %i coth(y)
+@end group
+@group
+(%i4) c2trig(%);
+(%o4)                     cot(%i y + x)
+@end group
 @end example
 @end enumerate
 
@@ -267,16 +348,29 @@ to expression with hyperbolic functions sinh, cosh.
 
 Examples:
 
-@example
-(%i6) c2hyp(exp(x));
-(%o6)                         sinh(x) + cosh(x)
-(%i7) c2hyp(exp(x)+exp(x^2)+1);
-                       2          2
-(%o7)            sinh(x ) + cosh(x ) + sinh(x) + cosh(x) + 1
-(%i8) c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
-                              sinh(x) + cosh(x)
-(%o8)           ---------------------------------------------
-                2 (sinh(y) + cosh(y)) - 3 (sinh(z) + cosh(z))
+@c ===beg===
+@c load("trigtools")$
+@c c2hyp(exp(x));
+@c c2hyp(exp(x)+exp(x^2)+1);
+@c c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) c2hyp(exp(x));
+(%o2)                   sinh(x) + cosh(x)
+@end group
+@group
+(%i3) c2hyp(exp(x)+exp(x^2)+1);
+                 2          2
+(%o3)      sinh(x ) + cosh(x ) + sinh(x) + cosh(x) + 1
+@end group
+@group
+(%i4) c2hyp(exp(x)/(2*exp(y)-3*exp(z)));
+                        sinh(x) + cosh(x)
+(%o4)     ---------------------------------------------
+          2 (sinh(y) + cosh(y)) - 3 (sinh(z) + cosh(z))
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -301,13 +395,23 @@ Examples:
 
 @enumerate
 @item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(x)+cos(x));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
 (%i2) trigfactor(sin(x)+cos(x));
-                                            %pi
-(%o2)                       sqrt(2) cos(x - ---)
-                                             4
+                                      %pi
+(%o2)                 sqrt(2) cos(x - ---)
+                                       4
+@end group
+@group
 (%i3) trigrat(%);
-(%o3)                          sin(x) + cos(x)
+(%o3)                    sin(x) + cos(x)
+@end group
 @end example
 
 @item @w{ }
@@ -325,35 +429,66 @@ Examples:
 @end example
 
 @item @w{ }
-@example
-(%i6) trigfactor(sin(x)-cos(3*y));
-                         3 y   x   %pi      3 y   x   %pi
-(%o6)              2 sin(--- - - + ---) sin(--- + - - ---)
-                          2    2    4        2    2    4
-(%i7) trigrat(%);
-(%o7)                         sin(x) - cos(3 y)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(x)-cos(3*y));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(sin(x)-cos(3*y));
+                   3 y   x   %pi      3 y   x   %pi
+(%o2)        2 sin(--- - - + ---) sin(--- + - - ---)
+                    2    2    4        2    2    4
+@end group
+@group
+(%i3) trigrat(%);
+(%o3)                   sin(x) - cos(3 y)
+@end group
 @end example
 
 @item @w{ }
-@example
-(%i8) trigfactor(-sin(5*x)-cos(3*y));
-                        3 y   5 x   %pi      3 y   5 x   %pi
-(%o8)           - 2 cos(--- - --- + ---) cos(--- + --- - ---)
-                         2     2     4        2     2     4
-(%i9) trigrat(%);
-(%o9)                      (- cos(3 y)) - sin(5 x)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(-sin(5*x)-cos(3*y));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(-sin(5*x)-cos(3*y));
+                  3 y   5 x   %pi      3 y   5 x   %pi
+(%o2)     - 2 cos(--- - --- + ---) cos(--- + --- - ---)
+                   2     2     4        2     2     4
+@end group
+@group
+(%i3) trigrat(%);
+(%o3)                 - cos(3 y) - sin(5 x)
+@end group
 @end example
 
 @item @w{ }
-@example 
+@c ===beg===
+@c load("trigtools")$
+@c sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
+@c trigrat(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
 @group
-(%i10) sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
-                                       beta   alpha      beta   alpha
-(%o10)  sin(beta) + sin(alpha) = 2 cos(---- - -----) sin(---- + -----)
-                                        2       2         2       2
+(%i2) sin(alpha)+sin(beta)=trigfactor(sin(alpha)+sin(beta));
+                                     beta   alpha
+(%o2) sin(beta) + sin(alpha) = 2 cos(---- - -----)
+                                      2       2
+                                                    beta   alpha
+                                                sin(---- + -----)
+                                                     2       2
+@end group
+@group
+(%i3) trigrat(%);
+(%o3)    sin(beta) + sin(alpha) = sin(beta) + sin(alpha)
 @end group
-(%i11) trigrat(%);
-(%o78)          sin(beta) + sin(alpha) = sin(beta) + sin(alpha)
 @end example
 
 @item @w{ }
@@ -365,45 +500,82 @@ Examples:
 @end example
 
 @item @w{ }
-@example
-(%i13) cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
-                                       beta   alpha      beta   alpha
-(%o80)  cos(beta) + cos(alpha) = 2 cos(---- - -----) cos(---- + -----)
-                                        2       2         2       2
+@c ===beg===
+@c load("trigtools")$
+@c cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) cos(alpha)+cos(beta)=trigfactor(cos(alpha)+cos(beta));
+                                     beta   alpha
+(%o2) cos(beta) + cos(alpha) = 2 cos(---- - -----)
+                                      2       2
+                                                    beta   alpha
+                                                cos(---- + -----)
+                                                     2       2
+@end group
 @end example
 
 @item @w{ }
-@example
+@c ===beg===
+@c load("trigtools")$
+@c cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
 @group
-(%i14) cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
-                                       beta   alpha      beta   alpha
-(%o14)  cos(alpha) - cos(beta) = 2 sin(---- - -----) sin(---- + -----)
-                                        2       2         2       2
+(%i2) cos(alpha)-cos(beta)=trigfactor(cos(alpha)-cos(beta));
+                                     beta   alpha
+(%o2) cos(alpha) - cos(beta) = 2 sin(---- - -----)
+                                      2       2
+                                                    beta   alpha
+                                                sin(---- + -----)
+                                                     2       2
 @end group
 @end example
 
 @item @w{ }
-@example
-(%i15) trigfactor(3*sin(x)+7*cos(x));
-(%o15)                        3 sin(x) + 7 cos(x)
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(3*sin(x)+7*cos(x));
+@c c2sin(%);
+@c trigexpand(%),expand;
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
 @group
-(%i16) c2sin(%);
-                                                 7
-(%o16)                     sqrt(58) sin(x + atan(-))
-                                                 3
+(%i2) trigfactor(3*sin(x)+7*cos(x));
+(%o2)                  3 sin(x) + 7 cos(x)
 @end group
 @group
-(%i17) trigexpand(%),expand;
-(%o17)                        3 sin(x) + 7 cos(x)
+(%i3) c2sin(%);
+                                          7
+(%o3)               sqrt(58) sin(x + atan(-))
+                                          3
+@end group
+@group
+(%i4) trigexpand(%),expand;
+(%o4)                  3 sin(x) + 7 cos(x)
 @end group
 @end example
 
-10.
-@example
-(%i18) trigfactor(sin(2*x));
-(%o18)                             sin(2 x)
-(%i19) trigexpand(%);
-(%o19)                          2 cos(x) sin(x)
+@item @w{ }
+@c ===beg===
+@c load("trigtools")$
+@c trigfactor(sin(2*x));
+@c trigexpand(%);
+@c ===end===
+@example maxima
+(%i1) load("trigtools")$
+@group
+(%i2) trigfactor(sin(2*x));
+(%o2)                       sin(2 x)
+@end group
+@group
+(%i3) trigexpand(%);
+(%o3)                    2 cos(x) sin(x)
+@end group
 @end example
 @end enumerate
 
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-04 22:01:16
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  4f1f500052144c095d6fe059f71af157bdd31d85 (commit)
       via  7b335132eb275361f2613e28a19c9dc11f2e1bb1 (commit)
       via  25ecbac0d49fa658dbbdb1f84dc8f440f92a1155 (commit)
       via  f053771ccddf36028086b97bdb8cf7bc51135c39 (commit)
       via  8a86e987d94ae36964c6a53b8c0ba0c325a9a3df (commit)
      from  bd0858ca56a4e673b71810895d5e47e947d973a8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
 doc/info/.gitignore                        |   1 +
 doc/info/{odepack.texi => odepack.texi.m4} | 195 +++++++++++++++++++++++------
 2 files changed, 159 insertions(+), 37 deletions(-)
 rename doc/info/{odepack.texi => odepack.texi.m4} (66%)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-04 13:46:12
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-odepack-m4math-update-examples has been updated
       via  4f1f500052144c095d6fe059f71af157bdd31d85 (commit)
      from  7b335132eb275361f2613e28a19c9dc11f2e1bb1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4f1f500052144c095d6fe059f71af157bdd31d85
Author: Raymond Toy <toy...@gm...>
Date:   Thu Sep 4 06:33:12 2025 -0700
    Editorial changes to make things a bit easier to read
    
    Indent the description of the parameters and return results to make it
    easier to see.
    
    Also add one last item to the example to print out the (final)
    value that dlsode_step returns.
diff --git a/doc/info/odepack.texi.m4 b/doc/info/odepack.texi.m4
index 2ba57f79e..e9135b0c4 100644
--- a/doc/info/odepack.texi.m4
+++ b/doc/info/odepack.texi.m4
@@ -168,6 +168,7 @@ Then, putting everything together
 @c     printf(true, "At t = ~12,4,2e   y = ~{~14,6,2e~}~%", result[1], result[2]),
 @c     istate : result[3],
 @c     tout : tout * 10);
+@c result;
 @c ===end===
 @example maxima
 (%i1) load("dlsode")$
@@ -212,6 +213,13 @@ At t =   4.0000e+09   y =   5.129458e-07  2.051784e-12  9.999995e-01
 At t =   4.0000e+10   y =  -7.170563e-08 -2.868225e-13  1.000000e+00
 (%o14)                        done
 @end group
+@group
+(%i15) result;
+(%o15) [4.0e10, [- 7.170562924983933e-8, 
+- 2.868224674710487e-13, 1.000000071705913], 2, 
+[[n_steps, 330], [n_f_eval, 405], [n_j_eval, 69], 
+[method_order, 1], [len_rwork, 58], [len_iwork, 23]]]
+@end group
 @end example
 
 @node Functions and Variables for odepack, , Getting Started with ODEPACK, Package odepack
@@ -230,6 +238,7 @@ dependent variables.  The list of dependent variables must be in the
 same order as the equations if @var{fex}.  Finally, @var{method}
 indicates the method to be used by the solver:
 
+@quotation
 @table @code
 @item 10
 Nonstiff (Adams) method, no Jacobian used.
@@ -238,9 +247,12 @@ Stiff (BDF) method, user-supplied full Jacobian.
 @item 22
 Stiff method, internally generated full Jacobian.
 @end table
+@end quotation
+
 
 The returned state object is a list of lists.  The sublist is a list
 of two elements:
+@quotation
 @table @code
 @item f
 The compiled function for the ODE.
@@ -261,6 +273,8 @@ Lisp array holding the integer-valued work vector.
 @item fjac
 Compiled analytical Jacobian of the equations
 @end table
+@end quotation
+
 
 See also @mrefdot{dlsode_step}  @xref{Getting Started with ODEPACK} for
 an example of usage.
@@ -277,6 +291,9 @@ an example of usage.
 Performs one step of the solver, returning the values of the
 independent and dependent variables, a success or error code.
 
+The parameters for @code{dlsode_step} are:
+@c quotation block to indent this a bit more
+@quotation
 @table @code
 @item inity
 For the first call (when istate = 1), the initial values
@@ -300,8 +317,11 @@ for pure relative error.
 @item state
 state returned by dlsode_init.
 @end table
+@end quotation
+
 
 The output is a list of the following items:
+@quotation
 @table @code
 @item t
 independent variable value
@@ -309,6 +329,7 @@ independent variable value
 list of values of the dependent variables at time t.
 @item istate
 Integration status:
+@quotation
 @table @code
 @item 1 
 no work because tout = tt
@@ -321,7 +342,7 @@ Excess accuracy requested
 @item -3
 Illegal input detected
 @item -4
- Repeated error test failures
+Repeated error test failures
 @item -5
 Repeated convergence failures (perhaps bad Jacobian or wrong choice of
 mf or tolerances)
@@ -329,8 +350,10 @@ mf or tolerances)
 Error weight because zero during problem (solution component is
 vanished and atol(i) = 0.
 @end table
+@end quotation
 @item info
 association list of various bits of information:
+@quotation
 @table @code
 @item n_steps
 total steps taken thus far
@@ -345,7 +368,11 @@ Actual length used for real work array
 @item len_iwork
 Actual length used for integer work array
 @end table
+@end quotation
+
 @end table
+@end quotation
+
 
 See also @mrefdot{dlsode_init}  @xref{Getting Started with ODEPACK} for
 an example of usage.
-----------------------------------------------------------------------
Summary of changes:
 doc/info/odepack.texi.m4 | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 22:16:59
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-odepack-m4math-update-examples has been updated
       via  7b335132eb275361f2613e28a19c9dc11f2e1bb1 (commit)
      from  25ecbac0d49fa658dbbdb1f84dc8f440f92a1155 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7b335132eb275361f2613e28a19c9dc11f2e1bb1
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 15:15:35 2025 -0700
    Clarify that the result of dlsode_init should not be modified
    
    The user must not modify the result of dlsode_init at all.  It is
    passed to dlsode_step to provide the necessary information produced by
    dlsode_init.
diff --git a/doc/info/odepack.texi.m4 b/doc/info/odepack.texi.m4
index 1c6ccda34..2ba57f79e 100644
--- a/doc/info/odepack.texi.m4
+++ b/doc/info/odepack.texi.m4
@@ -125,7 +125,8 @@ Initialize the solver, where we have selected method 21:
 @end example
 The arrays rwork and iwork carry state between calls to
 @mref{dlsode_step}, so they should not be modified by the user.  In
-fact, this state should not be modified by the user at all.
+fact, this @var{state} returned from @code{dlsode_init} should not be
+modified by the user at all.
 
 Now that the algorithm has been initialized we can compute solutions
 to the differential equation, using the @var{state} returned above.
-----------------------------------------------------------------------
Summary of changes:
 doc/info/odepack.texi.m4 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 22:13:59
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-odepack-m4math-update-examples has been created
        at  25ecbac0d49fa658dbbdb1f84dc8f440f92a1155 (commit)
- Log -----------------------------------------------------------------
commit 25ecbac0d49fa658dbbdb1f84dc8f440f92a1155
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 15:13:35 2025 -0700
    Ignore odepack.texi
    
    It's generated from odepack.texi.m4 now.
diff --git a/doc/info/.gitignore b/doc/info/.gitignore
index f5260f67d..e3a99709a 100644
--- a/doc/info/.gitignore
+++ b/doc/info/.gitignore
@@ -25,6 +25,7 @@ MathFunctions.texi
 Numerical.texi
 Special.texi
 distrib.texi
+odepack.texi
 orthopoly.texi
 zeilberger.texi
 trigtools.texi
commit f053771ccddf36028086b97bdb8cf7bc51135c39
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 15:11:21 2025 -0700
    Add TeX formulas and code blocks to generate the examples
    
    There's a bit of duplication in the examples because each code block
    is independent of the others, so we need to copy some initialization
    code into each block.  This also means some of the text had to be
    rephrased a bit.
diff --git a/doc/info/odepack.texi.m4 b/doc/info/odepack.texi.m4
index 051b6a442..1c6ccda34 100644
--- a/doc/info/odepack.texi.m4
+++ b/doc/info/odepack.texi.m4
@@ -41,6 +41,16 @@ Of the eight variants of the solver, Maxima currently only has an
 interface to @code{dlsode}.
 
 Let's say we have this system of equations to solve:
+m4_displaymath(
+<<<
+\eqalign{
+f_1 &= -0.04 y_1 + 10^4 y_2 y_3 \cr
+f_3 &= 3\times 10^7 y_2^2 \cr
+{dy_1 \over dt} &= f_1 \cr
+{dy_2 \over dt} &= -f_1 - f_3 \cr
+{dy_3 \over dt} &= f_3 \cr
+}>>>,
+<<<
 @example
   f1 = -.04d0*y1 + 1d4*y2*y3
   f3 = 3d7*y2*y2
@@ -48,29 +58,70 @@ Let's say we have this system of equations to solve:
   dy2/dt = -f1 - f3
   dy3/dt = f3
 @end example
-The independent variable is @math{t}; the  dependent variables are @math{y1}, @math{y2},
-and @math{y3}, 
+>>>)
+
+The independent variable is @math{t}; the  dependent variables are
+m4_mathcomma(y_1)
+m4_mathcomma(y_2)
+and
+m4_mathdot(y_3)
 
 To start the solution, set up the differential equations to solved:
-@example
-load("dlsode");
-f1: -.04d0*y1 + 1d4*y2*y3$
-f3: 3d7*y2*y2$
-f2: -f1 - f3$
-fex: [f1, f2, f3];
+@c ===beg===
+@c load("dlsode")$
+@c f1: -.04d0*y1 + 1d4*y2*y3$
+@c f3: 3d7*y2*y2$
+@c f2: -f1 - f3$
+@c fex: [f1, f2, f3];
+@c ===end===
+@example maxima
+(%i1) load("dlsode")$
+(%i2) f1: -.04d0*y1 + 1d4*y2*y3$
+(%i3) f3: 3d7*y2*y2$
+(%i4) f2: -f1 - f3$
+@group
+(%i5) fex: [f1, f2, f3];
+(%o5) [10000.0 y2 y3 - 0.04 y1, 
+                                          2                    2
+                - 10000.0 y2 y3 - 3.0e7 y2  + 0.04 y1, 3.0e7 y2 ]
+@end group
 @end example
 
 Initialize the solver, where we have selected method 21:
-@example
+@c ===beg===
+@c load("dlsode")$
+@c f1: -.04d0*y1 + 1d4*y2*y3$
+@c f3: 3d7*y2*y2$
+@c f2: -f1 - f3$
+@c fex: [f1, f2, f3];
+@c state : dlsode_init(fex, ['t,y1,y2,y3], 21);
+@c ===end===
+@example maxima
+(%i1) load("dlsode")$
+(%i2) f1: -.04d0*y1 + 1d4*y2*y3$
+(%i3) f3: 3d7*y2*y2$
+(%i4) f2: -f1 - f3$
+@group
+(%i5) fex: [f1, f2, f3];
+(%o5) [10000.0 y2 y3 - 0.04 y1, 
+                                          2                    2
+                - 10000.0 y2 y3 - 3.0e7 y2  + 0.04 y1, 3.0e7 y2 ]
+@end group
+@group
 (%i6) state : dlsode_init(fex, ['t,y1,y2,y3], 21);
-(%o6) [[f, #<Function "LAMBDA ($T $Y1 $Y2 $Y3)" @{49DAC061@}>], 
-[vars, [t, y1, y2, y3]], [mf, 21], [neq, 3], [lrw, 58], [liw, 23], [rwork, @{Li\
-sp Array: #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
-               0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
-               0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
+(%o6) [[f, #<Function "LAMBDA ($T $Y1 $Y2 $Y3)" @{6177C099@}>], 
+[vars, [t, y1, y2, y3]], [mf, 21], [neq, 3], [lrw, 58], 
+[liw, 23], [rwork, @{Lisp Array: #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.\
+0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
+               0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0\
+.0 0.0 0.0 0.0
+               0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0\
+.0 0.0 0.0 0.0
                0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)@}], 
-[iwork, @{Lisp Array: #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)@}], 
-[fjac, #<Function "LAMBDA ($T $Y1 $Y2 $Y3)" @{49D52AC9@}>]]
+[iwork, 
+@{Lisp Array: #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)@}], 
+[fjac, #<Function "LAMBDA ($T $Y1 $Y2 $Y3)" @{616B2099@}>]]
+@end group
 @end example
 The arrays rwork and iwork carry state between calls to
 @mref{dlsode_step}, so they should not be modified by the user.  In
@@ -80,31 +131,72 @@ Now that the algorithm has been initialized we can compute solutions
 to the differential equation, using the @var{state} returned above.
 
 For this example, we want to compute the solution at times
-@code{0.4*10^k} for @math{k} from 0 to 11, with the initial values of 1, 0, 0
-for the dependent variables and with a relative tolerance of 1d-4 and
-absolute tolerances of 1e-6, 1e-10, and 1d-6 for the dependent
+m4_math(0.4\times 10^k,
+@code{0.4*10^k})
+for @math{k} from 0 to 11, with the initial values of 1, 0, 0
+for the dependent variables and with a relative tolerance of
+m4_math(10^{-4}, 1e-4)
+and
+absolute tolerances of
+m4_mathcomma(10^{-6}, 1e-6)
+m4_mathcomma(10^{-10}, 1e-10)
+and
+m4_math(10^{-6}, 1e-6)
+for the dependent
 variables.
 
-Then
-@example
-y: [1d0, 0d0, 0d0];
-t: 0d0;
-rtol : 1d-4;
-atol: [1d-6, 1d-10, 1d-6];
-istate: 1;
-t:0d0;
-tout:.4d0;
-
-for k : 1 thru 12 do
+Then, putting everything together
+@c ===beg===
+@c load("dlsode")$
+@c f1: -.04d0*y1 + 1d4*y2*y3$
+@c f3: 3d7*y2*y2$
+@c f2: -f1 - f3$
+@c fex: [f1, f2, f3];
+@c state : dlsode_init(fex, ['t,y1,y2,y3], 21)$
+@c y: [1d0, 0d0, 0d0]$
+@c t: 0d0$
+@c rtol : 1d-4$
+@c atol: [1d-6, 1d-10, 1d-6]$
+@c istate: 1$
+@c t:0d0$
+@c tout:.4d0$
+@c
+@c for k : 1 thru 12 do
+@c   block([],
+@c     result: dlsode_step(y, t, tout, rtol, atol, istate, state),
+@c     printf(true, "At t = ~12,4,2e   y = ~{~14,6,2e~}~%", result[1], result[2]),
+@c     istate : result[3],
+@c     tout : tout * 10);
+@c ===end===
+@example maxima
+(%i1) load("dlsode")$
+(%i2) f1: -.04d0*y1 + 1d4*y2*y3$
+(%i3) f3: 3d7*y2*y2$
+(%i4) f2: -f1 - f3$
+@group
+(%i5) fex: [f1, f2, f3];
+(%o5) [10000.0 y2 y3 - 0.04 y1, 
+                                          2                    2
+                - 10000.0 y2 y3 - 3.0e7 y2  + 0.04 y1, 3.0e7 y2 ]
+@end group
+(%i6) state : dlsode_init(fex, ['t,y1,y2,y3], 21)$
+(%i7) y: [1d0, 0d0, 0d0]$
+(%i8) t: 0d0$
+(%i9) rtol : 1d-4$
+(%i10) atol: [1d-6, 1d-10, 1d-6]$
+(%i11) istate: 1$
+(%i12) t:0d0$
+@group
+(%i13) tout:.4d0$
+
+@end group
+@group
+(%i14) for k : 1 thru 12 do
   block([],
     result: dlsode_step(y, t, tout, rtol, atol, istate, state),
     printf(true, "At t = ~12,4,2e   y = ~@{~14,6,2e~@}~%", result[1], result[2]),
     istate : result[3],
     tout : tout * 10);
-@end example
-
-This produces the output:
-@example
 At t =   4.0000e-01   y =   9.851726e-01  3.386406e-05  1.479357e-02
 At t =   4.0000e+00   y =   9.055142e-01  2.240418e-05  9.446344e-02
 At t =   4.0000e+01   y =   7.158050e-01  9.184616e-06  2.841858e-01
@@ -117,9 +209,10 @@ At t =   4.0000e+07   y =   5.306413e-05  2.122677e-10  9.999469e-01
 At t =   4.0000e+08   y =   5.494530e-06  2.197824e-11  9.999945e-01
 At t =   4.0000e+09   y =   5.129458e-07  2.051784e-12  9.999995e-01
 At t =   4.0000e+10   y =  -7.170563e-08 -2.868225e-13  1.000000e+00
+(%o14)                        done
+@end group
 @end example
 
-
 @node Functions and Variables for odepack, , Getting Started with ODEPACK, Package odepack
 @section Functions and Variables for odepack
 
commit 8a86e987d94ae36964c6a53b8c0ba0c325a9a3df
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 14:30:21 2025 -0700
    Rename odepack.texi to odepack.texi.m4
    
    In preparation for adding some nice TeX formulas.
diff --git a/doc/info/odepack.texi b/doc/info/odepack.texi.m4
similarity index 100%
rename from doc/info/odepack.texi
rename to doc/info/odepack.texi.m4
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 19:31:33
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  bd0858ca56a4e673b71810895d5e47e947d973a8 (commit)
      from  89900e3bb4fe2c81712c3fb3d6601d98887291ec (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bd0858ca56a4e673b71810895d5e47e947d973a8
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 12:31:10 2025 -0700
    Add new comment blocks for examples and regenerate them
    
    Replace some `@example` with `@example maxima` to allow syntax
    highlighting.
diff --git a/doc/info/hompack.texi b/doc/info/hompack.texi
index 8e72ac823..1407c6f88 100644
--- a/doc/info/hompack.texi
+++ b/doc/info/hompack.texi
@@ -125,53 +125,72 @@ root.
 @end table
 
 Here are some examples of using @code{hompack_polsys}.
-@example
+@c ===beg===
+@c load(hompack)$
+@c hompack_polsys([x1^2-1, x2^2-2],[x1,x2]);
+@c ===end===
+@example maxima
 (%i1) load(hompack)$
+@group
 (%i2) hompack_polsys([x1^2-1, x2^2-2],[x1,x2]);
-(%o2) [0,
-       [[x1 = (-1.354505666901954e-16*%i)-0.9999999999999999,
-         x2 = 3.52147935979316e-16*%i-1.414213562373095],
-        [x1 = 1.0-5.536432658639868e-18*%i,
-         x2 = (-4.213674137126362e-17*%i)-1.414213562373095],
-        [x1 = (-9.475939894034927e-17*%i)-1.0,
-         x2 = 2.669654624736742e-16*%i+1.414213562373095],
-        [x1 = 9.921253413273088e-18*%i+1.0,
-         x2 = 1.414213562373095-5.305667769855424e-17*%i]],[1,1,1,1],
-       [1.0,1.0,0.9999999999999996,1.0],
-       [4.612623769341193,4.612623010859902,4.612623872939383,
-        4.612623114484402],[40,40,40,40]]
+(%o2) [0, [[x1 = 7.493410174972965e-17 %i - 1.0, 
+x2 = - 2.1199276810167172e-16 %i - 1.4142135623730951], 
+[x1 = 1.0 - 1.7812202259088373e-17 %i, 
+x2 = - 9.892128000334418e-17 %i - 1.4142135623730951], 
+[x1 = - 8.745710933584358e-17 %i - 1.0, 
+x2 = 1.4142135623730951 - 3.1543521174128613e-17 %i], 
+[x1 = 1.0 - 5.5487454344135625e-18 %i, 
+x2 = 9.617653810456737e-17 %i + 1.4142135623730951]], 
+[1, 1, 1, 1], [1.0, 1.0, 0.9999999999999999, 
+0.9999999999999999], [4.6126237693413445, 4.6126230108601, 
+4.612623872939582, 4.6126231144843475], [40, 40, 40, 40]]
+@end group
 @end example
 
 The analytical solution can be obtained with solve:
-@example
+@c ===beg===
+@c solve([x1^2-1, x2^2-2],[x1,x2]);
+@c ===end===
+@example maxima
+@group
 (%i1) solve([x1^2-1, x2^2-2],[x1,x2]);
-(%o1) [[x1 = 1,x2 = -sqrt(2)],[x1 = 1,x2 = sqrt(2)],[x1 = -1,x2 = -sqrt(2)],
-        [x1 = -1,x2 = sqrt(2)]]
+(%o1) [[x1 = 1, x2 = - sqrt(2)], [x1 = 1, x2 = sqrt(2)], 
+            [x1 = - 1, x2 = - sqrt(2)], [x1 = - 1, x2 = sqrt(2)]]
+@end group
 @end example
 We see that @code{hompack_polsys} returned the correct answer except
 that the roots are in a different order and there is a small imaginary
 part.
 
 Another example, with corresponding solution from solve:
-@example
-(%i1) hompack_polsys([x1^2 + 2*x2^2 + x1*x2 - 5, 2*x1^2 + x2^2 + x2-4],[x1,x2]);
-(%o1) [0,
-       [[x1 = 1.201557301700783-1.004786320788336e-15*%i,
-         x2 = (-4.376615092392437e-16*%i)-1.667270363480143],
-        [x1 = 1.871959754090949e-16*%i-1.428529189565313,
-         x2 = (-6.301586314393093e-17*%i)-0.9106199083334113],
-        [x1 = 0.5920619420732697-1.942890293094024e-16*%i,
-         x2 = 6.938893903907228e-17*%i+1.383859154368197],
-        [x1 = 7.363503717463654e-17*%i+0.08945540033671608,
-         x2 = 1.557667481081721-4.109128293931921e-17*%i]],[1,1,1,1],
-       [1.000000000000001,1.0,1.0,1.0],
-       [6.205795654034752,7.722213259390295,7.228287079174351,
-        5.611474283583368],[35,41,48,40]]
-(%i2) solve([x1^2+2*x2^2+x1*x2 - 5, 2*x1^2+x2^2+x2-4],[x1,x2]);
-(%o2) [[x1 = 0.08945540336850383,x2 = 1.557667386609071],
-       [x1 = 0.5920619554695062,x2 = 1.383859286083807],
-       [x1 = 1.201557352500749,x2 = -1.66727025803531],
-       [x1 = -1.428529150636283,x2 = -0.9106198942815954]]
+@c ===beg===
+@c load(hompack)$
+@c hompack_polsys([x1^2 + 2*x2^2 + x1*x2 - 5, 2*x1^2 + x2^2 + x2-4],[x1,x2]);
+@c solve([x1^2+2*x2^2+x1*x2 - 5, 2*x1^2+x2^2+x2-4],[x1,x2]);
+@c ===end===
+@example maxima
+(%i1) load(hompack)$
+@group
+(%i2) hompack_polsys([x1^2 + 2*x2^2 + x1*x2 - 5, 2*x1^2 + x2^2 + x2-4],[x1,x2]);
+(%o2) [0, [[x1 = 1.2015573017007832 - 6.51849608628558e-16 %i, 
+x2 = - 2.2667444298167825e-16 %i - 1.6672703634801431], 
+[x1 = - 5.901956169878514e-17 %i - 1.4285291895653132, 
+x2 = - 6.670215053038164e-17 %i - 0.9106199083334114], 
+[x1 = 1.942890293094024e-16 %i + 0.5920619420732687, 
+x2 = 1.383859154368197 - 1.942890293094024e-16 %i], 
+[x1 = 0.08945540033671631 - 8.534583737796769e-16 %i, 
+x2 = 2.415141536592239e-16 %i + 1.5576674810817213]], 
+[1, 1, 1, 1], [1.0000000000000004, 1.0000000000000002, 1.0, 
+0.9999999999999999], [6.205795654034981, 7.7222132593900525, 
+7.228287079174324, 5.6114742835849105], [35, 41, 48, 40]]
+@end group
+@group
+(%i3) solve([x1^2+2*x2^2+x1*x2 - 5, 2*x1^2+x2^2+x2-4],[x1,x2]);
+(%o3) [[x1 = 0.08945540336850383, x2 = 1.5576673866090713], 
+[x1 = 0.5920619554695062, x2 = 1.3838592860838075], 
+[x1 = 1.2015573525007488, x2 = - 1.66727025803531], 
+[x1 = - 1.428529150636283, x2 = - 0.9106198942815954]]
+@end group
 @end example
 
 Note that @code{hompack_polsys} can sometimes be very slow.  Perhaps
-----------------------------------------------------------------------
Summary of changes:
 doc/info/hompack.texi | 89 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 54 insertions(+), 35 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 18:59:54
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  89900e3bb4fe2c81712c3fb3d6601d98887291ec (commit)
       via  a00a9d06b5812505b42ed93f3f6126839c07d411 (commit)
      from  348231510534ebc4e78319a0642162dbd313d3ee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 89900e3bb4fe2c81712c3fb3d6601d98887291ec
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 11:57:04 2025 -0700
    Add new comment blocks for examples and regenerate them
    
    Replace some `@example` with `@example maxima` to allow syntax
    highlighting.
diff --git a/doc/info/Program.texi b/doc/info/Program.texi
index e0ee6b8b1..13bcd99b6 100644
--- a/doc/info/Program.texi
+++ b/doc/info/Program.texi
@@ -100,21 +100,35 @@ This has the same effect as entering
 @noindent
 The Lisp function @code{displa} prints an expression in Maxima format.
 
-@example
-(%i1) :lisp #$[x, y, z]$ 
+@c ===beg===
+@c :lisp #$[x, y, z]$ 
+@c :lisp (displa '((MLIST SIMP) $X $Y $Z))
+@c ===end===
+@example maxima
+@group
+(%i1) :lisp #$[x, y, z]$
 ((MLIST SIMP) $X $Y $Z)
+@end group
+@group
 (%i1) :lisp (displa '((MLIST SIMP) $X $Y $Z))
 [x, y, z]
 NIL
+@end group
 @end example
 
 Functions defined in Maxima are not ordinary Lisp functions.  The Lisp function
 @code{mfuncall} calls a Maxima function.  For example:
 
-@example
+@c ===beg===
+@c foo(x,y) := x*y$
+@c :lisp (mfuncall '$foo 'a 'b)
+@c ===end===
+@example maxima
 (%i1) foo(x,y) := x*y$
+@group
 (%i2) :lisp (mfuncall '$foo 'a 'b)
 ((MTIMES SIMP) A B)
+@end group
 @end example
 
 Some Lisp functions are shadowed in the Maxima package, namely the following.
@@ -202,19 +216,28 @@ Examples:
 @item
 @code{backtrace ()} prints the entire call stack.
 
-@example
+@c ===beg===
+@c h(x) := g(x/7)$
+@c g(x) := f(x-11)$
+@c f(x) := e(x^2)$
+@c e(x) := (backtrace(), 2*x + 13)$
+@c h(10);
+@c ===end===
+@example maxima
 (%i1) h(x) := g(x/7)$
 (%i2) g(x) := f(x-11)$
 (%i3) f(x) := e(x^2)$
 (%i4) e(x) := (backtrace(), 2*x + 13)$
+@group
 (%i5) h(10);
 #0: e(x=4489/49)
-#1: f(x=-67/7)
+#1: f(x=-(67/7))
 #2: g(x=10/7)
 #3: h(x=10)
                               9615
 (%o5)                         ----
                                49
+@end group
 @end example
 @end itemize
 
@@ -223,19 +246,28 @@ Examples:
 @code{backtrace (@var{n})} prints the @var{n} most recent 
 functions, including the currently active function.
 
-@example
+@c ===beg===
+@c h(x) := (backtrace(1), g(x/7))$
+@c g(x) := (backtrace(1), f(x-11))$
+@c f(x) := (backtrace(1), e(x^2))$
+@c e(x) := (backtrace(1), 2*x + 13)$
+@c h(10);
+@c ===end===
+@example maxima
 (%i1) h(x) := (backtrace(1), g(x/7))$
 (%i2) g(x) := (backtrace(1), f(x-11))$
 (%i3) f(x) := (backtrace(1), e(x^2))$
 (%i4) e(x) := (backtrace(1), 2*x + 13)$
+@group
 (%i5) h(10);
 #0: h(x=10)
 #0: g(x=10/7)
-#0: f(x=-67/7)
+#0: f(x=-(67/7))
 #0: e(x=4489/49)
                               9615
 (%o5)                         ----
                                49
+@end group
 @end example
 @end itemize
 
@@ -339,7 +371,11 @@ variable may be used without affecting the value of a variable with
 the same name outside of the @code{do}.  The control-variable is unbound
 after the @code{do} terminates.
 
-@example
+@c ===beg===
+@c for a:-3 thru 26 step 7 do display(a)$
+@c ===end===
+@example maxima
+@group
 (%i1) for a:-3 thru 26 step 7 do display(a)$
                              a = - 3
 
@@ -350,6 +386,8 @@ after the @code{do} terminates.
                              a = 18
 
                              a = 25
+
+@end group
 @end example
 
 @c ===beg===
@@ -441,13 +479,19 @@ In this case one may use @code{next @var{expression}} instead of
 @code{step @var{increment}}.  This will cause the control-variable to be set to
 the result of evaluating @var{expression} each time through the loop.
 
-@example
-(%i6) for count: 2 next 3*count thru 20 do display (count)$
+@c ===beg===
+@c for count: 2 next 3*count thru 20 do display (count)$
+@c ===end===
+@example maxima
+@group
+(%i1) for count: 2 next 3*count thru 20 do display (count)$
                             count = 2
 
                             count = 6
 
                            count = 18
+
+@end group
 @end example
 
 @c UGH. DO WE REALLY NEED TO MENTION THIS??
@@ -530,15 +574,26 @@ terminate when the @var{list} is exhausted or when a @code{return} is
 executed in the @var{body}.  (In fact, @code{list} may be any
 non-atomic expression, and successive parts are taken.)
 
-@example
-(%i1)  for f in [log, rho, atan] do ldisp(f(1))$
-(%t1)                                  0
-(%t2)                                rho(1)
-                                     %pi
-(%t3)                                 ---
-                                      4
+@c ===beg===
+@c for f in [log, rho, atan] do ldisp(f(1))$
+@c ev(%t3,numer);
+@c ===end===
+@example maxima
+@group
+(%i1) for f in [log, rho, atan] do ldisp(f(1))$
+(%t1)                           0
+
+(%t2)                        rho(1)
+
+                               %pi
+(%t3)                          ---
+                                4
+
+@end group
+@group
 (%i4) ev(%t3,numer);
-(%o4)                             0.78539816
+(%o4)                  0.7853981633974483
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -631,23 +686,21 @@ Example:
 
 The size of @code{U}, as determined by @code{ERROR-SIZE}, is 24.
 
-@example
+@example maxima
 (%i1) U: (C^D^E + B + A)/(cos(X-1) + 1)$
-
 (%i2) error_size: 20$
-
 (%i3) error ("Example expression is", U);
-
 Example expression is errexp1
- -- an error.  Quitting.  To debug this try debugmode(true);
+ -- an error. To debug this try: debugmode(true);
+@group
 (%i4) errexp1;
                             E
                            D
                           C   + B + A
 (%o4)                    --------------
                          cos(X - 1) + 1
+@end group
 (%i5) error_size: 30$
-
 (%i6) error ("Example expression is", U);
 
                          E
@@ -1118,11 +1171,17 @@ Recursively applies @var{f} to @var{expr}, in a top
 down manner.  This is most useful when complete factorization is
 desired, for example:
 
-@example
+@c ===beg===
+@c exp:(a^2+2*a+1)*y + x^2$
+@c scanmap(factor,exp);
+@c ===end===
+@example maxima
 (%i1) exp:(a^2+2*a+1)*y + x^2$
+@group
 (%i2) scanmap(factor,exp);
-                                    2      2
-(%o2)                         (a + 1)  y + x
+                                2      2
+(%o2)                    (a + 1)  y + x
+@end group
 @end example
 
 Note the way in which @code{scanmap} applies the given function
@@ -1131,20 +1190,30 @@ another form of @var{expr} is presented to @code{scanmap} then the
 result may be different.  Thus, @code{%o2} is not recovered when
 @code{scanmap} is applied to the expanded form of @code{exp}:
 
-@example
-(%i3) scanmap(factor,expand(exp));
-                           2                  2
-(%o3)                      a  y + 2 a y + y + x
+@c ===beg===
+@c scanmap(factor,expand(exp));
+@c ===end===
+@example maxima
+@group
+(%i1) scanmap(factor,expand(exp));
+(%o1)                          exp
+@end group
 @end example
 
 Here is another example of the way in which @code{scanmap} recursively
 applies a given function to all subexpressions, including exponents:
 
-@example
-(%i4) expr : u*v^(a*x+b) + c$
-(%i5) scanmap('f, expr);
-                    f(f(f(a) f(x)) + f(b))
-(%o5) f(f(f(u) f(f(v)                      )) + f(c))
+@c ===beg===
+@c expr : u*v^(a*x+b) + c$
+@c scanmap('f, expr);
+@c ===end===
+@example maxima
+(%i1) expr : u*v^(a*x+b) + c$
+@group
+(%i2) scanmap('f, expr);
+                        f(f(f(a) f(x)) + f(b))
+(%o2)    f(f(f(u) f(f(v)                      )) + f(c))
+@end group
 @end example
 
 @code{scanmap (@var{f}, @var{expr}, bottomup)} applies @var{f} to @var{expr} in a
commit a00a9d06b5812505b42ed93f3f6126839c07d411
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 11:15:57 2025 -0700
    Regenerate existing examples
diff --git a/doc/info/Program.texi b/doc/info/Program.texi
index 791df771e..e0ee6b8b1 100644
--- a/doc/info/Program.texi
+++ b/doc/info/Program.texi
@@ -357,12 +357,16 @@ after the @code{do} terminates.
 @c for i: 1 while i <= 10 do s: s+i;
 @c s;
 @c ===end===
-@example
+@example maxima
 (%i1) s: 0$
+@group
 (%i2) for i: 1 while i <= 10 do s: s+i;
 (%o2)                         done
+@end group
+@group
 (%i3) s;
 (%o3)                          55
+@end group
 @end example
 
 Note that the condition @code{while i <= 10}
@@ -376,17 +380,21 @@ is equivalent to @code{unless i > 10} and also @code{thru 10}.
 @c      series: series + subst (x=0, term)*x^p)$
 @c series;
 @c ===end===
-@example
+@example maxima
 (%i1) series: 1$
 (%i2) term: exp (sin (x))$
+@group
 (%i3) for p: 1 unless p > 7 do
-          (term: diff (term, x)/p, 
-           series: series + subst (x=0, term)*x^p)$
+    (term: diff (term, x)/p,
+     series: series + subst (x=0, term)*x^p)$
+@end group
+@group
 (%i4) series;
                   7    6     5    4    2
                  x    x     x    x    x
 (%o4)            -- - --- - -- - -- + -- + x + 1
                  90   240   15   8    2
+@end group
 @end example
 
 which gives 8 terms of the Taylor series for @code{e^sin(x)}.
@@ -402,19 +410,25 @@ which gives 8 terms of the Taylor series for @code{e^sin(x)}.
 @c     (guess: subst (guess, x, 0.5*(x + 10/x)),
 @c     if abs (guess^2 - 10) < 0.00005 then return (guess));
 @c ===end===
-@example
+@example maxima
 (%i1) poly: 0$
+@group
 (%i2) for i: 1 thru 5 do
-          for j: i step -1 thru 1 do
-              poly: poly + i*x^j$
+    for j: i step -1 thru 1 do
+        poly: poly + i*x^j$
+@end group
+@group
 (%i3) poly;
                   5      4       3       2
 (%o3)          5 x  + 9 x  + 12 x  + 14 x  + 15 x
+@end group
 (%i4) guess: -3.0$
+@group
 (%i5) for i: 1 thru 10 do
-          (guess: subst (guess, x, 0.5*(x + 10/x)),
-           if abs (guess^2 - 10) < 0.00005 then return (guess));
+    (guess: subst (guess, x, 0.5*(x + 10/x)),
+    if abs (guess^2 - 10) < 0.00005 then return (guess));
 (%o5)                  - 3.162280701754386
+@end group
 @end example
 
 This example computes the negative square root of 10 using the
@@ -456,13 +470,17 @@ square-root of 5 using a poor initial guess.
 @c x;
 @c sqrt(5), numer;
 @c ===end===
-@example
+@example maxima
 (%i1) x: 1000$
 (%i2) thru 20 do x: 0.5*(x + 5.0/x)$
+@group
 (%i3) x;
 (%o3)                   2.23606797749979
+@end group
+@group
 (%i4) sqrt(5), numer;
 (%o4)                   2.23606797749979
+@end group
 @end example
 
 If it is desired one may even omit the termination conditions entirely
@@ -477,13 +495,19 @@ should be used to terminate execution of the @code{do}.
 @c sqr (x) := x^2 - 5.0$
 @c newton (sqr, 1000);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) newton (f, x):= ([y, df, dfx], df: diff (f ('x), 'x),
-          do (y: ev(df), x: x - f(x)/y, 
-              if abs (f (x)) < 5e-6 then return (x)))$
+    do (y: ev(df), x: x - f(x)/y,
+        if abs (f (x)) < 5e-6 then return (x)))$
+warning: parser: I'll let it stand, but (...) doesn't recognize local variables.
+warning: parser: did you mean to say: block([y, df, dfx], ...) ?
+@end group
 (%i2) sqr (x) := x^2 - 5.0$
+@group
 (%i3) newton (sqr, 1000);
-(%o3)                   2.236068027062195
+(%o3)                  2.2360680270621947
+@end group
 @end example
 
 @c DUNNO IF WE NEED THIS LEVEL OF DETAIL; THIS ARTICLE IS GETTING PRETTY LONG
@@ -691,24 +715,20 @@ value.  The global value of @code{errormsg} is always present.
 @c errormsg: false;
 @c sin(a,b);
 @c ===end===
-@example
+sin(y): expected exactly 1 arguments but got 2: [a, b]
+ -- an error. To debug this try: debugmode(true);
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) errormsg;
 (%o1)                         true
 @end group
-@group
 (%i2) sin(a,b);
-sin: wrong number of arguments.
- -- an error. To debug this try: debugmode(true);
-@end group
 @group
 (%i3) errormsg: false;
 (%o3)                         false
 @end group
-@group
 (%i4) sin(a,b);
- -- an error. To debug this try: debugmode(true);
-@end group
 @end example
 
 The option variable @code{errormsg} can not be set in a block to a local value.
@@ -721,17 +741,19 @@ The option variable @code{errormsg} can not be set in a block to a local value.
 @c errormsg:false;
 @c f(true);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) f(bool):=block([errormsg:bool],
                      print ("value of errormsg is",errormsg))$
+@end group
 @group
 (%i2) errormsg:true;
 (%o2)                         true
 @end group
 @group
 (%i3) f(false);
-value of errormsg is true 
-(%o3)                         true
+value of errormsg is false 
+(%o3)                         false
 @end group
 @group
 (%i4) errormsg:false;
@@ -739,8 +761,8 @@ value of errormsg is true
 @end group
 @group
 (%i5) f(true);
-value of errormsg is false 
-(%o5)                         false
+value of errormsg is true 
+(%o5)                         true
 @end group
 @end example
 
@@ -881,22 +903,28 @@ See also @mrefcomma{scanmap} @mrefcomma{maplist} @mrefcomma{outermap} @mref{matr
 @c map(ratsimp, x/(x^2+x)+(y^2+y)/y);
 @c map("=",[a,b],[-0.5,3]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) map(f,x+a*y+b*z);
-(%o1)                        f(b z) + f(a y) + f(x)
+(%o1)                f(b z) + f(a y) + f(x)
+@end group
+@group
 (%i2) map(lambda([u],partfrac(u,x)),x+1/(x^3+4*x^2+5*x+2));
-                           1       1        1
-(%o2)                     ----- - ----- + -------- + x
-                         x + 2   x + 1          2
-                                         (x + 1)
+                    1       1        1
+(%o2)             ----- - ----- + -------- + x
+                  x + 2   x + 1          2
+                                  (x + 1)
+@end group
+@group
 (%i3) map(ratsimp, x/(x^2+x)+(y^2+y)/y);
-                                      1
-(%o3)                            y + ----- + 1
-                                    x + 1
+                                1
+(%o3)                     y + ----- + 1
+                              x + 1
+@end group
+@group
 (%i4) map("=",[a,b],[-0.5,3]);
-(%o4)                          [a = - 0.5, b = 3]
-
-
+(%o4)                  [a = - 0.5, b = 3]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1037,7 +1065,7 @@ statement from C.
 @c     return(10)
 @c  );
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) for i:1 thru 10 do o:i;
 (%o1)                         done
@@ -1057,6 +1085,7 @@ statement from C.
     );
 (%o3)                           8
 @end group
+@group
 (%i4) block([i],
     i:4,
     block([o],
@@ -1067,6 +1096,7 @@ statement from C.
     return(10)
  );
 (%o4)                           4
+@end group
 @end example
 
 
@@ -1196,7 +1226,7 @@ To show the argument combinations more clearly, @code{F} is left undefined.
 @c outermap (F, [a, b], matrix ([1, 2]), matrix ([x], [y]));
 @c outermap ("+", [a, b, c], [1, 2, 3]);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) outermap (F, [a, b, c], [1, 2, 3]);
 (%o1) [[F(a, 1), F(a, 2), F(a, 3)], [F(b, 1), F(b, 2), F(b, 3)], 
@@ -1252,7 +1282,7 @@ and each element of each list is a matrix.
 @c [op (arg_1), op (arg_2), op (arg_3)];
 @c [op (xx_0), op (xx_1), op (xx_2)];
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) arg_1 :  matrix ([a, b], [c, d]);
                             [ a  b ]
@@ -1267,6 +1297,7 @@ and each element of each list is a matrix.
 (%i3) arg_3 : matrix ([xx, yy]);
 (%o3)                      [ xx  yy ]
 @end group
+@group
 (%i4) xx_0 : outermap (lambda ([x, y, z], x / y + z), arg_1,
                                                    arg_2, arg_3);
                [  [      a        a  ]  [      a        a  ]  ]
@@ -1283,6 +1314,7 @@ and each element of each list is a matrix.
                  [  [      d        d  ]  [      d        d  ]  ]
                  [ [[ xx + --  yy + -- ], [ xx + --  yy + -- ]] ]
                  [  [      11       11 ]  [      22       22 ]  ]
+@end group
 @group
 (%i5) xx_1 : xx_0 [1][1];
            [      a        a  ]  [      a        a  ]
@@ -1321,7 +1353,7 @@ while @code{cartesian_product} does not.
 @c                      cartesian_product ({a, b, c}, {1, 2, 3}));
 @c is (equal (%, %th (2)));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) outermap (F, [a, b, c], [1, 2, 3]);
 (%o1) [[F(a, 1), F(a, 2), F(a, 3)], [F(b, 1), F(b, 2), F(b, 3)], 
-----------------------------------------------------------------------
Summary of changes:
 doc/info/Program.texi | 259 +++++++++++++++++++++++++++++++++++---------------
 1 file changed, 180 insertions(+), 79 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: peterpall <pet...@us...> - 2025-09-03 18:58:10
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  348231510534ebc4e78319a0642162dbd313d3ee (commit)
      from  3fdfcfd0563524a67e363d76bcad56b82b44d9d7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 348231510534ebc4e78319a0642162dbd313d3ee
Author: Gunter Königsmann <gu...@pe...>
Date:   Wed Sep 3 20:57:44 2025 +0200
    wrstcse: wrstcse_append now only changes indices if necessary
    
    Just assigning all tol[n] a new, unique n made sure the tol[n] stay independent and
    resulted in elegant, because short, code. But it makes interpreting the result of
    wc_sensitvities() harder so more thought had to be put into that function now.
diff --git a/doc/info/wrstcse.texi b/doc/info/wrstcse.texi
index ff8bbacad..453503f5b 100644
--- a/doc/info/wrstcse.texi
+++ b/doc/info/wrstcse.texi
@@ -789,10 +789,19 @@ R_2 = 1004.9999999999999], [R_1 = 101.0, R_2 = 1010.0]]
 @end defvr
 
 @anchor{wc_tolappend}
-@deffn {Function} wc_tolappend (@var{list})
+@deffn {Function} wc_tolappend (@var{list1}, @var{list2},...)
 
-Appends two list of parameters with tolerances renumbering the tolerances of
-both lists so they don't coincide.
+Appends lists of parameters from independent sources making sure that
+tolerances of all elements in one list will stay independent from all
+elements in the others.
+
+Works like append() in that it appends all values from all of its
+arguments to make one big list. But this command, if one list
+happens to contain a @var{tol[n]} with the same @var{n} as another
+list, changes one of these @var{n} to a new value that makes
+it independent from all tolerances from the other list.
+
+See also @mrefdot{append}
 
 Example:
 @c ===beg===
@@ -803,8 +812,9 @@ Example:
 @c  ];
 @c val_b: [
 @c    R_3= 1000.0*(1+tol[1]*.01),
-@c    R_4= 1000.0*(1+tol[2]*.01)
+@c    R_4= 1000.0*(1+tol[4]*.01)
 @c  ];
+@c append(val_a,val_b);
 @c wc_tolappend(val_a,val_b);
 @c ===end===
 @example maxima
@@ -822,21 +832,32 @@ Example:
 @group
 (%i3) val_b: [
    R_3= 1000.0*(1+tol[1]*.01),
-   R_4= 1000.0*(1+tol[2]*.01)
+   R_4= 1000.0*(1+tol[4]*.01)
  ];
 (%o3) [R_3 = 1000.0 (0.01 tol  + 1), 
                              1
                                     R_4 = 1000.0 (0.01 tol  + 1)]
-                                                          2
+                                                          4
 @end group
 @group
-(%i4) wc_tolappend(val_a,val_b);
+(%i4) append(val_a,val_b);
 (%o4) [R_1 = 1000.0 (0.01 tol  + 1), 
-                             2
+                             1
+R_2 = 1000.0 (0.01 tol  + 1), R_3 = 1000.0 (0.01 tol  + 1), 
+                      2                             1
+R_4 = 1000.0 (0.01 tol  + 1)]
+                      4
+@end group
+@group
+(%i5) wc_tolappend(val_a,val_b);
+                            used = 1
+
+(%o5) [R_1 = 1000.0 (0.01 tol  + 1), 
+                             1
 R_2 = 1000.0 (0.01 tol  + 1), R_3 = 1000.0 (0.01 tol  + 1), 
-                      1                             4
+                      2                             5
 R_4 = 1000.0 (0.01 tol  + 1)]
-                      3
+                      4
 @end group
 @end example
 @end deffn
diff --git a/share/contrib/wrstcse.mac b/share/contrib/wrstcse.mac
index 022ed3758..dc79cc930 100644
--- a/share/contrib/wrstcse.mac
+++ b/share/contrib/wrstcse.mac
@@ -29,19 +29,37 @@ with n=startnum */
     
 );
 
-/* wc_tolappend appends a list of element values to another renumbering all tol[] found in both lists
-so they won't conflict. */
-
-wc_tolappend([wc_args]):=block([wc_retval:[],wc_numberoftols:1],
-    for wc_i in wc_args do
-    (
-        if not listp(wc_i) then error("wc_tolappend: All parameters need to be lists"),
-        wc_retval:append(wc_retval,%wc_tolrenumber(wc_i,wc_numberoftols)),
-        wc_numberoftols:wc_numberoftols+length(%wc_tols(wc_i))
+/* wc_tolappend appends a list of element values to an independent list of element
+values renaming all tol[n] found in one list if they would coincide with a tol[n]
+with the same n in the other. */
+wc_tolappend([x]):=block([wc_usedTols:[],wc_tolCntr:1,retval:[]],
+    /* Find which index we can start assigning new tol[n] to */
+    for wc_param in x do
+            for wc_arg in map('first,map('args,%wc_tols(wc_param))) do
+                    if numberp(wc_arg) then
+                        if wc_arg >= wc_tolCntr then wc_tolCntr:wc_arg+1,
+    
+    /* Iterate over all parameters f this function */
+    for wc_param in x do
+        (
+            /* Iterate over all tol[n] of this parameter*/
+            for wc_arg in map('first,map('args,%wc_tols(wc_param))) do
+            (
+                /* Is this tol[n] already in use by a different parameter? */
+                if member(wc_arg,wc_usedTols)  then
+                /* It is already in use => substitute it by a new one. */
+                (
+                    disp(used=wc_arg),
+                    wc_param:subst(tol[wc_arg]=tol[wc_tolCntr],wc_param),
+                    wc_tolCntr:wc_tolCntr+1
+                ),
+                /* mark this tol as "already in use" */
+                push(wc_arg,wc_usedTols)
+            ),
+        retval:append(retval,wc_param)
     ),
-    wc_retval
-);
-
+    return(retval)
+)$
 /* wc_systematic returns a list of the results of all combinations one can get by assigning every tol[n] wc_valuespertol 
 values between -1 and 1. */
 
-----------------------------------------------------------------------
Summary of changes:
 doc/info/wrstcse.texi     | 41 +++++++++++++++++++++++++++++++----------
 share/contrib/wrstcse.mac | 42 ++++++++++++++++++++++++++++++------------
 2 files changed, 61 insertions(+), 22 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 18:58:01
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-program-update-examples has been created
        at  cd3864719c8daaa8771d3df14ec3abdc40bb599c (commit)
- Log -----------------------------------------------------------------
commit cd3864719c8daaa8771d3df14ec3abdc40bb599c
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 11:57:04 2025 -0700
    Add new comment blocks for examples and regenerate them
    
    Replace some `@example` with `@example maxima` to allow syntax
    highlighting.
diff --git a/doc/info/Program.texi b/doc/info/Program.texi
index e0ee6b8b1..13bcd99b6 100644
--- a/doc/info/Program.texi
+++ b/doc/info/Program.texi
@@ -100,21 +100,35 @@ This has the same effect as entering
 @noindent
 The Lisp function @code{displa} prints an expression in Maxima format.
 
-@example
-(%i1) :lisp #$[x, y, z]$ 
+@c ===beg===
+@c :lisp #$[x, y, z]$ 
+@c :lisp (displa '((MLIST SIMP) $X $Y $Z))
+@c ===end===
+@example maxima
+@group
+(%i1) :lisp #$[x, y, z]$
 ((MLIST SIMP) $X $Y $Z)
+@end group
+@group
 (%i1) :lisp (displa '((MLIST SIMP) $X $Y $Z))
 [x, y, z]
 NIL
+@end group
 @end example
 
 Functions defined in Maxima are not ordinary Lisp functions.  The Lisp function
 @code{mfuncall} calls a Maxima function.  For example:
 
-@example
+@c ===beg===
+@c foo(x,y) := x*y$
+@c :lisp (mfuncall '$foo 'a 'b)
+@c ===end===
+@example maxima
 (%i1) foo(x,y) := x*y$
+@group
 (%i2) :lisp (mfuncall '$foo 'a 'b)
 ((MTIMES SIMP) A B)
+@end group
 @end example
 
 Some Lisp functions are shadowed in the Maxima package, namely the following.
@@ -202,19 +216,28 @@ Examples:
 @item
 @code{backtrace ()} prints the entire call stack.
 
-@example
+@c ===beg===
+@c h(x) := g(x/7)$
+@c g(x) := f(x-11)$
+@c f(x) := e(x^2)$
+@c e(x) := (backtrace(), 2*x + 13)$
+@c h(10);
+@c ===end===
+@example maxima
 (%i1) h(x) := g(x/7)$
 (%i2) g(x) := f(x-11)$
 (%i3) f(x) := e(x^2)$
 (%i4) e(x) := (backtrace(), 2*x + 13)$
+@group
 (%i5) h(10);
 #0: e(x=4489/49)
-#1: f(x=-67/7)
+#1: f(x=-(67/7))
 #2: g(x=10/7)
 #3: h(x=10)
                               9615
 (%o5)                         ----
                                49
+@end group
 @end example
 @end itemize
 
@@ -223,19 +246,28 @@ Examples:
 @code{backtrace (@var{n})} prints the @var{n} most recent 
 functions, including the currently active function.
 
-@example
+@c ===beg===
+@c h(x) := (backtrace(1), g(x/7))$
+@c g(x) := (backtrace(1), f(x-11))$
+@c f(x) := (backtrace(1), e(x^2))$
+@c e(x) := (backtrace(1), 2*x + 13)$
+@c h(10);
+@c ===end===
+@example maxima
 (%i1) h(x) := (backtrace(1), g(x/7))$
 (%i2) g(x) := (backtrace(1), f(x-11))$
 (%i3) f(x) := (backtrace(1), e(x^2))$
 (%i4) e(x) := (backtrace(1), 2*x + 13)$
+@group
 (%i5) h(10);
 #0: h(x=10)
 #0: g(x=10/7)
-#0: f(x=-67/7)
+#0: f(x=-(67/7))
 #0: e(x=4489/49)
                               9615
 (%o5)                         ----
                                49
+@end group
 @end example
 @end itemize
 
@@ -339,7 +371,11 @@ variable may be used without affecting the value of a variable with
 the same name outside of the @code{do}.  The control-variable is unbound
 after the @code{do} terminates.
 
-@example
+@c ===beg===
+@c for a:-3 thru 26 step 7 do display(a)$
+@c ===end===
+@example maxima
+@group
 (%i1) for a:-3 thru 26 step 7 do display(a)$
                              a = - 3
 
@@ -350,6 +386,8 @@ after the @code{do} terminates.
                              a = 18
 
                              a = 25
+
+@end group
 @end example
 
 @c ===beg===
@@ -441,13 +479,19 @@ In this case one may use @code{next @var{expression}} instead of
 @code{step @var{increment}}.  This will cause the control-variable to be set to
 the result of evaluating @var{expression} each time through the loop.
 
-@example
-(%i6) for count: 2 next 3*count thru 20 do display (count)$
+@c ===beg===
+@c for count: 2 next 3*count thru 20 do display (count)$
+@c ===end===
+@example maxima
+@group
+(%i1) for count: 2 next 3*count thru 20 do display (count)$
                             count = 2
 
                             count = 6
 
                            count = 18
+
+@end group
 @end example
 
 @c UGH. DO WE REALLY NEED TO MENTION THIS??
@@ -530,15 +574,26 @@ terminate when the @var{list} is exhausted or when a @code{return} is
 executed in the @var{body}.  (In fact, @code{list} may be any
 non-atomic expression, and successive parts are taken.)
 
-@example
-(%i1)  for f in [log, rho, atan] do ldisp(f(1))$
-(%t1)                                  0
-(%t2)                                rho(1)
-                                     %pi
-(%t3)                                 ---
-                                      4
+@c ===beg===
+@c for f in [log, rho, atan] do ldisp(f(1))$
+@c ev(%t3,numer);
+@c ===end===
+@example maxima
+@group
+(%i1) for f in [log, rho, atan] do ldisp(f(1))$
+(%t1)                           0
+
+(%t2)                        rho(1)
+
+                               %pi
+(%t3)                          ---
+                                4
+
+@end group
+@group
 (%i4) ev(%t3,numer);
-(%o4)                             0.78539816
+(%o4)                  0.7853981633974483
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -631,23 +686,21 @@ Example:
 
 The size of @code{U}, as determined by @code{ERROR-SIZE}, is 24.
 
-@example
+@example maxima
 (%i1) U: (C^D^E + B + A)/(cos(X-1) + 1)$
-
 (%i2) error_size: 20$
-
 (%i3) error ("Example expression is", U);
-
 Example expression is errexp1
- -- an error.  Quitting.  To debug this try debugmode(true);
+ -- an error. To debug this try: debugmode(true);
+@group
 (%i4) errexp1;
                             E
                            D
                           C   + B + A
 (%o4)                    --------------
                          cos(X - 1) + 1
+@end group
 (%i5) error_size: 30$
-
 (%i6) error ("Example expression is", U);
 
                          E
@@ -1118,11 +1171,17 @@ Recursively applies @var{f} to @var{expr}, in a top
 down manner.  This is most useful when complete factorization is
 desired, for example:
 
-@example
+@c ===beg===
+@c exp:(a^2+2*a+1)*y + x^2$
+@c scanmap(factor,exp);
+@c ===end===
+@example maxima
 (%i1) exp:(a^2+2*a+1)*y + x^2$
+@group
 (%i2) scanmap(factor,exp);
-                                    2      2
-(%o2)                         (a + 1)  y + x
+                                2      2
+(%o2)                    (a + 1)  y + x
+@end group
 @end example
 
 Note the way in which @code{scanmap} applies the given function
@@ -1131,20 +1190,30 @@ another form of @var{expr} is presented to @code{scanmap} then the
 result may be different.  Thus, @code{%o2} is not recovered when
 @code{scanmap} is applied to the expanded form of @code{exp}:
 
-@example
-(%i3) scanmap(factor,expand(exp));
-                           2                  2
-(%o3)                      a  y + 2 a y + y + x
+@c ===beg===
+@c scanmap(factor,expand(exp));
+@c ===end===
+@example maxima
+@group
+(%i1) scanmap(factor,expand(exp));
+(%o1)                          exp
+@end group
 @end example
 
 Here is another example of the way in which @code{scanmap} recursively
 applies a given function to all subexpressions, including exponents:
 
-@example
-(%i4) expr : u*v^(a*x+b) + c$
-(%i5) scanmap('f, expr);
-                    f(f(f(a) f(x)) + f(b))
-(%o5) f(f(f(u) f(f(v)                      )) + f(c))
+@c ===beg===
+@c expr : u*v^(a*x+b) + c$
+@c scanmap('f, expr);
+@c ===end===
+@example maxima
+(%i1) expr : u*v^(a*x+b) + c$
+@group
+(%i2) scanmap('f, expr);
+                        f(f(f(a) f(x)) + f(b))
+(%o2)    f(f(f(u) f(f(v)                      )) + f(c))
+@end group
 @end example
 
 @code{scanmap (@var{f}, @var{expr}, bottomup)} applies @var{f} to @var{expr} in a
commit c512abebcd2cd1b7191238d59a49106d1dd8deab
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 11:15:57 2025 -0700
    Regenerate existing examples
diff --git a/doc/info/Program.texi b/doc/info/Program.texi
index 791df771e..e0ee6b8b1 100644
--- a/doc/info/Program.texi
+++ b/doc/info/Program.texi
@@ -357,12 +357,16 @@ after the @code{do} terminates.
 @c for i: 1 while i <= 10 do s: s+i;
 @c s;
 @c ===end===
-@example
+@example maxima
 (%i1) s: 0$
+@group
 (%i2) for i: 1 while i <= 10 do s: s+i;
 (%o2)                         done
+@end group
+@group
 (%i3) s;
 (%o3)                          55
+@end group
 @end example
 
 Note that the condition @code{while i <= 10}
@@ -376,17 +380,21 @@ is equivalent to @code{unless i > 10} and also @code{thru 10}.
 @c      series: series + subst (x=0, term)*x^p)$
 @c series;
 @c ===end===
-@example
+@example maxima
 (%i1) series: 1$
 (%i2) term: exp (sin (x))$
+@group
 (%i3) for p: 1 unless p > 7 do
-          (term: diff (term, x)/p, 
-           series: series + subst (x=0, term)*x^p)$
+    (term: diff (term, x)/p,
+     series: series + subst (x=0, term)*x^p)$
+@end group
+@group
 (%i4) series;
                   7    6     5    4    2
                  x    x     x    x    x
 (%o4)            -- - --- - -- - -- + -- + x + 1
                  90   240   15   8    2
+@end group
 @end example
 
 which gives 8 terms of the Taylor series for @code{e^sin(x)}.
@@ -402,19 +410,25 @@ which gives 8 terms of the Taylor series for @code{e^sin(x)}.
 @c     (guess: subst (guess, x, 0.5*(x + 10/x)),
 @c     if abs (guess^2 - 10) < 0.00005 then return (guess));
 @c ===end===
-@example
+@example maxima
 (%i1) poly: 0$
+@group
 (%i2) for i: 1 thru 5 do
-          for j: i step -1 thru 1 do
-              poly: poly + i*x^j$
+    for j: i step -1 thru 1 do
+        poly: poly + i*x^j$
+@end group
+@group
 (%i3) poly;
                   5      4       3       2
 (%o3)          5 x  + 9 x  + 12 x  + 14 x  + 15 x
+@end group
 (%i4) guess: -3.0$
+@group
 (%i5) for i: 1 thru 10 do
-          (guess: subst (guess, x, 0.5*(x + 10/x)),
-           if abs (guess^2 - 10) < 0.00005 then return (guess));
+    (guess: subst (guess, x, 0.5*(x + 10/x)),
+    if abs (guess^2 - 10) < 0.00005 then return (guess));
 (%o5)                  - 3.162280701754386
+@end group
 @end example
 
 This example computes the negative square root of 10 using the
@@ -456,13 +470,17 @@ square-root of 5 using a poor initial guess.
 @c x;
 @c sqrt(5), numer;
 @c ===end===
-@example
+@example maxima
 (%i1) x: 1000$
 (%i2) thru 20 do x: 0.5*(x + 5.0/x)$
+@group
 (%i3) x;
 (%o3)                   2.23606797749979
+@end group
+@group
 (%i4) sqrt(5), numer;
 (%o4)                   2.23606797749979
+@end group
 @end example
 
 If it is desired one may even omit the termination conditions entirely
@@ -477,13 +495,19 @@ should be used to terminate execution of the @code{do}.
 @c sqr (x) := x^2 - 5.0$
 @c newton (sqr, 1000);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) newton (f, x):= ([y, df, dfx], df: diff (f ('x), 'x),
-          do (y: ev(df), x: x - f(x)/y, 
-              if abs (f (x)) < 5e-6 then return (x)))$
+    do (y: ev(df), x: x - f(x)/y,
+        if abs (f (x)) < 5e-6 then return (x)))$
+warning: parser: I'll let it stand, but (...) doesn't recognize local variables.
+warning: parser: did you mean to say: block([y, df, dfx], ...) ?
+@end group
 (%i2) sqr (x) := x^2 - 5.0$
+@group
 (%i3) newton (sqr, 1000);
-(%o3)                   2.236068027062195
+(%o3)                  2.2360680270621947
+@end group
 @end example
 
 @c DUNNO IF WE NEED THIS LEVEL OF DETAIL; THIS ARTICLE IS GETTING PRETTY LONG
@@ -691,24 +715,20 @@ value.  The global value of @code{errormsg} is always present.
 @c errormsg: false;
 @c sin(a,b);
 @c ===end===
-@example
+sin(y): expected exactly 1 arguments but got 2: [a, b]
+ -- an error. To debug this try: debugmode(true);
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) errormsg;
 (%o1)                         true
 @end group
-@group
 (%i2) sin(a,b);
-sin: wrong number of arguments.
- -- an error. To debug this try: debugmode(true);
-@end group
 @group
 (%i3) errormsg: false;
 (%o3)                         false
 @end group
-@group
 (%i4) sin(a,b);
- -- an error. To debug this try: debugmode(true);
-@end group
 @end example
 
 The option variable @code{errormsg} can not be set in a block to a local value.
@@ -721,17 +741,19 @@ The option variable @code{errormsg} can not be set in a block to a local value.
 @c errormsg:false;
 @c f(true);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) f(bool):=block([errormsg:bool],
                      print ("value of errormsg is",errormsg))$
+@end group
 @group
 (%i2) errormsg:true;
 (%o2)                         true
 @end group
 @group
 (%i3) f(false);
-value of errormsg is true 
-(%o3)                         true
+value of errormsg is false 
+(%o3)                         false
 @end group
 @group
 (%i4) errormsg:false;
@@ -739,8 +761,8 @@ value of errormsg is true
 @end group
 @group
 (%i5) f(true);
-value of errormsg is false 
-(%o5)                         false
+value of errormsg is true 
+(%o5)                         true
 @end group
 @end example
 
@@ -881,22 +903,28 @@ See also @mrefcomma{scanmap} @mrefcomma{maplist} @mrefcomma{outermap} @mref{matr
 @c map(ratsimp, x/(x^2+x)+(y^2+y)/y);
 @c map("=",[a,b],[-0.5,3]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) map(f,x+a*y+b*z);
-(%o1)                        f(b z) + f(a y) + f(x)
+(%o1)                f(b z) + f(a y) + f(x)
+@end group
+@group
 (%i2) map(lambda([u],partfrac(u,x)),x+1/(x^3+4*x^2+5*x+2));
-                           1       1        1
-(%o2)                     ----- - ----- + -------- + x
-                         x + 2   x + 1          2
-                                         (x + 1)
+                    1       1        1
+(%o2)             ----- - ----- + -------- + x
+                  x + 2   x + 1          2
+                                  (x + 1)
+@end group
+@group
 (%i3) map(ratsimp, x/(x^2+x)+(y^2+y)/y);
-                                      1
-(%o3)                            y + ----- + 1
-                                    x + 1
+                                1
+(%o3)                     y + ----- + 1
+                              x + 1
+@end group
+@group
 (%i4) map("=",[a,b],[-0.5,3]);
-(%o4)                          [a = - 0.5, b = 3]
-
-
+(%o4)                  [a = - 0.5, b = 3]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1037,7 +1065,7 @@ statement from C.
 @c     return(10)
 @c  );
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) for i:1 thru 10 do o:i;
 (%o1)                         done
@@ -1057,6 +1085,7 @@ statement from C.
     );
 (%o3)                           8
 @end group
+@group
 (%i4) block([i],
     i:4,
     block([o],
@@ -1067,6 +1096,7 @@ statement from C.
     return(10)
  );
 (%o4)                           4
+@end group
 @end example
 
 
@@ -1196,7 +1226,7 @@ To show the argument combinations more clearly, @code{F} is left undefined.
 @c outermap (F, [a, b], matrix ([1, 2]), matrix ([x], [y]));
 @c outermap ("+", [a, b, c], [1, 2, 3]);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) outermap (F, [a, b, c], [1, 2, 3]);
 (%o1) [[F(a, 1), F(a, 2), F(a, 3)], [F(b, 1), F(b, 2), F(b, 3)], 
@@ -1252,7 +1282,7 @@ and each element of each list is a matrix.
 @c [op (arg_1), op (arg_2), op (arg_3)];
 @c [op (xx_0), op (xx_1), op (xx_2)];
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) arg_1 :  matrix ([a, b], [c, d]);
                             [ a  b ]
@@ -1267,6 +1297,7 @@ and each element of each list is a matrix.
 (%i3) arg_3 : matrix ([xx, yy]);
 (%o3)                      [ xx  yy ]
 @end group
+@group
 (%i4) xx_0 : outermap (lambda ([x, y, z], x / y + z), arg_1,
                                                    arg_2, arg_3);
                [  [      a        a  ]  [      a        a  ]  ]
@@ -1283,6 +1314,7 @@ and each element of each list is a matrix.
                  [  [      d        d  ]  [      d        d  ]  ]
                  [ [[ xx + --  yy + -- ], [ xx + --  yy + -- ]] ]
                  [  [      11       11 ]  [      22       22 ]  ]
+@end group
 @group
 (%i5) xx_1 : xx_0 [1][1];
            [      a        a  ]  [      a        a  ]
@@ -1321,7 +1353,7 @@ while @code{cartesian_product} does not.
 @c                      cartesian_product ({a, b, c}, {1, 2, 3}));
 @c is (equal (%, %th (2)));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) outermap (F, [a, b, c], [1, 2, 3]);
 (%o1) [[F(a, 1), F(a, 2), F(a, 3)], [F(b, 1), F(b, 2), F(b, 3)], 
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 18:03:26
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  3fdfcfd0563524a67e363d76bcad56b82b44d9d7 (commit)
       via  857db113bba92dee7754a4026d3e857ac7324e72 (commit)
      from  ffd525682aa10ed68b072c21f558b0d519ff9740 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
 doc/info/Function.texi | 221 +++++++++++++++++++++++--------------------------
 1 file changed, 104 insertions(+), 117 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 18:02:09
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-function-update-examples has been created
        at  3fdfcfd0563524a67e363d76bcad56b82b44d9d7 (commit)
- Log -----------------------------------------------------------------
commit 3fdfcfd0563524a67e363d76bcad56b82b44d9d7
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 11:00:40 2025 -0700
    Mark various examples as maxima code
    
    Some of the `@example` blocks aren't examples of maxima running, but
    they are examples of Maxima code.  Change them to `@example maxima` so
    they are highlighted (when enabled) as Maxima code.
diff --git a/doc/info/Function.texi b/doc/info/Function.texi
index ed7338025..ae3a09fdb 100644
--- a/doc/info/Function.texi
+++ b/doc/info/Function.texi
@@ -29,7 +29,7 @@
 To define a function in Maxima you use the @code{:=} operator.
 E.g.
 
-@example
+@example maxima
 f(x) := sin(x)
 @end example
 
@@ -38,7 +38,7 @@ defines a function @code{f}.
 Anonymous functions may also be created using @code{lambda}.
 For example
 
-@example
+@example maxima
 lambda ([i, j], ...)
 @end example
 
@@ -46,7 +46,7 @@ lambda ([i, j], ...)
 can be used instead of @code{f}
 where
 
-@example
+@example maxima
 f(i,j) := block ([], ...);
 map (lambda ([i], i+1), l)
 @end example
@@ -86,7 +86,7 @@ arguments:
 The right hand side of a function is an expression.  Thus
 if you want a sequence of expressions, you do
 
-@example
+@example maxima
 f(x) := (expr1, expr2, ...., exprn);
 @end example
 
@@ -95,7 +95,7 @@ and the value of @var{exprn} is what is returned by the function.
 If you wish to make a @code{return} from some expression inside the
 function then you must use @code{block} and @code{return}.
 
-@example
+@example maxima
 block ([], expr1, ..., if (a > 10) then return(a), ..., exprn)
 @end example
 
@@ -120,7 +120,7 @@ you had used @code{c: a} in the above, the value of @code{c} would
 have been the value of @code{a} at the time you just entered the block,
 but before @code{a} was bound.  Thus doing something like
 
-@example
+@example maxima
 block ([a: a], expr1, ... a: a+3, ..., exprn)
 @end example
 
@@ -135,20 +135,20 @@ session.
 The actual arguments to a function are treated in exactly same way as
 the variables in a block.  Thus in
 
-@example
+@example maxima
 f(x) := (expr1, ..., exprn);
 @end example
 
 and
 
-@example
+@example maxima
 f(1);
 @end example
 
 we would have a similar context for evaluation of the expressions
 as if we had done
 
-@example
+@example maxima
 block ([x: 1], expr1, ..., exprn)
 @end example
 
@@ -826,7 +826,7 @@ beginning of the @code{block} command may be omitted.
 In this case if neither @mref{return} nor @mref{go} are used
 @code{block} behaves similar to the following construct:
 
-@example
+@example maxima
 ( expr_1, expr_2,... , expr_n );
 @end example
 
@@ -2384,12 +2384,12 @@ any              any kind of object (useful for arrays of any)
 
 A function parameter named @code{a} can be declared as an array filled with elements
 of the type @code{t} the following way:
-@example
+@example maxima
 mode_declare (a, array(t, dim1, dim2, ...))
 @end example
 If none of the elements of the array @code{a} needs to be checked if it still doesn't
 contain a value additional code can be omitted by declaring this fact, too:
-@example
+@example maxima
 mode_declare (a, array (t, complete, dim1, dim2, ...))
 @end example
 The @code{complete} has no effect if all array elements are of the type
@@ -2398,13 +2398,13 @@ The @code{complete} has no effect if all array elements are of the type
 
 Another way to tell that all entries of the array @code{a} are of the type
 (``mode'') @code{m} and have been assigned a value to would be:
-@example
+@example maxima
 mode_declare (completearray (a), m))
 @end example
 
 Numeric code using arrays might run faster still if the size of the array is
 known at compile time, as well, as in:
-@example
+@example maxima
 mode_declare (completearray (a [10, 10]), float)
 @end example
 for a floating point number array named @code{a} which is 10 x 10.
@@ -2412,7 +2412,7 @@ for a floating point number array named @code{a} which is 10 x 10.
 @code{mode_declare} also can be used in order to declare the type of the result
 of a function. In this case the function compilation needs to be preceded by
 another @code{mode_declare} statement. For example the expression,
-@example
+@example maxima
 mode_declare ([function (f_1, f_2, ...)], fixnum)
 @end example
 declares that the values returned by @code{f_1}, @code{f_2}, @dots{} are
@@ -2570,7 +2570,7 @@ If you knew that @code{first (l)} returned a number then you could write
 @end example
 However, if you need this construct more often it would be more efficient
 to define a function that returns a number fist:
-@example
+@example maxima
 firstnumb (x) ::= buildq ([x], mode_identity (number, first(x)));
 compile(firstnumb)
 @end example
@@ -2643,7 +2643,7 @@ user-defined functions.
 Functions to be translated should include a call to @code{mode_declare} at the
 beginning when possible in order to produce more efficient code.  For example:
 
-@example
+@example maxima
 f (x_1, x_2, ...) := block ([v_1, v_2, ...],
     mode_declare (v_1, mode_1, v_2, mode_2, ...), ...)
 @end example
@@ -2946,7 +2946,7 @@ non-terminating optimization properties.
 @anchor{tr_state_vars}
 @defvr {System variable} tr_state_vars
 Default value:
-@example
+@example maxima
 [translate_fast_arrays, tr_function_call_default, tr_bound_function_applyp,
 tr_array_as_ref, tr_numer, tr_float_can_branch_complex, define_variable]
 @end example
commit 857db113bba92dee7754a4026d3e857ac7324e72
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 08:11:58 2025 -0700
    Regenerate existing examples
diff --git a/doc/info/Function.texi b/doc/info/Function.texi
index ba06c64e8..ed7338025 100644
--- a/doc/info/Function.texi
+++ b/doc/info/Function.texi
@@ -64,15 +64,23 @@ arguments:
 @c f (a, b, [u]) := [a, b, u];
 @c f (1, 2, 3, 4, 5, 6);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) f ([u]) := u;
 (%o1)                      f([u]) := u
+@end group
+@group
 (%i2) f (1, 2, 3, 4);
 (%o2)                     [1, 2, 3, 4]
+@end group
+@group
 (%i3) f (a, b, [u]) := [a, b, u];
 (%o3)               f(a, b, [u]) := [a, b, u]
+@end group
+@group
 (%i4) f (1, 2, 3, 4, 5, 6);
 (%o4)                 [1, 2, [3, 4, 5, 6]]
+@end group
 @end example
 
 The right hand side of a function is an expression.  Thus
@@ -200,26 +208,26 @@ considerably.
 @c a[1];
 @c a[1];
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) showtime:true$
-Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes.
+Evaluation took 0.0000 seconds (0.0000 elapsed) using 32 bytes.
 @end group
 @group
 (%i2) a[x]:=float(sum(sin(x*t),t,1,10000));
-Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes.
+Evaluation took 0.0000 seconds (0.0000 elapsed) using 288 bytes.
 (%o2)        a  := float(sum(sin(x t), t, 1, 10000))
               x
 @end group
 @group
 (%i3) a[1];
-Evaluation took 5.1250 seconds (5.1260 elapsed) using 775.250 MB.
-(%o3)                   1.633891021792447
+Evaluation took 4.6100 seconds (4.6300 elapsed) using 455.060 MB.
+(%o3)                  1.6338910217924467
 @end group
 @group
 (%i4) a[1];
-Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes.
-(%o4)                   1.633891021792447
+Evaluation took 0.0000 seconds (0.0000 elapsed) using 24 bytes.
+(%o4)                  1.6338910217924467
 @end group
 @end example
 
@@ -234,7 +242,7 @@ for values that are already cached:
 @c a[1];
 @c a[2];
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) a[x]:=b*x;
 (%o1)                       a  := b x
@@ -308,7 +316,7 @@ The resulting expression is not evaluated until the explicit evaluation
 @c buildq ([a: x, b], a + b + c);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 (%i1) (a: 17, b: 29, c: 1729)$
 @group
 (%i2) buildq ([a: x, b], a + b + c);
@@ -327,7 +335,7 @@ The resulting expression is not evaluated until the explicit evaluation
 @c buildq ([e: [a, b, c]], foo (x, e, y));
 @c buildq ([e: [a, b, c]], bar (x, splice (e), y));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) buildq ([e: [a, b, c]], foo (x, e, y));
 (%o1)                 foo(x, [a, b, c], y)
@@ -345,7 +353,7 @@ before substitution, these two results would be the same.
 @c buildq ([e: [a, b, c]], splice (e) + splice (e));
 @c buildq ([e: [a, b, c]], 2 * splice (e));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) buildq ([e: [a, b, c]], splice (e) + splice (e));
 (%o1)                    2 c + 2 b + 2 a
@@ -369,7 +377,7 @@ which carries out substitutions sequentially.
 @c subst ([u=v, v=w, w=x, x=y, y=z, z=u], 
 @c              bar (u, v, w, x, y, z));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) buildq ([a: b, b: a], foo (a, b));
 (%o1)                       foo(b, a)
@@ -396,7 +404,7 @@ shows the expression returned by @code{show_values}.
 @c show_values (a, b, c - a - b);
 @c macroexpand (show_values (a, b, c - a - b));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) show_values ([L]) ::= buildq ([L], map ("=", 'L, L));
 (%o1)   show_values([L]) ::= buildq([L], map("=", 'L, L))
@@ -421,7 +429,7 @@ create another function for which some of the arguments are fixed.
 @c by3 : curry ("*", 3);
 @c by3 (a + b);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) curry (f, [a]) :=
         buildq ([f, a], lambda ([[x]], apply (f, append (a, x))))$
@@ -467,7 +475,7 @@ Examples
 @c macroexpand (h (y));
 @c h (y);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) g (x) ::= x / 99;
                                     x
@@ -527,7 +535,7 @@ Examples
 @c macroexpand1 (h (y));
 @c h (y);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) g (x) ::= x / 99;
                                     x
@@ -605,7 +613,7 @@ Examples
 @c matchfix ("<>", "<>");
 @c buildq ([x: [1, %pi, z - y]], "<>" (splice (x)));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) buildq ([x: [1, %pi, z - y]], foo (splice (x)) / length (x));
                        foo(1, %pi, z - y)
@@ -668,7 +676,7 @@ Here @code{min} and @code{"+"} are applied to a list @code{L}.
 @c apply (min, L);
 @c apply ("+", L);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) L : [1, 5, -10.2, 4, 3];
 (%o1)                 [1, 5, - 10.2, 4, 3]
@@ -679,7 +687,7 @@ Here @code{min} and @code{"+"} are applied to a list @code{L}.
 @end group
 @group
 (%i3) apply ("+", L);
-(%o3)                         2.80000000
+(%o3)                  2.8000000000000007
 @end group
 @end example
 
@@ -694,7 +702,9 @@ but we can ensure the evaluation of the argument via @code{apply}.
 @c dispfun (fname);
 @c apply (dispfun, [fname]);
 @c ===end===
-@example
+fundef: no such function: fname
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) F (x) := x / 1729;
                                    x
@@ -713,11 +723,7 @@ but we can ensure the evaluation of the argument via @code{apply}.
 
 (%o3)                         [%t3]
 @end group
-@group
 (%i4) dispfun (fname);
-fundef: no such function: fname
- -- an error. To debug this try: debugmode(true);
-@end group
 @group
 (%i5) apply (dispfun, [fname]);
                                    x
@@ -736,10 +742,10 @@ Second example: create a function that declares all of its arguments to be compl
 @c g(a,b,c)$
 @c facts();
 @c ===end===
-@example
-@group
-(%i1) g([u]) := apply('declare,[u,complex])$
+@example maxima
+(%i1) g([u]):=apply('declare,[u,complex])$
 (%i2) g(a,b,c)$
+@group
 (%i3) facts();
 (%o3) [kind(a, complex), kind(b, complex), kind(c, complex)]
 @end group
@@ -756,7 +762,9 @@ Note that @code{demoivre} is the name of a global variable and also a function.
 @c apply (demoivre, [exp (%i * x)]);
 @c apply ('demoivre, [exp (%i * x)]);
 @c ===end===
-@example
+apply: found false where a function was expected.
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) demoivre;
 (%o1)                         false
@@ -765,11 +773,7 @@ Note that @code{demoivre} is the name of a global variable and also a function.
 (%i2) demoivre (exp (%i * x));
 (%o2)                  %i sin(x) + cos(x)
 @end group
-@group
 (%i3) apply (demoivre, [exp (%i * x)]);
-apply: found false where a function was expected.
- -- an error. To debug this try: debugmode(true);
-@end group
 @group
 (%i4) apply ('demoivre, [exp (%i * x)]);
 (%o4)                  %i sin(x) + cos(x)
@@ -784,7 +788,7 @@ Convert a nested list into a matrix by calling @code{apply}.
 @c a:[[1,2],[3,4]];
 @c apply(matrix,a);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) a:[[1,2],[3,4]];
 (%o1)                   [[1, 2], [3, 4]]
@@ -913,13 +917,17 @@ If the evaluation of the arguments does not lead to the evaluation of any
 @c g ([1, 2, 3, 7]);
 @c g ([1, 2, -3, 7]);
 @c ===end===
-@example
+@example maxima
 (%i1) lambda ([x], if x < 0 then throw(x) else f(x))$
 (%i2) g(l) := catch (map (''%, l))$
+@group
 (%i3) g ([1, 2, 3, 7]);
 (%o3)               [f(1), f(2), f(3), f(7)]
+@end group
+@group
 (%i4) g ([1, 2, -3, 7]);
 (%o4)                          - 3
+@end group
 @end example
 
 @c REWORD THIS PART.
@@ -1063,7 +1071,7 @@ Examples:
 @c F2 (x, y) := expr;
 @c F2 (a, b);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) expr : cos(y) - sin(x);
 (%o1)                    cos(y) - sin(x)
@@ -1093,7 +1101,7 @@ The function defined by @code{define} may be an ordinary Maxima function or a
 @c define (G1 (x, y), x.y - y.x);
 @c define (G2 [x, y], x.y - y.x);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) define (G1 (x, y), x.y - y.x);
 (%o1)               G1(x, y) := x . y - y . x
@@ -1112,7 +1120,7 @@ the function defined by @code{define} accepts a variable number of arguments.
 @c define (H ([L]), '(apply ("+", L)));
 @c H (a, b, c);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) define (H ([L]), '(apply ("+", L)));
 (%o1)                H([L]) := apply("+", L)
@@ -1134,7 +1142,7 @@ When the first argument is an expression with operator @code{funmake},
 @c define (foo (x, y), bar (y, x));
 @c define (ev (foo (x, y)), sin(x) - cos(y));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) [F : I, u : x];
 (%o1)                        [I, x]
@@ -1233,7 +1241,10 @@ Examples:
 @c foo: %pi;
 @c foo;
 @c ===end===
-@example
+translator: foo was declared with mode boolean
+                                          , but it has value: %pi
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) define_variable (foo, true, boolean);
 (%o1)                         true
@@ -1246,12 +1257,7 @@ Examples:
 (%i3) foo: false;
 (%o3)                         false
 @end group
-@group
 (%i4) foo: %pi;
-translator: foo was declared with mode boolean
-                                          , but it has value: %pi
- -- an error. To debug this try: debugmode(true);
-@end group
 @group
 (%i5) foo;
 (%o5)                         false
@@ -1269,7 +1275,9 @@ translator: foo was declared with mode boolean
 @c bar: 1440;
 @c bar;
 @c ===end===
-@example
+1440 is not prime.
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) define_variable (bar, 2, integer);
 (%o1)                           2
@@ -1290,9 +1298,7 @@ translator: foo was declared with mode boolean
 @end group
 @group
 (%i5) bar: 1440;
-1440 is not prime.
 #0: prime_test(y=1440)
- -- an error. To debug this try: debugmode(true);
 @end group
 @group
 (%i6) bar;
@@ -1313,7 +1319,9 @@ The mode @code{any_check} is like @code{any}, but @code{any_check} enables the
 @c baz_quux: sqrt(2);
 @c baz_quux;
 @c ===end===
-@example
+Cannot assign to `baz_quux'.
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) define_variable (baz_quux, 'baz_quux, any_check);
 (%o1)                       baz_quux
@@ -1335,10 +1343,7 @@ The mode @code{any_check} is like @code{any}, but @code{any_check} enables the
 @end group
 @group
 (%i5) baz_quux: sqrt(2);
-Cannot assign to `baz_quux'.
-#0: lambda([y],if y # 'baz_quux then
-            error("Cannot assign to `baz_quux'."))(y=sqrt(2))
- -- an error. To debug this try: debugmode(true);
+#0: lambda([y],if y # 'baz_quux then error("Cannot assign to `baz_quux'."))(y=sqrt(2))
 @end group
 @group
 (%i6) baz_quux;
@@ -1391,7 +1396,7 @@ Examples:
 @c dispfun (m, f, g, h, h[5], h[10], i[8]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) m(x, y) ::= x^(-y);
                                      - y
@@ -1488,7 +1493,7 @@ Examples:
 @c fullmap (g, %);
 @c map (g, %th(2));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) a + b * c;
 (%o1)                        b c + a
@@ -1521,7 +1526,7 @@ Example:
 @c ===beg===
 @c fullmapl ("+", [3, [4, 5]], [[a, 1], [0, -1.5]]);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) fullmapl ("+", [3, [4, 5]], [[a, 1], [0, -1.5]]);
 (%o1)                [[a + 3, 4], [4, 3.5]]
@@ -1565,7 +1570,7 @@ Examples:
 @c functions;
 @c arrays;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) F_1 (x) := x - 100;
 (%o1)                   F_1(x) := x - 100
@@ -1677,7 +1682,7 @@ Examples:
 @c funmake (F, [a + 1, b + 1]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) F (x, y) := y^2 - x^2;
                                    2    2
@@ -1701,7 +1706,7 @@ Examples:
 @c funmake (G, [u]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) G (x) ::= (x - 1)/2;
                                   x - 1
@@ -1729,7 +1734,7 @@ Examples:
 @c funmake ('(H [n]), [%e]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) H [a] (x) := (x - 1)^a;
                                         a
@@ -1764,7 +1769,7 @@ Examples:
 @c funmake (A, [u]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) funmake (A, [u]);
 (%o1)                         A(u)
@@ -1784,7 +1789,7 @@ Examples:
 @c funmake (f, [x, y, z]);
 @c ''%;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) det(a,b,c) := b^2 -4*a*c;
                                     2
@@ -1813,7 +1818,7 @@ Maxima simplifies @code{funmake}'s return value.
 @c ===beg===
 @c funmake (sin, [%pi / 2]);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) funmake (sin, [%pi / 2]);
 (%o1)                           1
@@ -1875,7 +1880,7 @@ function.
 @c f: lambda ([x], x^2);
 @c f(a);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) f: lambda ([x], x^2);
                                       2
@@ -1898,7 +1903,7 @@ A lambda expression may appear in contexts in which a function evaluation is exp
 @c apply (lambda ([x], x^2), [a]);
 @c map (lambda ([x], x^2), [a, b, c, d, e]);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) lambda ([x], x^2) (a);
                                 2
@@ -1934,7 +1939,7 @@ unless some special evaluation is forced by some means, such as @code{'@w{}'}.
 @c b: %e$
 @c g2(1/2);
 @c ===end===
-@example
+@example maxima
 (%i1) a: %pi$
 (%i2) b: %e$
 @group
@@ -1972,7 +1977,7 @@ variables of the same names.
 @c h: lambda ([a, b], h2: lambda ([a], a*b), h2(1/2));
 @c h(%pi, %gamma);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) h: lambda ([a, b], h2: lambda ([a], a*b), h2(1/2));
                                                    1
@@ -2001,7 +2006,7 @@ via @code{buildq}, as in lambda expression @code{i2} below.
 @c i2(1/2);
 @c i2(1/2)(%pi);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) i: lambda ([a], lambda ([x], a*x));
 (%o1)             lambda([a], lambda([x], a x))
@@ -2041,7 +2046,7 @@ The arguments appear within the function body as a list.
 @c g : lambda ([[aa]], apply ("+", aa));
 @c g (17, 29, x, y, z, %e);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) f : lambda ([aa, bb, [cc]], aa * cc + bb);
 (%o1)          lambda([aa, bb, [cc]], aa cc + bb)
@@ -2100,7 +2105,7 @@ A local function definition.
 @c block (local (foo), foo (x) := 2 * x, foo (100));
 @c foo (100);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) foo (x) := 1 - x;
 (%o1)                    foo(x) := 1 - x
@@ -2173,7 +2178,7 @@ and the calling expression is not modified.
 @c dispfun (f);
 @c f (a * b);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) f (x) := h (x) / g (x);
                                   h(x)
@@ -2237,7 +2242,7 @@ and the calling expression is not modified.
 @c dispfun (f);
 @c f (a * b);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) f (x) := h (x) / g (x);
                                   h(x)
@@ -2299,7 +2304,7 @@ and the calling expression is modified.
 @c dispfun (f);
 @c f (a * b);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) f (x) := h (x) / g (x);
                                   h(x)
@@ -2433,7 +2438,7 @@ Example:
 @c compile(square_float);
 @c square_float(100.0);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) square_float(f):=(
      mode_declare(f,float),
@@ -2482,39 +2487,21 @@ the code was compiled to deal with.
 @c      square(2.3);
 @c      square(4);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) mode_checkp:true;
 (%o1)                         true
 @end group
 @group
 (%i2) square(f):=(
-    mode_declare(f,float),
-    f^2);
+         mode_declare(f,float),
+         f^2);
+     compile(square);
+     square(2.3);
+     square(4);
                                                    2
 (%o2)       square(f) := (mode_declare(f, float), f )
 @end group
-@group
-(%i3) compile(square);
-(%o3)                       [square]
-@end group
-@group
-(%i4) square(2.3);
-(%o4)                   5.289999999999999
-@end group
-@group
-(%i5) square(4);
-Maxima encountered a Lisp error:
-
- The value
-   4
- is not of type
-   DOUBLE-FLOAT
- when binding $F
-
-Automatically continuing.
-To enable the Lisp debugger set *debugger-hook* to nil.
-@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2844,7 +2831,7 @@ For example, if @code{g} is defined by @code{g(f,x) := f(x+1)} then translating
 @c translate (g)$
 @c g (lambda ([x], x));
 @c ===end===
-@example
+@example maxima
 (%i1) f (x) := x^2$
 (%i2) g (f) := f (3)$
 (%i3) tr_bound_function_applyp : true$
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 15:04:50
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  ffd525682aa10ed68b072c21f558b0d519ff9740 (commit)
      from  9e04c6b75b7efd03f261f2073f6b31759d15dbe7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ffd525682aa10ed68b072c21f558b0d519ff9740
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 08:04:20 2025 -0700
    Regenerate examples
diff --git a/doc/info/nset.texi b/doc/info/nset.texi
index 510e4443b..ea5979ca2 100644
--- a/doc/info/nset.texi
+++ b/doc/info/nset.texi
@@ -39,23 +39,39 @@ once, simplification eliminates the redundant member.
 @c {a, {b}};
 @c {a, [b]};
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) set();
 (%o1)                          @{@}
+@end group
+@group
 (%i2) set(a, b, a);
 (%o2)                        @{a, b@}
+@end group
+@group
 (%i3) set(a, set(b));
 (%o3)                       @{a, @{b@}@}
+@end group
+@group
 (%i4) set(a, [b]);
 (%o4)                       @{a, [b]@}
+@end group
+@group
 (%i5) @{@};
 (%o5)                          @{@}
+@end group
+@group
 (%i6) @{a, b, a@};
 (%o6)                        @{a, b@}
+@end group
+@group
 (%i7) @{a, @{b@}@};
 (%o7)                       @{a, @{b@}@}
+@end group
+@group
 (%i8) @{a, [b]@};
 (%o8)                       @{a, [b]@}
+@end group
 @end example
 
 Two would-be elements @var{x} and @var{y} are redundant
@@ -78,35 +94,53 @@ in that case the elements @var{x} and @var{y} are considered distinct.
 @c ratsimp (%);
 @c {x, y, z};
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) x: a/c + b/c;
                               b   a
 (%o1)                         - + -
                               c   c
+@end group
+@group
 (%i2) y: a/c + b/c;
                               b   a
 (%o2)                         - + -
                               c   c
+@end group
+@group
 (%i3) z: (a + b)/c;
                               b + a
 (%o3)                         -----
                                 c
+@end group
+@group
 (%i4) is (x = y);
 (%o4)                         true
+@end group
+@group
 (%i5) is (y = z);
 (%o5)                         false
+@end group
+@group
 (%i6) is (equal (y, z));
 (%o6)                         true
+@end group
+@group
 (%i7) y - z;
                            b + a   b   a
 (%o7)                    - ----- + - + -
                              c     c   c
+@end group
+@group
 (%i8) ratsimp (%);
 (%o8)                           0
+@end group
+@group
 (%i9) @{x, y, z@};
                           b + a  b   a
 (%o9)                    @{-----, - + -@}
                             c    c   c
+@end group
 @end example
 
 To construct a set from the elements of a list, use @code{setify}.
@@ -114,9 +148,11 @@ To construct a set from the elements of a list, use @code{setify}.
 @c ===beg===
 @c setify ([b, a]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) setify ([b, a]);
 (%o1)                        @{a, b@}
+@end group
 @end example
 
 Set members @code{x} and @code{y} are equal provided @code{is(x = y)} 
@@ -126,9 +162,11 @@ members; consequently,
 @c ===beg===
 @c {x, rat(x)};
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) @{x, rat(x)@};
 (%o1)                          @{x@}
+@end group
 @end example
 
 Further, since @code{is((x - 1)*(x + 1) = x^2 - 1)} evaluates to @code{false}, 
@@ -137,10 +175,12 @@ Further, since @code{is((x - 1)*(x + 1) = x^2 - 1)} evaluates to @code{false},
 @c ===beg===
 @c {(x - 1)*(x + 1), x^2 - 1};
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) @{(x - 1)*(x + 1), x^2 - 1@};
                                        2
 (%o1)               @{(x - 1) (x + 1), x  - 1@}
+@end group
 @end example
 
 To reduce this set to a singleton set, apply @code{rat} to each set member:
@@ -149,13 +189,17 @@ To reduce this set to a singleton set, apply @code{rat} to each set member:
 @c {(x - 1)*(x + 1), x^2 - 1};
 @c map (rat, %);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) @{(x - 1)*(x + 1), x^2 - 1@};
                                        2
 (%o1)               @{(x - 1) (x + 1), x  - 1@}
+@end group
+@group
 (%i2) map (rat, %);
                               2
 (%o2)/R/                    @{x  - 1@}
+@end group
 @end example
 
 To remove redundancies from other sets, you may need to use other
@@ -165,12 +209,16 @@ simplification functions. Here is an example that uses @code{trigsimp}:
 @c {1, cos(x)^2 + sin(x)^2};
 @c map (trigsimp, %);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) @{1, cos(x)^2 + sin(x)^2@};
                             2         2
 (%o1)                @{1, sin (x) + cos (x)@}
+@end group
+@group
 (%i2) map (trigsimp, %);
 (%o2)                          @{1@}
+@end group
 @end example
 
 A set is simplified when its members are non-redundant and
@@ -187,14 +235,20 @@ re-simplification; for example,
 @c subst ([a=x, b=x, c=x], s);
 @c map (lambda ([x], x^2), set (-1, 0, 1));
 @c ===end===
-@example
+@example maxima
 (%i1) s: @{a, b, c@}$
+@group
 (%i2) subst (c=a, s);
 (%o2)                        @{a, b@}
+@end group
+@group
 (%i3) subst ([a=x, b=x, c=x], s);
 (%o3)                          @{x@}
+@end group
+@group
 (%i4) map (lambda ([x], x^2), set (-1, 0, 1));
 (%o4)                        @{0, 1@}
+@end group
 @end example
 
 Maxima treats lists and sets as distinct objects;
@@ -207,12 +261,14 @@ to a set. Thus
 @c union ([1, 2], {a, b});
 @c union (setify ([1, 2]), {a, b});
 @c ===end===
-@example
+union: argument must be a set; found: [1,2]
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 (%i1) union ([1, 2], @{a, b@});
-Function union expects a set, instead found [1,2]
- -- an error.  Quitting.  To debug this try debugmode(true);
+@group
 (%i2) union (setify ([1, 2]), @{a, b@});
 (%o2)                     @{1, 2, a, b@}
+@end group
 @end example
 
 To extract all set elements of a set @code{s} that satisfy a predicate
@@ -224,10 +280,12 @@ in a given set that do not depend on a variable @code{z}, use
 @c subset ({x + y + z, x - y + 4, x + y - 5}, 
 @c                                     lambda ([e], freeof (z, e)));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) subset (@{x + y + z, x - y + 4, x + y - 5@},
                                     lambda ([e], freeof (z, e)));
 (%o1)               @{- y + x + 4, y + x - 5@}
+@end group
 @end example
 
 The section @ref{Functions and Variables for Sets} has a complete list of
@@ -245,9 +303,11 @@ There two ways to to iterate over set members. One way is the use
 @c ===beg===
 @c map (f, {a, b, c});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) map (f, @{a, b, c@});
 (%o1)                  @{f(a), f(b), f(c)@}
+@end group
 @end example
 
 The other way is to use @code{for @var{x} in @var{s} do}
@@ -256,14 +316,18 @@ The other way is to use @code{for @var{x} in @var{s} do}
 @c s: {a, b, c};
 @c for si in s do print (concat (si, 1));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) s: @{a, b, c@};
 (%o1)                       @{a, b, c@}
+@end group
+@group
 (%i2) for si in s do print (concat (si, 1));
 a1 
 b1 
 c1 
 (%o2)                         done
+@end group
 @end example
 
 The Maxima functions @code{first} and @code{rest} work
@@ -310,11 +374,15 @@ Examples:
 @c adjoin (c, {a, b});
 @c adjoin (a, {a, b});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) adjoin (c, @{a, b@});
 (%o1)                       @{a, b, c@}
+@end group
+@group
 (%i2) adjoin (a, @{a, b@});
 (%o2)                        @{a, b@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -345,14 +413,20 @@ Examples:
 @c is (cardinality (set_partitions ({1, 2, 3, 4, 5, 6})) = 
 @c                        belln (6));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) makelist (belln (i), i, 0, 6);
 (%o1)               [1, 1, 2, 5, 15, 52, 203]
+@end group
+@group
 (%i2) is (cardinality (set_partitions (@{@})) = belln (0));
 (%o2)                         true
+@end group
+@group
 (%i3) is (cardinality (set_partitions (@{1, 2, 3, 4, 5, 6@})) =
                        belln (6));
 (%o3)                         true
+@end group
 @end example
 
 @code{belln} applied to arguments which are not nonnegative integers.
@@ -360,9 +434,11 @@ Examples:
 @c ===beg===
 @c [belln (x), belln (sqrt(3)), belln (-9)];
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) [belln (x), belln (sqrt(3)), belln (-9)];
 (%o1)        [belln(x), belln(sqrt(3)), belln(- 9)]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -387,15 +463,23 @@ Examples:
 @c simp : false;
 @c cardinality ({a, a, b, c});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) cardinality (@{@});
 (%o1)                           0
+@end group
+@group
 (%i2) cardinality (@{a, a, b, c@});
 (%o2)                           3
+@end group
+@group
 (%i3) simp : false;
 (%o3)                         false
+@end group
+@group
 (%i4) cardinality (@{a, a, b, c@});
 (%o4)                           3
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -422,15 +506,23 @@ Examples:
 @c cartesian_product ({x}, {y}, {z});
 @c cartesian_product ({x}, {-1, 0, 1});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) cartesian_product (@{0, 1@});
 (%o1)                      @{[0], [1]@}
+@end group
+@group
 (%i2) cartesian_product (@{0, 1@}, @{0, 1@});
 (%o2)           @{[0, 0], [0, 1], [1, 0], [1, 1]@}
+@end group
+@group
 (%i3) cartesian_product (@{x@}, @{y@}, @{z@});
 (%o3)                      @{[x, y, z]@}
+@end group
+@group
 (%i4) cartesian_product (@{x@}, @{-1, 0, 1@});
 (%o4)              @{[x, - 1], [x, 0], [x, 1]@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -484,18 +576,28 @@ Examples:
 @c cartesian_product_list ([x], [-1, 0, 1]);
 @c cartesian_product_list ([a, h, e], [c, b, 4]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) cartesian_product_list ([0, 1]);
 (%o1)                      [[0], [1]]
+@end group
+@group
 (%i2) cartesian_product_list ([0, 1], [0, 1]);
 (%o2)           [[0, 0], [0, 1], [1, 0], [1, 1]]
+@end group
+@group
 (%i3) cartesian_product_list ([x], [y], [z]);
 (%o3)                      [[x, y, z]]
+@end group
+@group
 (%i4) cartesian_product_list ([x], [-1, 0, 1]);
 (%o4)              [[x, - 1], [x, 0], [x, 1]]
+@end group
+@group
 (%i5) cartesian_product_list ([a, h, e], [c, b, 4]);
 (%o5) [[a, c], [a, b], [a, 4], [h, c], [h, b], [h, 4], [e, c], 
                                                   [e, b], [e, 4]]
+@end group
 @end example
 
 The order of the list returned by @code{cartesian_product_list}
@@ -504,12 +606,13 @@ may be summarized by saying the lesser indices vary more slowly than the greater
 @c ===beg===
 @c cartesian_product_list ([1, 2, 3], [a, b], [i, ii]);
 @c ===end===
-
-@example
+@example maxima
+@group
 (%i1) cartesian_product_list ([1, 2, 3], [a, b], [i, ii]);
 (%o1) [[1, a, i], [1, a, ii], [1, b, i], [1, b, ii], [2, a, i], 
 [2, a, ii], [2, b, i], [2, b, ii], [3, a, i], [3, a, ii], 
 [3, b, i], [3, b, ii]]
+@end group
 @end example
 
 The list returned by @code{cartesian_product_list} contains duplicate elements
@@ -518,10 +621,11 @@ if any argument contains duplicates.
 @c ===beg===
 @c cartesian_product_list ([e, h], [3, 7, 3]);
 @c ===end===
-
-@example
+@example maxima
+@group
 (%i1) cartesian_product_list ([e, h], [3, 7, 3]);
 (%o1)   [[e, 3], [e, 7], [e, 3], [h, 3], [h, 7], [h, 3]]
+@end group
 @end example
 
 The length of the list returned by @code{cartesian_product_list}
@@ -531,13 +635,16 @@ is equal to the product of the lengths of the arguments.
 @c foo: cartesian_product_list ([1, 1, 2, 2, 3], [h, z, h]);
 @c is (length (foo) = 5*3);
 @c ===end===
-
-@example
+@example maxima
+@group
 (%i1) foo: cartesian_product_list ([1, 1, 2, 2, 3], [h, z, h]);
 (%o1) [[1, h], [1, z], [1, h], [1, h], [1, z], [1, h], [2, h], 
   [2, z], [2, h], [2, h], [2, z], [2, h], [3, h], [3, z], [3, h]]
+@end group
+@group
 (%i2) is (length (foo) = 5*3);
 (%o2)                         true
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -565,13 +672,19 @@ Examples:
 @c disjoin (a + b, {5, z, a + b, %pi});
 @c disjoin (a - b, {5, z, a + b, %pi});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) disjoin (a, @{a, b, c, d@});
 (%o1)                       @{b, c, d@}
+@end group
+@group
 (%i2) disjoin (a + b, @{5, z, a + b, %pi@});
 (%o2)                      @{5, %pi, z@}
+@end group
+@group
 (%i3) disjoin (a - b, @{5, z, a + b, %pi@});
 (%o3)                  @{5, %pi, b + a, z@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -592,11 +705,15 @@ Examples:
 @c disjointp ({a, b, c}, {1, 2, 3});
 @c disjointp ({a, b, 3}, {1, 2, 3});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) disjointp (@{a, b, c@}, @{1, 2, 3@});
 (%o1)                         true
+@end group
+@group
 (%i2) disjointp (@{a, b, 3@}, @{1, 2, 3@});
 (%o2)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -627,11 +744,15 @@ the sum of its divisors (except for itself) is 28.
 @c s: divisors(28);
 @c lreduce ("+", args(s)) - 28;
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) s: divisors(28);
 (%o1)                 @{1, 2, 4, 7, 14, 28@}
+@end group
+@group
 (%i2) lreduce ("+", args(s)) - 28;
 (%o2)                          28
+@end group
 @end example
 
 @code{divisors} is a simplifying function.
@@ -642,11 +763,15 @@ yields the divisors without reevaluating @code{divisors(8)}.
 @c divisors (a);
 @c subst (8, a, %);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) divisors (a);
 (%o1)                      divisors(a)
+@end group
+@group
 (%i2) subst (8, a, %);
 (%o2)                     @{1, 2, 4, 8@}
+@end group
 @end example
 
 @code{divisors} distributes over equations, lists, matrices, and sets.
@@ -657,17 +782,25 @@ yields the divisors without reevaluating @code{divisors(8)}.
 @c divisors (matrix ([a, b], [c, d]));
 @c divisors ({a, b, c});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) divisors (a = b);
 (%o1)               divisors(a) = divisors(b)
+@end group
+@group
 (%i2) divisors ([a, b, c]);
 (%o2)        [divisors(a), divisors(b), divisors(c)]
+@end group
+@group
 (%i3) divisors (matrix ([a, b], [c, d]));
                   [ divisors(a)  divisors(b) ]
 (%o3)             [                          ]
                   [ divisors(c)  divisors(d) ]
+@end group
+@group
 (%i4) divisors (@{a, b, c@});
 (%o4)        @{divisors(a), divisors(b), divisors(c)@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -689,11 +822,15 @@ Examples:
 @c elementp (sin(1), {sin(1), sin(2), sin(3)});
 @c elementp (sin(1), {cos(1), cos(2), cos(3)});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) elementp (sin(1), @{sin(1), sin(2), sin(3)@});
 (%o1)                         true
+@end group
+@group
 (%i2) elementp (sin(1), @{cos(1), cos(2), cos(3)@});
 (%o2)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -714,11 +851,15 @@ Examples:
 @c map (emptyp, [{}, []]);
 @c map (emptyp, [a + b, {{}}, %pi]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) map (emptyp, [@{@}, []]);
 (%o1)                     [true, true]
+@end group
+@group
 (%i2) map (emptyp, [a + b, @{@{@}@}, %pi]);
 (%o2)                 [false, false, false]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -754,10 +895,12 @@ The equivalence relation is a lambda expression which returns @code{true} or @co
 @c equiv_classes ({1, 1.0, 2, 2.0, 3, 3.0}, 
 @c                         lambda ([x, y], is (equal (x, y))));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) equiv_classes (@{1, 1.0, 2, 2.0, 3, 3.0@},
                         lambda ([x, y], is (equal (x, y))));
 (%o1)            @{@{1, 1.0@}, @{2, 2.0@}, @{3, 3.0@}@}
+@end group
 @end example
 
 The equivalence relation is the name of a relational function
@@ -766,9 +909,11 @@ which @code{is} evaluates to @code{true} or @code{false}.
 @c ===beg===
 @c equiv_classes ({1, 1.0, 2, 2.0, 3, 3.0}, equal);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) equiv_classes (@{1, 1.0, 2, 2.0, 3, 3.0@}, equal);
 (%o1)            @{@{1, 1.0@}, @{2, 2.0@}, @{3, 3.0@}@}
+@end group
 @end example
 
 The equivalence classes are numbers which differ by a multiple of 3.
@@ -777,10 +922,12 @@ The equivalence classes are numbers which differ by a multiple of 3.
 @c equiv_classes ({1, 2, 3, 4, 5, 6, 7}, 
 @c                      lambda ([x, y], remainder (x - y, 3) = 0));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) equiv_classes (@{1, 2, 3, 4, 5, 6, 7@},
                      lambda ([x, y], remainder (x - y, 3) = 0));
 (%o1)              @{@{1, 4, 7@}, @{2, 5@}, @{3, 6@}@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -838,11 +985,15 @@ The predicate is a function of one argument.
 @c every (integerp, {1, 2, 3, 4, 5, 6});
 @c every (atom, {1, 2, sin(3), 4, 5 + y, 6});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) every (integerp, @{1, 2, 3, 4, 5, 6@});
 (%o1)                         true
+@end group
+@group
 (%i2) every (atom, @{1, 2, sin(3), 4, 5 + y, 6@});
 (%o2)                         false
+@end group
 @end example
 
 @code{every} applied to two lists.
@@ -852,11 +1003,15 @@ The predicate is a function of two arguments.
 @c every ("=", [a, b, c], [a, b, c]);
 @c every ("#", [a, b, c], [a, b, c]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) every ("=", [a, b, c], [a, b, c]);
 (%o1)                         true
+@end group
+@group
 (%i2) every ("#", [a, b, c], [a, b, c]);
 (%o2)                         false
+@end group
 @end example
 
 Return values of the predicate @var{f} which evaluate
@@ -871,18 +1026,28 @@ are governed by the global flag @code{prederror}.
 @c prederror : true;
 @c every ("<", [x, y, z], [x^2, y^2, z^2]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) prederror : false;
 (%o1)                         false
+@end group
+@group
 (%i2) map (lambda ([a, b], is (a < b)), [x, y, z],
                    [x^2, y^2, z^2]);
 (%o2)              [unknown, unknown, unknown]
+@end group
+@group
 (%i3) every ("<", [x, y, z], [x^2, y^2, z^2]);
 (%o3)                        unknown
+@end group
+@group
 (%i4) prederror : true;
 (%o4)                         true
+@end group
+@group
 (%i5) every ("<", [x, y, z], [x^2, y^2, z^2]);
 (%o5)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -910,11 +1075,15 @@ Examples:
 @c extremal_subset ({-2, -1, 0, 1, 2}, abs, max);
 @c extremal_subset ({sqrt(2), 1.57, %pi/2}, sin, min);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) extremal_subset (@{-2, -1, 0, 1, 2@}, abs, max);
 (%o1)                       @{- 2, 2@}
+@end group
+@group
 (%i2) extremal_subset (@{sqrt(2), 1.57, %pi/2@}, sin, min);
 (%o2)                       @{sqrt(2)@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -948,9 +1117,11 @@ Applied to a list, @code{flatten} gathers all list elements that are lists.
 @c ===beg===
 @c flatten ([a, b, [c, [d, e], f], [[g, h]], i, j]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) flatten ([a, b, [c, [d, e], f], [[g, h]], i, j]);
 (%o1)            [a, b, c, d, e, f, g, h, i, j]
+@end group
 @end example
 
 Applied to a set, @code{flatten} gathers all members of set elements that are sets.
@@ -959,11 +1130,15 @@ Applied to a set, @code{flatten} gathers all members of set elements that are se
 @c flatten ({a, {b}, {{c}}});
 @c flatten ({a, {[a], {a}}});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) flatten (@{a, @{b@}, @{@{c@}@}@});
 (%o1)                       @{a, b, c@}
+@end group
+@group
 (%i2) flatten (@{a, @{[a], @{a@}@}@});
 (%o2)                       @{a, [a]@}
+@end group
 @end example
 
 @code{flatten} is similar to the effect of declaring the main operator n-ary.
@@ -975,13 +1150,19 @@ different from the main operator, while an n-ary declaration affects those.
 @c declare (f, nary);
 @c ev (expr);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) expr: flatten (f (g (f (f (x)))));
 (%o1)                     f(g(f(f(x))))
+@end group
+@group
 (%i2) declare (f, nary);
 (%o2)                         done
+@end group
+@group
 (%i3) ev (expr);
-(%o3)                      f(g(f(x)))
+(%o3)                     f(g(f(f(x))))
+@end group
 @end example
 
 @code{flatten} treats subscripted functions the same as any other operator.
@@ -989,10 +1170,12 @@ different from the main operator, while an n-ary declaration affects those.
 @c ===beg===
 @c flatten (f[5] (f[5] (x, y), z));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) flatten (f[5] (f[5] (x, y), z));
 (%o1)                      f (x, y, z)
                             5
+@end group
 @end example
 
 It may be possible for @code{flatten} to construct expressions in which the number
@@ -1003,14 +1186,18 @@ of arguments differs from the declared arguments for an operator;
 @c flatten (%);
 @c ''%, nouns;
 @c ===end===
-@example
+mod: expected exactly 2 arguments but got 3: [5, 7, 4]
+ -- an error. To debug this try: debugmode(true);
+@example maxima
+@group
 (%i1) 'mod (5, 'mod (7, 4));
 (%o1)                   mod(5, mod(7, 4))
+@end group
+@group
 (%i2) flatten (%);
 (%o2)                     mod(5, 7, 4)
+@end group
 (%i3) ''%, nouns;
-Wrong number of arguments to mod
- -- an error.  Quitting.  To debug this try debugmode(true);
 @end example
 
 @opencatbox{Categories:}
@@ -1035,11 +1222,15 @@ Examples:
 @c full_listify ({a, b, {c, {d, e, f}, g}});
 @c full_listify (F (G ({a, b, H({c, d, e})})));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) full_listify (@{a, b, @{c, @{d, e, f@}, g@}@});
 (%o1)               [a, b, [c, [d, e, f], g]]
+@end group
+@group
 (%i2) full_listify (F (G (@{a, b, H(@{c, d, e@})@})));
 (%o2)              F(G([a, b, H([c, d, e])]))
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1065,11 +1256,15 @@ because the main operator of @code{f([b])} isn't a list.
 @c fullsetify ([a, [a]]);
 @c fullsetify ([a, f([b])]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) fullsetify ([a, [a]]);
 (%o1)                       @{a, @{a@}@}
+@end group
+@group
 (%i2) fullsetify ([a, f([b])]);
 (%o2)                      @{a, f([b])@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1091,9 +1286,11 @@ are already Boolean values.
 @c ===beg===
 @c every (identity, [true, true]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) every (identity, [true, true]);
 (%o1)                         true
+@end group
 @end example
 @end deffn
 
@@ -1129,18 +1326,28 @@ Examples:
 @c integer_partitions (5, 3);
 @c integer_partitions (5, 2);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) integer_partitions (3);
 (%o1)               @{[1, 1, 1], [2, 1], [3]@}
+@end group
 (%i2) s: integer_partitions (25)$
+@group
 (%i3) cardinality (s);
 (%o3)                         1958
+@end group
+@group
 (%i4) map (lambda ([x], apply ("+", x)), s);
 (%o4)                         @{25@}
+@end group
+@group
 (%i5) integer_partitions (5, 3);
 (%o5) @{[2, 2, 1], [3, 1, 1], [3, 2, 0], [4, 1, 0], [5, 0, 0]@}
+@end group
+@group
 (%i6) integer_partitions (5, 2);
 (%o6)               @{[3, 2], [4, 1], [5, 0]@}
+@end group
 @end example
 
 To find all partitions that satisfy a condition, use the function @code{subset};
@@ -1152,13 +1359,17 @@ here is an example that finds all partitions of 10 that consist of prime numbers
 @c xprimep(x) := integerp(x) and (x > 1) and primep(x)$
 @c subset (s, lambda ([x], every (xprimep, x)));
 @c ===end===
-@example
+@example maxima
 (%i1) s: integer_partitions (10)$
+@group
 (%i2) cardinality (s);
 (%o2)                          42
+@end group
 (%i3) xprimep(x) := integerp(x) and (x > 1) and primep(x)$
+@group
 (%i4) subset (s, lambda ([x], every (xprimep, x)));
 (%o4) @{[2, 2, 2, 2, 2], [3, 3, 2, 2], [5, 3, 2], [5, 5], [7, 3]@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1197,23 +1408,39 @@ Examples:
 @c intersection (S_1, S_2, S_3);
 @c intersection (S_1, S_2, S_3, S_4);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) S_1 : @{a, b, c, d@};
 (%o1)                     @{a, b, c, d@}
+@end group
+@group
 (%i2) S_2 : @{d, e, f, g@};
 (%o2)                     @{d, e, f, g@}
+@end group
+@group
 (%i3) S_3 : @{c, d, e, f@};
 (%o3)                     @{c, d, e, f@}
+@end group
+@group
 (%i4) S_4 : @{u, v, w@};
 (%o4)                       @{u, v, w@}
+@end group
+@group
 (%i5) intersection (S_1, S_2);
 (%o5)                          @{d@}
+@end group
+@group
 (%i6) intersection (S_2, S_3);
 (%o6)                       @{d, e, f@}
+@end group
+@group
 (%i7) intersection (S_1, S_2, S_3);
 (%o7)                          @{d@}
+@end group
+@group
 (%i8) intersection (S_1, S_2, S_3, S_4);
 (%o8)                          @{@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1242,17 +1469,27 @@ Examples:
 @c assume(equal(x,y));
 @c kron_delta(x,y);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) kron_delta(a,a);
-(%o1)                                  1
+(%o1)                           1
+@end group
+@group
 (%i2) kron_delta(a,b,a,b);
-(%o2)                          kron_delta(a, b)
+(%o2)                   kron_delta(a, b)
+@end group
+@group
 (%i3) kron_delta(a,a,b,a+1);
-(%o3)                                  0
+(%o3)                           0
+@end group
+@group
 (%i4) assume(equal(x,y));
-(%o4)                            [equal(x, y)]
+(%o4)                     [equal(x, y)]
+@end group
+@group
 (%i5) kron_delta(x,y);
-(%o5)                                  1
+(%o5)                           1
+@end group
 @end example
 
 
@@ -1272,11 +1509,15 @@ Examples:
 @c listify ({a, b, c, d});
 @c listify (F ({a, b, c, d}));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) listify (@{a, b, c, d@});
 (%o1)                     [a, b, c, d]
+@end group
+@group
 (%i2) listify (F (@{a, b, c, d@}));
 (%o2)                    F(@{a, b, c, d@})
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1314,12 +1555,15 @@ Examples:
 @c makeset (i + j + k, [i, j, k], S3);
 @c makeset (sin(x), [x], {[1], [2], [3]});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) makeset (i/j, [i, j], [[1, a], [2, b], [3, c], [4, d]]);
                            1  2  3  4
 (%o1)                     @{-, -, -, -@}
                            a  b  c  d
+@end group
 (%i2) S : @{x, y, z@}$
+@group
 (%i3) S3 : cartesian_product (S, S, S);
 (%o3) @{[x, x, x], [x, x, y], [x, x, z], [x, y, x], [x, y, y], 
 [x, y, z], [x, z, x], [x, z, y], [x, z, z], [y, x, x], 
@@ -1327,11 +1571,16 @@ Examples:
 [y, z, x], [y, z, y], [y, z, z], [z, x, x], [z, x, y], 
 [z, x, z], [z, y, x], [z, y, y], [z, y, z], [z, z, x], 
 [z, z, y], [z, z, z]@}
+@end group
+@group
 (%i4) makeset (i + j + k, [i, j, k], S3);
 (%o4) @{3 x, 3 y, y + 2 x, 2 y + x, 3 z, z + 2 x, z + y + x, 
                                        z + 2 y, 2 z + x, 2 z + y@}
+@end group
+@group
 (%i5) makeset (sin(x), [x], @{[1], [2], [3]@});
 (%o5)               @{sin(1), sin(2), sin(3)@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1365,27 +1614,45 @@ Examples:
 @c moebius (matrix ([11, 12], [13, 14]));
 @c moebius ({21, 22, 23, 24});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) moebius (1);
 (%o1)                           1
+@end group
+@group
 (%i2) moebius (2 * 3 * 5);
 (%o2)                          - 1
+@end group
+@group
 (%i3) moebius (11 * 17 * 29 * 31);
 (%o3)                           1
+@end group
+@group
 (%i4) moebius (2^32);
 (%o4)                           0
+@end group
+@group
 (%i5) moebius (n);
 (%o5)                      moebius(n)
+@end group
+@group
 (%i6) moebius (n = 12);
 (%o6)                    moebius(n) = 0
+@end group
+@group
 (%i7) moebius ([11, 11 * 13, 11 * 13 * 15]);
 (%o7)                      [- 1, 1, 1]
+@end group
+@group
 (%i8) moebius (matrix ([11, 12], [13, 14]));
                            [ - 1  0 ]
 (%o8)                      [        ]
                            [ - 1  1 ]
+@end group
+@group
 (%i9) moebius (@{21, 22, 23, 24@});
 (%o9)                      @{- 1, 0, 1@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1419,21 +1686,28 @@ Examples:
 @c multinomial_coeff (-6, 2);
 @c minfactorial (%);
 @c ===end===
-@example
+factorial: factorial of negative integer -6 not defined.
+ -- an error. To debug this try: debugmode(true);
+@example maxima
+@group
 (%i1) multinomial_coeff (1, 2, x);
                             (x + 3)!
 (%o1)                       --------
                               2 x!
+@end group
+@group
 (%i2) minfactorial (%);
                      (x + 1) (x + 2) (x + 3)
 (%o2)                -----------------------
                                 2
+@end group
 (%i3) multinomial_coeff (-6, 2);
-                             (- 4)!
-(%o3)                       --------
-                            2 (- 6)!
+@group
 (%i4) minfactorial (%);
-(%o4)                          10
+                     (x + 1) (x + 2) (x + 3)
+(%o4)                -----------------------
+                                2
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1465,13 +1739,19 @@ Examples:
 @c num_distinct_partitions (12, list);
 @c num_distinct_partitions (n);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) num_distinct_partitions (12);
 (%o1)                          15
+@end group
+@group
 (%i2) num_distinct_partitions (12, list);
-(%o2)      [1, 1, 1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 15]
+(%o2)        [1, 1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 15]
+@end group
+@group
 (%i3) num_distinct_partitions (n);
 (%o3)              num_distinct_partitions(n)
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1503,13 +1783,19 @@ Examples:
 @c num_partitions (8, list);
 @c num_partitions (n);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) num_partitions (5) = cardinality (integer_partitions (5));
 (%o1)                         7 = 7
+@end group
+@group
 (%i2) num_partitions (8, list);
-(%o2)            [1, 1, 2, 3, 5, 7, 11, 15, 22]
+(%o2)              [1, 2, 3, 5, 7, 11, 15, 22]
+@end group
+@group
 (%i3) num_partitions (n);
 (%o3)                   num_partitions(n)
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1541,12 +1827,16 @@ Examples:
 @c partition_set ({x, rat(y), rat(y) + z, 1}, 
 @c                      lambda ([x], ratp(x)));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) partition_set (@{2, 7, 1, 8, 2, 8@}, evenp);
 (%o1)                   [@{1, 7@}, @{2, 8@}]
+@end group
+@group
 (%i2) partition_set (@{x, rat(y), rat(y) + z, 1@},
                      lambda ([x], ratp(x)));
 (%o2)/R/              [@{1, x@}, @{y, y + z@}]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1574,11 +1864,15 @@ Examples:
 @c permutations ([a, a]);
 @c permutations ([a, a, b]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) permutations ([a, a]);
 (%o1)                       @{[a, a]@}
+@end group
+@group
 (%i2) permutations ([a, a, b]);
 (%o2)           @{[a, a, b], [a, b, a], [b, a, a]@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1614,19 +1908,31 @@ Examples:
 @c powerset ({w, x, y, z}, 1);
 @c powerset ({w, x, y, z}, 0);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) powerset (@{a, b, c@});
 (%o1) @{@{@}, @{a@}, @{a, b@}, @{a, b, c@}, @{a, c@}, @{b@}, @{b, c@}, @{c@}@}
+@end group
+@group
 (%i2) powerset (@{w, x, y, z@}, 4);
 (%o2)                    @{@{w, x, y, z@}@}
+@end group
+@group
 (%i3) powerset (@{w, x, y, z@}, 3);
 (%o3)     @{@{w, x, y@}, @{w, x, z@}, @{w, y, z@}, @{x, y, z@}@}
+@end group
+@group
 (%i4) powerset (@{w, x, y, z@}, 2);
 (%o4)   @{@{w, x@}, @{w, y@}, @{w, z@}, @{x, y@}, @{x, z@}, @{y, z@}@}
+@end group
+@group
 (%i5) powerset (@{w, x, y, z@}, 1);
 (%o5)                 @{@{w@}, @{x@}, @{y@}, @{z@}@}
+@end group
+@group
 (%i6) powerset (@{w, x, y, z@}, 0);
 (%o6)                         @{@{@}@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1653,15 +1959,23 @@ Examples:
 @c random_permutation ({x + 1, y + 2, z + 3});
 @c random_permutation ({x + 1, y + 2, z + 3});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) random_permutation ([a, b, c, 1, 2, 3]);
 (%o1)                  [c, 1, 2, 3, a, b]
+@end group
+@group
 (%i2) random_permutation ([a, b, c, 1, 2, 3]);
 (%o2)                  [b, 3, 1, c, a, 2]
+@end group
+@group
 (%i3) random_permutation (@{x + 1, y + 2, z + 3@});
 (%o3)                 [y + 2, z + 3, x + 1]
+@end group
+@group
 (%i4) random_permutation (@{x + 1, y + 2, z + 3@});
 (%o4)                 [x + 1, y + 2, z + 3]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1690,21 +2004,35 @@ Examples:
 @c setdifference (S_1, {});
 @c setdifference ({}, S_1);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) S_1 : @{a, b, c, x, y, z@};
 (%o1)                  @{a, b, c, x, y, z@}
+@end group
+@group
 (%i2) S_2 : @{aa, bb, c, x, y, zz@};
 (%o2)                 @{aa, bb, c, x, y, zz@}
+@end group
+@group
 (%i3) setdifference (S_1, S_2);
 (%o3)                       @{a, b, z@}
+@end group
+@group
 (%i4) setdifference (S_2, S_1);
 (%o4)                     @{aa, bb, zz@}
+@end group
+@group
 (%i5) setdifference (S_1, S_1);
 (%o5)                          @{@}
+@end group
+@group
 (%i6) setdifference (S_1, @{@});
 (%o6)                  @{a, b, c, x, y, z@}
+@end group
+@group
 (%i7) setdifference (@{@}, S_1);
 (%o7)                          @{@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1732,13 +2060,19 @@ Examples:
 @c setequalp ({a, b, c}, {1, 2, 3});
 @c setequalp ({x^2 - y^2}, {(x + y) * (x - y)});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) setequalp (@{1, 2, 3@}, @{1, 2, 3@});
 (%o1)                         true
+@end group
+@group
 (%i2) setequalp (@{a, b, c@}, @{1, 2, 3@});
 (%o2)                         false
+@end group
+@group
 (%i3) setequalp (@{x^2 - y^2@}, @{(x + y) * (x - y)@});
 (%o3)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1764,13 +2098,19 @@ Examples:
 @c setify ([a, b, c, a, b, c]);
 @c setify ([7, 13, 11, 1, 3, 9, 5]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) setify ([1, 2, 3, a, b, c]);
 (%o1)                  @{1, 2, 3, a, b, c@}
+@end group
+@group
 (%i2) setify ([a, b, c, a, b, c]);
 (%o2)                       @{a, b, c@}
+@end group
+@group
 (%i3) setify ([7, 13, 11, 1, 3, 9, 5]);
 (%o3)                @{1, 3, 5, 7, 9, 11, 13@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1798,13 +2138,19 @@ Examples:
 @c {a, a, a};
 @c setp (%);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) simp : false;
 (%o1)                         false
+@end group
+@group
 (%i2) @{a, a, a@};
 (%o2)                       @{a, a, a@}
+@end group
+@group
 (%i3) setp (%);
 (%o3)                         true
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1846,9 +2192,11 @@ The empty set is a partition of itself, the conditions 1 and 2 being vacuously t
 @c ===beg===
 @c set_partitions ({});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) set_partitions (@{@});
 (%o1)                         @{@{@}@}
+@end group
 @end example
 
 The cardinality of the set of partitions of a set can be found using @code{stirling2}.
@@ -1858,11 +2206,13 @@ The cardinality of the set of partitions of a set can be found using @code{stirl
 @c p: set_partitions (s, 3)$ 
 @c cardinality(p) = stirling2 (6, 3);
 @c ===end===
-@example
+@example maxima
 (%i1) s: @{0, 1, 2, 3, 4, 5@}$
-(%i2) p: set_partitions (s, 3)$ 
+(%i2) p: set_partitions (s, 3)$
+@group
 (%i3) cardinality(p) = stirling2 (6, 3);
 (%o3)                        90 = 90
+@end group
 @end example
 
 Each member of @code{p} should have @var{n} = 3 members; let's check.
@@ -1872,11 +2222,13 @@ Each member of @code{p} should have @var{n} = 3 members; let's check.
 @c p: set_partitions (s, 3)$ 
 @c map (cardinality, p);
 @c ===end===
-@example
+@example maxima
 (%i1) s: @{0, 1, 2, 3, 4, 5@}$
-(%i2) p: set_partitions (s, 3)$ 
+(%i2) p: set_partitions (s, 3)$
+@group
 (%i3) map (cardinality, p);
 (%o3)                          @{3@}
+@end group
 @end example
 
 Finally, for each member of @code{p}, the union of its members should 
@@ -1887,11 +2239,13 @@ equal @code{s}; again let's check.
 @c p: set_partitions (s, 3)$ 
 @c map (lambda ([x], apply (union, listify (x))), p);
 @c ===end===
-@example
+@example maxima
 (%i1) s: @{0, 1, 2, 3, 4, 5@}$
-(%i2) p: set_partitions (s, 3)$ 
+(%i2) p: set_partitions (s, 3)$
+@group
 (%i3) map (lambda ([x], apply (union, listify (x))), p);
 (%o3)                 @{@{0, 1, 2, 3, 4, 5@}@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1947,11 +2301,15 @@ The predicate is a function of one argument.
 @c some (integerp, {1, 2, 3, 4, 5, 6});
 @c some (atom, {1, 2, sin(3), 4, 5 + y, 6});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) some (integerp, @{1, 2, 3, 4, 5, 6@});
 (%o1)                         true
+@end group
+@group
 (%i2) some (atom, @{1, 2, sin(3), 4, 5 + y, 6@});
 (%o2)                         true
+@end group
 @end example
 
 @code{some} applied to two lists.
@@ -1961,11 +2319,15 @@ The predicate is a function of two arguments.
 @c some ("=", [a, b, c], [a, b, c]);
 @c some ("#", [a, b, c], [a, b, c]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) some ("=", [a, b, c], [a, b, c]);
 (%o1)                         true
+@end group
+@group
 (%i2) some ("#", [a, b, c], [a, b, c]);
 (%o2)                         false
+@end group
 @end example
 
 Return values of the predicate @var{f} which evaluate
@@ -1982,22 +2344,36 @@ are governed by the global flag @code{prederror}.
 @c some ("<", [x, y, z], [x^2, y^2, z^2]);
 @c some ("<", [x, y, z], [x^2, y^2, z + 1]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) prederror : false;
 (%o1)                         false
+@end group
+@group
 (%i2) map (lambda ([a, b], is (a < b)), [x, y, z],
            [x^2, y^2, z^2]);
 (%o2)              [unknown, unknown, unknown]
+@end group
+@group
 (%i3) some ("<", [x, y, z], [x^2, y^2, z^2]);
 (%o3)                        unknown
+@end group
+@group
 (%i4) some ("<", [x, y, z], [x^2, y^2, z + 1]);
 (%o4)                         true
+@end group
+@group
 (%i5) prederror : true;
 (%o5)                         true
+@end group
+@group
 (%i6) some ("<", [x, y, z], [x^2, y^2, z^2]);
 (%o6)                         false
+@end group
+@group
 (%i7) some ("<", [x, y, z], [x^2, y^2, z + 1]);
 (%o7)                         true
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2047,11 +2423,13 @@ Examples:
 @c assume (n >= 0)$
 @c stirling1 (n, n);
 @c ===end===
-@example
+@example maxima
 (%i1) declare (n, integer)$
 (%i2) assume (n >= 0)$
+@group
 (%i3) stirling1 (n, n);
 (%o3)                           1
+@end group
 @end example
 
 
@@ -2093,11 +2471,13 @@ Examples:
 @c assume (n >= 0)$
 @c stirling2 (n, n);
 @c ===end===
-@example
+@example maxima
 (%i1) declare (n, integer)$
 (%i2) assume (n >= 0)$
+@group
 (%i3) stirling2 (n, n);
 (%o3)                           1
+@end group
 @end example
 
 @code{stirling2} does not simplify for non-integer arguments.
@@ -2105,9 +2485,11 @@ Examples:
 @c ===beg===
 @c stirling2 (%pi, %pi);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) stirling2 (%pi, %pi);
 (%o1)                  stirling2(%pi, %pi)
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2135,11 +2517,15 @@ Examples:
 @c subset ({1, 2, x, x + y, z, x + y + z}, atom);
 @c subset ({1, 2, 7, 8, 9, 14}, evenp);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) subset (@{1, 2, x, x + y, z, x + y + z@}, atom);
 (%o1)                     @{1, 2, x, z@}
+@end group
+@group
 (%i2) subset (@{1, 2, 7, 8, 9, 14@}, evenp);
 (%o2)                      @{2, 8, 14@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2161,11 +2547,15 @@ Examples:
 @c subsetp ({1, 2, 3}, {a, 1, b, 2, c, 3});
 @c subsetp ({a, 1, b, 2, c, 3}, {1, 2, 3});
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) subsetp (@{1, 2, 3@}, @{a, 1, b, 2, c, 3@});
 (%o1)                         true
+@end group
+@group
 (%i2) subsetp (@{a, 1, b, 2, c, 3@}, @{1, 2, 3@});
 (%o2)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2198,23 +2588,39 @@ Examples:
 @c symmdifference (S_1, S_2, S_3);
 @c symmdifference ({}, S_1, S_2, S_3);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) S_1 : @{a, b, c@};
 (%o1)                       @{a, b, c@}
+@end group
+@group
 (%i2) S_2 : @{1, b, c@};
 (%o2)                       @{1, b, c@}
+@end group
+@group
 (%i3) S_3 : @{a, b, z@};
 (%o3)                       @{a, b, z@}
+@end group
+@group
 (%i4) symmdifference ();
 (%o4)                          @{@}
+@end group
+@group
 (%i5) symmdifference (S_1);
 (%o5)                       @{a, b, c@}
+@end group
+@group
 (%i6) symmdifference (S_1, S_2);
 (%o6)                        @{1, a@}
+@end group
+@group
 (%i7) symmdifference (S_1, S_2, S_3);
-(%o7)                        @{1, b, z@}
+(%o7)                       @{1, b, z@}
+@end group
+@group
 (%i8) symmdifference (@{@}, S_1, S_2, S_3);
-(%o8)                        @{1,b, z@}
+(%o8)                       @{1, b, z@}
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2243,23 +2649,39 @@ Examples:
 @c union (S_1, S_2, S_3);
 @c union ({}, S_1, S_2, S_3);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) S_1 : @{a, b, c + d, %e@};
 (%o1)                   @{%e, a, b, d + c@}
+@end group
+@group
 (%i2) S_2 : @{%pi, %i, %e, c + d@};
 (%o2)                 @{%e, %i, %pi, d + c@}
+@end group
+@group
 (%i3) S_3 : @{17, 29, 1729, %pi, %i@};
 (%o3)                @{17, 29, 1729, %i, %pi@}
+@end group
+@group
 (%i4) union ();
 (%o4)                          @{@}
+@end group
+@group
 (%i5) union (S_1);
 (%o5)                   @{%e, a, b, d + c@}
+@end group
+@group
 (%i6) union (S_1, S_2);
 (%o6)              @{%e, %i, %pi, a, b, d + c@}
+@end group
+@group
 (%i7) union (S_1, S_2, S_3);
 (%o7)       @{17, 29, 1729, %e, %i, %pi, a, b, d + c@}
+@end group
+@group
 (%i8) union (@{@}, S_1, S_2, S_3);
 (%o8)       @{17, 29, 1729, %e, %i, %pi, a, b, d + c@}
+@end group
 @end example
 
 @opencatbox{Categories:}
-----------------------------------------------------------------------
Summary of changes:
 doc/info/nset.texi | 620 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 521 insertions(+), 99 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 14:55:34
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  9e04c6b75b7efd03f261f2073f6b31759d15dbe7 (commit)
       via  7539fc26a61998da84df7a035e23cb14cdce303c (commit)
      from  5864fef76066da18b2784bc82d98487b9d6a98b3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
 doc/info/Rules.texi | 160 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 120 insertions(+), 40 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 14:54:12
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-rules-update-examples has been created
        at  9e04c6b75b7efd03f261f2073f6b31759d15dbe7 (commit)
- Log -----------------------------------------------------------------
commit 9e04c6b75b7efd03f261f2073f6b31759d15dbe7
Author: Raymond Toy <toy...@gm...>
Date:   Wed Sep 3 07:51:55 2025 -0700
    Add new comment blocks for examples and regenerate them
diff --git a/doc/info/Rules.texi b/doc/info/Rules.texi
index 4e0f1166e..0484a0f42 100644
--- a/doc/info/Rules.texi
+++ b/doc/info/Rules.texi
@@ -481,24 +481,44 @@ named by @code{current_let_rule_package} is used.  If a call such as
 @code{current_let_rule_package} is not changed.  If not otherwise specified,
 @code{current_let_rule_package} defaults to @code{default_let_rule_package}.
 
-@example
+@c ===beg===
+@c matchdeclare ([a, a1, a2], true)$
+@c oneless (x, y) := is (x = y-1)$
+@c let (a1*a2!, a1!, oneless, a2, a1);
+@c letrat: true$
+@c let (a1!/a1, (a1-1)!);
+@c letsimp (n*m!*(n-1)!/m);
+@c let (sin(a)^2, 1 - cos(a)^2);
+@c letsimp (sin(x)^4);
+@c ===end===
+@example maxima
 (%i1) matchdeclare ([a, a1, a2], true)$
 (%i2) oneless (x, y) := is (x = y-1)$
+@group
 (%i3) let (a1*a2!, a1!, oneless, a2, a1);
 (%o3)         a1 a2! --> a1! where oneless(a2, a1)
+@end group
 (%i4) letrat: true$
+@group
 (%i5) let (a1!/a1, (a1-1)!);
                         a1!
 (%o5)                   --- --> (a1 - 1)!
                         a1
+@end group
+@group
 (%i6) letsimp (n*m!*(n-1)!/m);
 (%o6)                      (m - 1)! n!
+@end group
+@group
 (%i7) let (sin(a)^2, 1 - cos(a)^2);
                         2               2
 (%o7)                sin (a) --> 1 - cos (a)
+@end group
+@group
 (%i8) letsimp (sin(x)^4);
                         4           2
 (%o8)                cos (x) - 2 cos (x) + 1
+@end group
 @end example
 
 @c NEEDS ADDITIONAL EXAMPLES
@@ -519,20 +539,34 @@ and does not simplify the quotient.
 When @code{letrat} is @code{true},
 the numerator, denominator, and their quotient are simplified in that order.
 
-@example
+@c ===beg===
+@c matchdeclare (n, true)$
+@c let (n!/n, (n-1)!);
+@c letrat: false$
+@c letsimp (a!/a);
+@c letrat: true$
+@c letsimp (a!/a);
+@c ===end===
+@example maxima
 (%i1) matchdeclare (n, true)$
+@group
 (%i2) let (n!/n, (n-1)!);
                          n!
 (%o2)                    -- --> (n - 1)!
                          n
+@end group
 (%i3) letrat: false$
+@group
 (%i4) letsimp (a!/a);
                                a!
 (%o4)                          --
                                a
+@end group
 (%i5) letrat: true$
+@group
 (%i6) letsimp (a!/a);
 (%o6)                       (a - 1)!
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1100,45 +1134,94 @@ The system variable @code{rules} is the list of rules defined by
 
 Examples:
 
-@example
+@c ===beg===
+@c matchdeclare (x, freeof (%i));
+@c %iargs: false$
+@c tellsimp (sin(%i*x), %i*sinh(x));
+@c trigexpand (sin (%i*y + x));
+@c %iargs:true$
+@c errcatch(0^0);
+@c ev (tellsimp (0^0, 1), simp: false);
+@c 0^0;
+@c remrule ("^", %th(2)[1]);
+@c tellsimp (sin(x)^2, 1 - cos(x)^2);
+@c (1 + sin(x))^2;
+@c expand (%);
+@c sin(x)^2;
+@c kill (rules);
+@c matchdeclare (a, true);
+@c tellsimp (sin(a)^2, 1 - cos(a)^2);
+@c sin(y)^2;
+@c ===end===
+@example maxima
+@group
 (%i1) matchdeclare (x, freeof (%i));
 (%o1)                         done
+@end group
 (%i2) %iargs: false$
+@group
 (%i3) tellsimp (sin(%i*x), %i*sinh(x));
 (%o3)                 [sinrule1, simp-%sin]
+@end group
+@group
 (%i4) trigexpand (sin (%i*y + x));
 (%o4)         sin(x) cos(%i y) + %i cos(x) sinh(y)
+@end group
 (%i5) %iargs:true$
+@group
 (%i6) errcatch(0^0);
- 0
-0  has been generated
+                  0
+expt: undefined: 0
 (%o6)                          []
+@end group
+@group
 (%i7) ev (tellsimp (0^0, 1), simp: false);
 (%o7)                  [^rule1, simpexpt]
+@end group
+@group
 (%i8) 0^0;
 (%o8)                           1
+@end group
+@group
 (%i9) remrule ("^", %th(2)[1]);
 (%o9)                           ^
+@end group
+@group
 (%i10) tellsimp (sin(x)^2, 1 - cos(x)^2);
 (%o10)                 [^rule2, simpexpt]
+@end group
+@group
 (%i11) (1 + sin(x))^2;
                                       2
 (%o11)                    (sin(x) + 1)
+@end group
+@group
 (%i12) expand (%);
                                    2
 (%o12)               2 sin(x) - cos (x) + 2
+@end group
+@group
 (%i13) sin(x)^2;
                                   2
 (%o13)                     1 - cos (x)
+@end group
+@group
 (%i14) kill (rules);
 (%o14)                        done
+@end group
+@group
 (%i15) matchdeclare (a, true);
 (%o15)                        done
+@end group
+@group
 (%i16) tellsimp (sin(a)^2, 1 - cos(a)^2);
 (%o16)                 [^rule3, simpexpt]
+@end group
+@group
 (%i17) sin(y)^2;
                                   2
 (%o17)                     1 - cos (y)
+@end group
 @end example
 
 @opencatbox{Categories:}
commit 7539fc26a61998da84df7a035e23cb14cdce303c
Author: Raymond Toy <toy...@gm...>
Date:   Tue Sep 2 18:44:58 2025 -0700
    Run update_examples on existing examples.
diff --git a/doc/info/Rules.texi b/doc/info/Rules.texi
index dfe002b7a..4e0f1166e 100644
--- a/doc/info/Rules.texi
+++ b/doc/info/Rules.texi
@@ -197,7 +197,7 @@ because the pattern argument @code{x} is given to @code{defmatch}.
 @c b;
 @c x;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (a, lambda ([e], e#0 and freeof(x, e)), b,
                     freeof(x));
@@ -240,7 +240,7 @@ not any other variable, because no pattern argument is given to @code{defmatch}.
 @c linearp (3*z + (y + 1)*z + y^2);
 @c linearp (3*x + (y + 1)*x + y^2);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (a, lambda ([e], e#0 and freeof(x, e)), b,
                     freeof(x));
@@ -275,7 +275,7 @@ to see if it is a definite integral.
 @c 'integrate (sin(t), t, %pi + x, 2*%pi + x);
 @c checklimits (%);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare ([a, f], true);
 (%o1)                         done
@@ -308,9 +308,9 @@ to see if it is a definite integral.
 (%i8) 'integrate (sin(t), t, %pi + x, 2*%pi + x);
                        x + 2 %pi
                       /
-                      [
-(%o8)                 I          sin(t) dt
-                      ]
+                      |
+(%o8)                 |          sin(t) dt
+                      |
                       /
                        x + %pi
 @end group
@@ -378,7 +378,7 @@ Examples:
 @c disprule (foorule1, ?\+rule1, quux);
 @c ev(%);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) tellsimpafter (foo (x, y), bar (x) + baz (y));
 (%o1)                   [foorule1, false]
@@ -598,11 +598,10 @@ For other ways to do substitutions see also @mrefcomma{subst}
 @c let(y(h)/z,y(h-1));
 @c e1:letsimp(e0);
 @c ===end===
-@example
+@example maxima
 @group
-(%i1) e0:e(k) = -(9*y(k))/(5*z)-u(k-1)/(5*z)+(4*y(k))/(5*z^2)
-                               +(3*u(k-1))/(5*z^2)+y(k)
-                               +(-(2*u(k-1)))/5;
+(%i1) e0: e(k) = -(9*y(k))/(5*z)-u(k-1)/(5*z)+(4*y(k))/(5*z^2)
+                 +(3*u(k-1))/(5*z^2)+y(k)-(2*u(k-1))/5;
                9 y(k)   u(k - 1)   4 y(k)   3 u(k - 1)
 (%o1) e(k) = - ------ - -------- + ------ + ---------- + y(k)
                 5 z       5 z          2          2
@@ -739,7 +738,7 @@ or @code{true} or @code{all}.
 @c matchdeclare (ee, true);
 @c matchdeclare (ff, all);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, integerp);
 (%o1)                         done
@@ -774,7 +773,7 @@ the match variable is assigned the expression.
 @c defrule (r1, bb^aa, ["integer" = aa, "atom" = bb]);
 @c r1 (%pi^8);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, integerp, bb, atom);
 (%o1)                         done
@@ -803,7 +802,7 @@ a single expression which satisfies the match predicate, or a sum or product
 @c                bb]);
 @c r2 (8 * (a + b) * sin(x));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, atom, bb, lambda ([x], not atom(x)));
 (%o1)                         done
@@ -842,7 +841,7 @@ as one match predicate cannot accept terms matched by another.
 @c                bb]);
 @c r2 (8 * (a + b) * %pi * sin(x) / c * 2^n);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, atom, bb, lambda ([x], not atom(x)));
 (%o1)                         done
@@ -854,8 +853,8 @@ as one match predicate cannot accept terms matched by another.
 @end group
 @group
 (%i3) r1 (8 + a*b + %pi + sin(x) - c + 2^n);
-                                                     n
-(%o3) [all atoms = %pi + 8, all nonatoms = sin(x) + 2  - c + a b]
+                                                               n
+(%o3) [all atoms = %pi + 8, all nonatoms = sin(x) - c + a b + 2 ]
 @end group
 @group
 (%i4) defrule (r2, aa * bb, ["all atoms" = aa, "all nonatoms" =
@@ -864,8 +863,8 @@ as one match predicate cannot accept terms matched by another.
 @end group
 @group
 (%i5) r2 (8 * (a + b) * %pi * sin(x) / c * 2^n);
-                                                n + 3
-                                       (b + a) 2      sin(x)
+                                        n + 3
+                                       2      (b + a) sin(x)
 (%o5) [all atoms = %pi, all nonatoms = ---------------------]
                                                  c
 @end group
@@ -882,7 +881,7 @@ match variables.
 @c printprops (gg, matchdeclare);
 @c printprops (all, matchdeclare);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare ([aa, bb, cc], atom, [dd, ee], integerp);
 (%o1)                         done
@@ -901,12 +900,12 @@ match variables.
 @end group
 @group
 (%i5) printprops (gg, matchdeclare);
-(%o5)              [lambda([x], x > 100, gg)]
+(%o5)              [lambda([x], x > 100)(gg)]
 @end group
 @group
 (%i6) printprops (all, matchdeclare);
-(%o6) [lambda([x], x > 100, gg), floatnump(ff), integerp(ee), 
-                      integerp(dd), atom(cc), atom(bb), atom(aa)]
+(%o6) [atom(aa), atom(bb), atom(cc), integerp(dd), integerp(ee), 
+                         floatnump(ff), lambda([x], x > 100)(gg)]
 @end group
 @end example
 
@@ -1014,7 +1013,7 @@ Examples:
 @c [foo (aa, bb), aa + bb, aa @@ bb, quux (%pi, %e), 
 @c         quux (%e, %pi)];
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) tellsimp (foo (aa, bb), bb - aa);
 (%o1)                   [foorule1, false]
@@ -1246,7 +1245,7 @@ main operator is not a pattern variable.
 @c tellsimpafter (foo (aa (xx)), aa (foo (xx)));
 @c foo (bar (u - v));
 @c ===end===
-@example
+@example maxima
 (%i1) matchdeclare (aa, atom, [ll, mm], listp, xx, true)$
 @group
 (%i2) tellsimpafter (sin (ll), map (sin, ll));
@@ -1287,7 +1286,7 @@ the rule which was defined first is applied.
 @c tellsimpafter (foo (aa), bar_2 (aa));
 @c foo (42);
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, integerp);
 (%o1)                         done
@@ -1317,7 +1316,7 @@ variables.)
 @c foo (42, %e);
 @c bb;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) matchdeclare (aa, integerp, bb, atom);
 (%o1)                         done
@@ -1352,7 +1351,10 @@ Maxima.
 @c define_variable (bb, true, boolean);
 @c foo (42, %e);
 @c ===end===
-@example
+translator: bb was declared with mode boolean, but it has value: 
+                                                               %e
+ -- an error. To debug this try: debugmode(true);
+@example maxima
 @group
 (%i1) matchdeclare (aa, integerp, bb, atom);
 (%o1)                         done
@@ -1369,12 +1371,7 @@ Maxima.
 (%i4) define_variable (bb, true, boolean);
 (%o4)                         true
 @end group
-@group
 (%i5) foo (42, %e);
-translator: bb was declared with mode boolean, but it has value: 
-                                                               %e
- -- an error. To debug this try: debugmode(true);
-@end group
 @end example
 
 Rules are named after main operators.
@@ -1395,7 +1392,7 @@ while names for other functions are Maxima identifiers.
 @c remrule ("^", ?\^rule1);
 @c rules;
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) tellsimpafter (foo (%pi + %e), 3*%pi);
 (%o1)                   [foorule1, false]
@@ -1457,7 +1454,7 @@ A worked example: anticommutative multiplication.
 @c expand (%);
 @c factor (expand (sum (s[i], i, 0, 9)^^5));
 @c ===end===
-@example
+@example maxima
 @group
 (%i1) gt (i, j) := integerp(j) and i < j;
 (%o1)          gt(i, j) := integerp(j) and (i < j)
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 01:33:01
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  5864fef76066da18b2784bc82d98487b9d6a98b3 (commit)
      from  37a3429614bd68b5faaa99f7b9b24828501de5d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5864fef76066da18b2784bc82d98487b9d6a98b3
Author: Raymond Toy <toy...@gm...>
Date:   Tue Sep 2 18:32:40 2025 -0700
    Regenerate existing examples
diff --git a/doc/info/Groups.texi b/doc/info/Groups.texi
index c9af0574e..d07134581 100644
--- a/doc/info/Groups.texi
+++ b/doc/info/Groups.texi
@@ -30,38 +30,44 @@ Example:
 @c todd_coxeter(%o3,[x1]);
 @c todd_coxeter(%o3,[x1,x2]);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) symet(n):=create_list(
         if (j - i) = 1 then (p(i,j))^^3 else
             if (not i = j) then (p(i,j))^^2 else
                 p(i,i) , j, 1, n-1, i, 1, j);
                                                        <3>
 (%o1) symet(n) := create_list(if j - i = 1 then p(i, j)
-
                                 <2>
- else (if not i = j then p(i, j)    else p(i, i)), j, 1, n - 1,
-
+ else (if not i = j then p(i, j)    else p(i, i)), j, 1, n - 1, 
 i, 1, j)
+@end group
+@group
 (%i2) p(i,j) := concat(x,i).concat(x,j);
 (%o2)        p(i, j) := concat(x, i) . concat(x, j)
+@end group
+@group
 (%i3) symet(5);
          <2>           <3>    <2>           <2>           <3>
-(%o3) [x1   , (x1 . x2)   , x2   , (x1 . x3)   , (x2 . x3)   ,
-
+(%o3) [x1   , (x1 . x2)   , x2   , (x1 . x3)   , (x2 . x3)   , 
             <2>           <2>           <2>           <3>    <2>
           x3   , (x1 . x4)   , (x2 . x4)   , (x3 . x4)   , x4   ]
+@end group
+@group
 (%i4) todd_coxeter(%o3);
-
 Rows tried 426
 (%o4)                          120
+@end group
+@group
 (%i5) todd_coxeter(%o3,[x1]);
-
 Rows tried 213
 (%o5)                          60
+@end group
+@group
 (%i6) todd_coxeter(%o3,[x1,x2]);
-
 Rows tried 71
 (%o6)                          20
+@end group
 @end example
 @opencatbox{Categories:}
 @category{Group theory}
-----------------------------------------------------------------------
Summary of changes:
 doc/info/Groups.texi | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 01:27:45
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, master has been updated
       via  37a3429614bd68b5faaa99f7b9b24828501de5d2 (commit)
       via  b9389997f2428d79151e6e8e0aacc39d9e01905d (commit)
       via  c28dd2bb70e067033a4b6d78b15fcda0c6a271f8 (commit)
       via  776e8a93df620e484eba4e1b26334dad80f9a046 (commit)
      from  4218874e4110454c2d89511a07c87ad053916e02 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
 doc/info/Number.texi | 1149 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 846 insertions(+), 303 deletions(-)
hooks/post-receive
-- 
Maxima CAS
 | 
| 
     
      
      
      From: rtoy <rt...@us...> - 2025-09-03 01:27:02
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-number-update-examples has been created
        at  37a3429614bd68b5faaa99f7b9b24828501de5d2 (commit)
- Log -----------------------------------------------------------------
commit 37a3429614bd68b5faaa99f7b9b24828501de5d2
Author: Raymond Toy <toy...@gm...>
Date:   Tue Sep 2 18:26:34 2025 -0700
    Add comment blocks for examples and regenerate them
    
    Also marked some examples with "maxima" to get syntax highlighting.
    These particular ones don't get code blocks since they're not really
    code examples to be executed.
diff --git a/doc/info/Number.texi b/doc/info/Number.texi
index 9d4fb32d9..ad2fa4f88 100644
--- a/doc/info/Number.texi
+++ b/doc/info/Number.texi
@@ -227,6 +227,7 @@ Examples:
 @var{expr} is an expression comprising continued fractions and square roots of
 integers.
 
+@c The second example below no longer works.
 @example
 (%i1) cf ([5, 3, 1]*[11, 9, 7] + [3, 7]/[4, 3, 2]);
 (%o1)               [59, 17, 2, 1, 1, 1, 27]
@@ -932,15 +933,23 @@ If @var{n} is negative, @code{inv_mod} is used to find the modular inverse.
 @c power_mod(2, -1, 5);
 @c inv_mod(2,5);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) power_mod(3, 15, 5);
-(%o1)                          2
+(%o1)                           2
+@end group
+@group
 (%i2) mod(3^15,5);
-(%o2)                          2
+(%o2)                           2
+@end group
+@group
 (%i3) power_mod(2, -1, 5);
-(%o3)                          3
+(%o3)                           3
+@end group
+@group
 (%i4) inv_mod(2,5);
-(%o4)                          3
+(%o4)                           3
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -994,9 +1003,11 @@ Returns the list of all primes from @var{start} to @var{end}.
 @c ===beg===
 @c primes(3, 7);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) primes(3, 7);
-(%o1)                     [3, 5, 7]
+(%o1)                       [3, 5, 7]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1013,9 +1024,11 @@ Returns the greatest prime smaller than @var{n}.
 @c ===beg===
 @c prev_prime(27);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) prev_prime(27);
-(%o1)                       23
+(%o1)                          23
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1036,11 +1049,15 @@ This amounts to solving Pell's equation @code{a^2 - @var{n} b^2 = 1}.
 @c qunit (17);
 @c expand (% * (sqrt(17) - 4));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) qunit (17);
 (%o1)                     sqrt(17) + 4
+@end group
+@group
 (%i2) expand (% * (sqrt(17) - 4));
 (%o2)                           1
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1234,17 +1251,27 @@ can be generated by two factor generators.
 @c UG2: makelist(power_mod(g2,i,15), i,0,f2-1);
 @c M15: create_list(mod(i*j,15), i,UG1, j,UG2);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) [[f1,f2]: zn_characteristic_factors(15), totient(15)];
-(%o1)                             [[2, 4], 8]
+(%o1)                      [[2, 4], 8]
+@end group
+@group
 (%i2) [[g1,g2]: zn_factor_generators(15), zn_primroot(15)];
-(%o2)                           [[11, 7], false]
+(%o2)                   [[11, 7], false]
+@end group
+@group
 (%i3) UG1: makelist(power_mod(g1,i,15), i,0,f1-1);
-(%o3)                               [1, 11]
+(%o3)                        [1, 11]
+@end group
+@group
 (%i4) UG2: makelist(power_mod(g2,i,15), i,0,f2-1);
-(%o4)                            [1, 7, 4, 13]
+(%o4)                     [1, 7, 4, 13]
+@end group
+@group
 (%i5) M15: create_list(mod(i*j,15), i,UG1, j,UG2);
-(%o5)                      [1, 7, 4, 13, 11, 2, 14, 8]
+(%o5)              [1, 7, 4, 13, 11, 2, 14, 8]
+@end group
 @end example
 
 For the last characteristic factor @code{4} it holds that @code{a^4 = 1 (mod 15)} 
@@ -1322,21 +1349,29 @@ Examples:
 @c m : matrix([2,4,1],[3,1,4],[4,3,2]);
 @c zn_determinant(m, 5);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) m : matrix([1,3],[2,4]);
-                                [ 1  3 ]
-(%o1)                           [      ]
-                                [ 2  4 ]
+                            [ 1  3 ]
+(%o1)                       [      ]
+                            [ 2  4 ]
+@end group
+@group
 (%i2) zn_determinant(m, 5);
-(%o2)                               3
+(%o2)                           3
+@end group
+@group
 (%i3) m : matrix([2,4,1],[3,1,4],[4,3,2]);
-                               [ 2  4  1 ]
-                               [         ]
-(%o3)                          [ 3  1  4 ]
-                               [         ]
-                               [ 4  3  2 ]
+                           [ 2  4  1 ]
+                           [         ]
+(%o3)                      [ 3  1  4 ]
+                           [         ]
+                           [ 4  3  2 ]
+@end group
+@group
 (%i4) zn_determinant(m, 5);
-(%o4)                               0
+(%o4)                           0
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1377,21 +1412,29 @@ Example:
 @c mi : zn_invert_by_lu(m, 5);
 @c matrixmap(lambda([a], mod(a, 5)), m . mi);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) m : matrix([1,3],[2,4]);
-                                [ 1  3 ]
-(%o1)                           [      ]
-                                [ 2  4 ]
+                            [ 1  3 ]
+(%o1)                       [      ]
+                            [ 2  4 ]
+@end group
+@group
 (%i2) zn_determinant(m, 5);
-(%o2)                               3
+(%o2)                           3
+@end group
+@group
 (%i3) mi : zn_invert_by_lu(m, 5);
-                                [ 3  4 ]
-(%o3)                           [      ]
-                                [ 1  2 ]
+                            [ 3  4 ]
+(%o3)                       [      ]
+                            [ 1  2 ]
+@end group
+@group
 (%i4) matrixmap(lambda([a], mod(a, 5)), m . mi);
-                                [ 1  0 ]
-(%o4)                           [      ]
-                                [ 0  1 ]
+                            [ 1  0 ]
+(%o4)                       [      ]
+                            [ 0  1 ]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1441,24 +1484,40 @@ Examples:
 @c powers_5 : makelist(power_mod(5,x,n), x, 0, ord_5 - 1);
 @c zn_log(9, 5, n);
 @c ===end===
-@example
+@example maxima
 (%i1) n : 22$
+@group
 (%i2) g : zn_primroot(n);
-(%o2)                               7
+(%o2)                           7
+@end group
+@group
 (%i3) ord_7 : zn_order(7, n);
-(%o3)                              10
+(%o3)                          10
+@end group
+@group
 (%i4) powers_7 : makelist(power_mod(g, x, n), x, 0, ord_7 - 1);
-(%o4)              [1, 7, 5, 13, 3, 21, 15, 17, 9, 19]
+(%o4)          [1, 7, 5, 13, 3, 21, 15, 17, 9, 19]
+@end group
+@group
 (%i5) zn_log(9, g, n);
-(%o5)                               8
+(%o5)                           8
+@end group
+@group
 (%i6) map(lambda([x], zn_log(x, g, n)), powers_7);
-(%o6)                [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+(%o6)            [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+@end group
+@group
 (%i7) ord_5 : zn_order(5, n);
-(%o7)                               5
+(%o7)                           5
+@end group
+@group
 (%i8) powers_5 : makelist(power_mod(5,x,n), x, 0, ord_5 - 1);
-(%o8)                       [1, 5, 3, 15, 9]
+(%o8)                   [1, 5, 3, 15, 9]
+@end group
+@group
 (%i9) zn_log(9, 5, n);
-(%o9)                               4
+(%o9)                           4
+@end group
 @end example
 
 The optional fourth argument must be of the same form as the list returned by 
@@ -1553,29 +1612,33 @@ elements in (Z/@var{n}Z).
 @c zn_mult_table(8);
 @c zn_mult_table(8, all);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) zn_mult_table(8);
-                                [ 1  3  5  7 ]
-                                [            ]
-                                [ 3  1  7  5 ]
-(%o1)                           [            ]
-                                [ 5  7  1  3 ]
-                                [            ]
-                                [ 7  5  3  1 ]
+                         [ 1  3  5  7 ]
+                         [            ]
+                         [ 3  1  7  5 ]
+(%o1)                    [            ]
+                         [ 5  7  1  3 ]
+                         [            ]
+                         [ 7  5  3  1 ]
+@end group
+@group
 (%i2) zn_mult_table(8, all);
-                            [ 1  2  3  4  5  6  7 ]
-                            [                     ]
-                            [ 2  4  6  0  2  4  6 ]
-                            [                     ]
-                            [ 3  6  1  4  7  2  5 ]
-                            [                     ]
-(%o2)                       [ 4  0  4  0  4  0  4 ]
-                            [                     ]
-                            [ 5  2  7  4  1  6  3 ]
-                            [                     ]
-                            [ 6  4  2  0  6  4  2 ]
-                            [                     ]
-                            [ 7  6  5  4  3  2  1 ]
+                     [ 1  2  3  4  5  6  7 ]
+                     [                     ]
+                     [ 2  4  6  0  2  4  6 ]
+                     [                     ]
+                     [ 3  6  1  4  7  2  5 ]
+                     [                     ]
+(%o2)                [ 4  0  4  0  4  0  4 ]
+                     [                     ]
+                     [ 5  2  7  4  1  6  3 ]
+                     [                     ]
+                     [ 6  4  2  0  6  4  2 ]
+                     [                     ]
+                     [ 7  6  5  4  3  2  1 ]
+@end group
 @end example
 
 If @var{gcd} is an integer, row and column headings are added for better readability. 
@@ -1592,45 +1655,51 @@ the top left corner, just like in table @code{T9}.
 @c T9: zn_mult_table(36/4);
 @c T36_4: matrixmap(lambda([x], solve_congruences([0,x],[4,9])), T9);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) T36_4: zn_mult_table(36,4);
-                        [ *   4   8   16  20  28  32 ]
-                        [                            ]
-                        [ 4   16  32  28  8   4   20 ]
-                        [                            ]
-                        [ 8   32  28  20  16  8   4  ]
-                        [                            ]
-(%o1)                   [ 16  28  20  4   32  16  8  ]
-                        [                            ]
-                        [ 20  8   16  32  4   20  28 ]
-                        [                            ]
-                        [ 28  4   8   16  20  28  32 ]
-                        [                            ]
-                        [ 32  20  4   8   28  32  16 ]
+                 [ *   4   8   16  20  28  32 ]
+                 [                            ]
+                 [ 4   16  32  28  8   4   20 ]
+                 [                            ]
+                 [ 8   32  28  20  16  8   4  ]
+                 [                            ]
+(%o1)            [ 16  28  20  4   32  16  8  ]
+                 [                            ]
+                 [ 20  8   16  32  4   20  28 ]
+                 [                            ]
+                 [ 28  4   8   16  20  28  32 ]
+                 [                            ]
+                 [ 32  20  4   8   28  32  16 ]
+@end group
+@group
 (%i2) T9: zn_mult_table(36/4);
-                             [ 1  2  4  5  7  8 ]
-                             [                  ]
-                             [ 2  4  8  1  5  7 ]
-                             [                  ]
-                             [ 4  8  7  2  1  5 ]
-(%o2)                        [                  ]
-                             [ 5  1  2  7  8  4 ]
-                             [                  ]
-                             [ 7  5  1  8  4  2 ]
-                             [                  ]
-                             [ 8  7  5  4  2  1 ]
+                      [ 1  2  4  5  7  8 ]
+                      [                  ]
+                      [ 2  4  8  1  5  7 ]
+                      [                  ]
+                      [ 4  8  7  2  1  5 ]
+(%o2)                 [                  ]
+                      [ 5  1  2  7  8  4 ]
+                      [                  ]
+                      [ 7  5  1  8  4  2 ]
+                      [                  ]
+                      [ 8  7  5  4  2  1 ]
+@end group
+@group
 (%i3) T36_4: matrixmap(lambda([x], solve_congruences([0,x],[4,9])), T9);
-                          [ 28  20  4   32  16  8  ]
-                          [                        ]
-                          [ 20  4   8   28  32  16 ]
-                          [                        ]
-                          [ 4   8   16  20  28  32 ]
-(%o3)                     [                        ]
-                          [ 32  28  20  16  8   4  ]
-                          [                        ]
-                          [ 16  32  28  8   4   20 ]
-                          [                        ]
-                          [ 8   16  32  4   20  28 ]
+                   [ 28  20  4   32  16  8  ]
+                   [                        ]
+                   [ 20  4   8   28  32  16 ]
+                   [                        ]
+                   [ 4   8   16  20  28  32 ]
+(%o3)              [                        ]
+                   [ 32  28  20  16  8   4  ]
+                   [                        ]
+                   [ 16  32  28  8   4   20 ]
+                   [                        ]
+                   [ 8   16  32  4   20  28 ]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1672,21 +1741,26 @@ with @var{n} from @code{1} to @code{6}.
 @c zn_power_table(14);
 @c makelist(zn_nth_root(1,n,14), n,1,6);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) zn_power_table(14);
-                         [ 1   1   1   1   1   1 ]
-                         [                       ]
-                         [ 3   9   13  11  5   1 ]
-                         [                       ]
-                         [ 5   11  13  9   3   1 ]
-(%o1)                    [                       ]
-                         [ 9   11  1   9   11  1 ]
-                         [                       ]
-                         [ 11  9   1   11  9   1 ]
-                         [                       ]
-                         [ 13  1   13  1   13  1 ]
+                    [ 1   1   1   1   1   1 ]
+                    [                       ]
+                    [ 3   9   13  11  5   1 ]
+                    [                       ]
+                    [ 5   11  13  9   3   1 ]
+(%o1)               [                       ]
+                    [ 9   11  1   9   11  1 ]
+                    [                       ]
+                    [ 11  9   1   11  9   1 ]
+                    [                       ]
+                    [ 13  1   13  1   13  1 ]
+@end group
+@group
 (%i2) makelist(zn_nth_root(1,n,14), n,1,6);
-(%o2)  [[1], [1, 13], [1, 9, 11], [1, 13], [1], [1, 3, 5, 9, 11, 13]]
+(%o2) [[1], [1, 13], [1, 9, 11], [1, 13], [1], 
+                                            [1, 3, 5, 9, 11, 13]]
+@end group
 @end example
 
 In the following example @var{x} is not coprime to @var{m}, 
@@ -1749,17 +1823,15 @@ In this case @code{zn_nth_root} effectively performs CRT-RSA.
 @c zs: flatten(map(lambda([y], zn_nth_root(y,e,N)), ys))$
 @c is(zs = xs);
 @c ===end===
-@example
+@example maxima
 (%i1) [p,q,e]: [5,7,17]$  N: p*q$
-
 (%i3) xs: makelist(x,x,0,N-1)$
-
 (%i4) ys: map(lambda([x],power_mod(x,e,N)),xs)$
-
 (%i5) zs: flatten(map(lambda([y], zn_nth_root(y,e,N)), ys))$
-
+@group
 (%i6) is(zs = xs);
-(%o6)                             true
+(%o6)                         true
+@end group
 @end example
 
 In the following example the factorization of the modulus is known 
@@ -1822,22 +1894,36 @@ Examples:
 @c map(lambda([x], ord_7/gcd(x,ord_7)), makelist(i,i,0,ord_7-1));
 @c totient(totient(n));
 @c ===end===
-@example
+@example maxima
 (%i1) n: 22$
+@group
 (%i2) g: zn_primroot(n);
-(%o2)                            7
+(%o2)                           7
+@end group
+@group
 (%i3) units_22: sublist(makelist(i,i,1,21), lambda([x], gcd(x,n)=1));
 (%o3)          [1, 3, 5, 7, 9, 13, 15, 17, 19, 21]
+@end group
+@group
 (%i4) (ord_7: zn_order(7, n)) = totient(n);
 (%o4)                        10 = 10
+@end group
+@group
 (%i5) powers_7: makelist(power_mod(g,i,n), i,0,ord_7 - 1);
 (%o5)          [1, 7, 5, 13, 3, 21, 15, 17, 9, 19]
+@end group
+@group
 (%i6) map(lambda([x], zn_order(x, n)), powers_7);
 (%o6)          [1, 10, 5, 10, 5, 2, 5, 10, 5, 10]
+@end group
+@group
 (%i7) map(lambda([x], ord_7/gcd(x,ord_7)), makelist(i,i,0,ord_7-1));
-(%o7)         [1, 10, 5, 10, 5, 2, 5, 10, 5, 10]
+(%o7)          [1, 10, 5, 10, 5, 2, 5, 10, 5, 10]
+@end group
+@group
 (%i8) totient(totient(n));
-(%o8)                          4
+(%o8)                           4
+@end group
 @end example
 
 The optional third argument must be of the same form as the list returned by 
@@ -1850,16 +1936,24 @@ The optional third argument must be of the same form as the list returned by
 @c is( (ord_3 : zn_order(g, p, ifs)) = totient(p) );
 @c map(lambda([x], ord_3/zn_order(x,p,ifs)), makelist(i,i,2,15));
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) (p : 2^142 + 217, primep(p));
 (%o1)                         true
+@end group
 (%i2) ifs: ifactors( totient(p) )$
+@group
 (%i3) g: zn_primroot(p, ifs);
 (%o3)                           3
+@end group
+@group
 (%i4) is( (ord_3 : zn_order(g, p, ifs)) = totient(p) );
 (%o4)                         true
+@end group
+@group
 (%i5) map(lambda([x], ord_3/zn_order(x,p,ifs)), makelist(i,i,2,15));
 (%o5)    [22, 1, 44, 10, 5, 2, 22, 2, 8, 2, 1, 1, 20, 1]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2028,36 +2122,71 @@ Examples:
 @code{zn_primroot} computes the smallest primitive root modulo @var{n} or returns 
 @code{false}.
 
-@example
+@c ===beg===
+@c n : 14$
+@c g : zn_primroot(n);
+@c zn_order(g, n) = totient(n);
+@c n : 15$
+@c zn_primroot(n);
+@c ===end===
+@example maxima
 (%i1) n : 14$
+@group
 (%i2) g : zn_primroot(n);
-(%o2)                               3
+(%o2)                           3
+@end group
+@group
 (%i3) zn_order(g, n) = totient(n);
-(%o3)                             6 = 6
+(%o3)                         6 = 6
+@end group
 (%i4) n : 15$
+@group
 (%i5) zn_primroot(n);
-(%o5)                             false
+(%o5)                         false
+@end group
 @end example
 
 The optional second argument must be of the same form as the list returned by 
 @code{ifactors(totient(n))}.
 
-@example
+@c NOTE:  This is a bit slow.  I think the main cause is running
+@c ifactors.
+@c
+@c ===beg===
+@c (p : 2^142 + 217, primep(p));
+@c ifs : ifactors( totient(p) )$
+@c g : zn_primroot(p, ifs);
+@c [time(%o2), time(%o3)];
+@c is(zn_order(g, p, ifs) = p - 1);
+@c n : 2^142 + 216$
+@c ifs : ifactors(totient(n))$
+@c zn_primroot(n, ifs), zn_primroot_limit : 200, zn_primroot_verbose : true;
+@c ===end===
+@example maxima
+@group
 (%i1) (p : 2^142 + 217, primep(p));
-(%o1)                             true
+(%o1)                         true
+@end group
 (%i2) ifs : ifactors( totient(p) )$
+@group
 (%i3) g : zn_primroot(p, ifs);
-(%o3)                               3
+(%o3)                           3
+@end group
+@group
 (%i4) [time(%o2), time(%o3)];
-(%o4)                    [[15.556972], [0.004]]
+(%o4)                    [[3.2], [0.0]]
+@end group
+@group
 (%i5) is(zn_order(g, p, ifs) = p - 1);
-(%o5)                             true
+(%o5)                         true
+@end group
 (%i6) n : 2^142 + 216$
 (%i7) ifs : ifactors(totient(n))$
-(%i8) zn_primroot(n, ifs), 
-      zn_primroot_limit : 200, zn_primroot_verbose : true;
+@group
+(%i8) zn_primroot(n, ifs), zn_primroot_limit : 200, zn_primroot_verbose : true;
 `zn_primroot' stopped at zn_primroot_limit = 200
-(%o8)                             false
+(%o8)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -2100,29 +2229,56 @@ Examples:
 
 @code{zn_primroot_p} as a predicate function.
 
-@example
+@c ===beg===
+@c n : 14$
+@c units_14 : sublist(makelist(i,i,1,13), lambda([i], gcd(i, n) = 1));
+@c zn_primroot_p(13, n);
+@c sublist(units_14, lambda([x], zn_primroot_p(x, n)));
+@c map(lambda([x], zn_order(x, n)), units_14);
+@c ===end===
+@example maxima
 (%i1) n : 14$
+@group
 (%i2) units_14 : sublist(makelist(i,i,1,13), lambda([i], gcd(i, n) = 1));
-(%o2)                     [1, 3, 5, 9, 11, 13]
+(%o2)                 [1, 3, 5, 9, 11, 13]
+@end group
+@group
 (%i3) zn_primroot_p(13, n);
-(%o3)                            false
+(%o3)                         false
+@end group
+@group
 (%i4) sublist(units_14, lambda([x], zn_primroot_p(x, n)));
-(%o4)                            [3, 5]
+(%o4)                        [3, 5]
+@end group
+@group
 (%i5) map(lambda([x], zn_order(x, n)), units_14);
-(%o5)                      [1, 6, 6, 3, 3, 2]
+(%o5)                  [1, 6, 6, 3, 3, 2]
+@end group
 @end example
 
 The optional third argument must be of the same form as the list returned by 
 @code{ifactors(totient(n))}.
 
-@example
+@c ===beg===
+@c (p: 2^142 + 217, primep(p));
+@c ifs: ifactors( totient(p) )$
+@c sublist(makelist(i,i,1,50), lambda([x], zn_primroot_p(x,p,ifs)));
+@c [time(%o2), time(%o3)];
+@c ===end===
+@example maxima
+@group
 (%i1) (p: 2^142 + 217, primep(p));
 (%o1)                         true
+@end group
 (%i2) ifs: ifactors( totient(p) )$
+@group
 (%i3) sublist(makelist(i,i,1,50), lambda([x], zn_primroot_p(x,p,ifs)));
 (%o3)  [3, 12, 13, 15, 21, 24, 26, 27, 29, 33, 38, 42, 48]
+@end group
+@group
 (%i4) [time(%o2), time(%o3)];
-(%o4)                  [[7.748484], [0.036002]]
+(%o4)                   [[3.01], [0.03]]
+@end group
 @end example
 
 @opencatbox{Categories:}
commit b9389997f2428d79151e6e8e0aacc39d9e01905d
Author: Raymond Toy <toy...@gm...>
Date:   Tue Sep 2 15:32:48 2025 -0700
    Add comment blocks for examples and regenerate them
    
    Also marked some examples with "maxima" to get syntax highlighting.
    These particular ones don't get code blocks since they're not really
    code examples to be executed.
    
    There are still examples that need comment blocks so they can be
    regenerated.
diff --git a/doc/info/Number.texi b/doc/info/Number.texi
index 58cd02b0c..9d4fb32d9 100644
--- a/doc/info/Number.texi
+++ b/doc/info/Number.texi
@@ -926,6 +926,12 @@ Uses a modular algorithm to compute @code{a^n mod m}
 where @var{a} and @var{n} are integers and @var{m} is a positive integer.
 If @var{n} is negative, @code{inv_mod} is used to find the modular inverse.
 
+@c ===beg===
+@c power_mod(3, 15, 5);
+@c mod(3^15,5);
+@c power_mod(2, -1, 5);
+@c inv_mod(2,5);
+@c ===end===
 @example
 (%i1) power_mod(3, 15, 5);
 (%o1)                          2
@@ -985,6 +991,9 @@ Number of Miller-Rabin's tests used in @code{primep}.
 
 Returns the list of all primes from @var{start} to @var{end}.
 
+@c ===beg===
+@c primes(3, 7);
+@c ===end===
 @example
 (%i1) primes(3, 7);
 (%o1)                     [3, 5, 7]
@@ -1001,6 +1010,9 @@ Returns the list of all primes from @var{start} to @var{end}.
 
 Returns the greatest prime smaller than @var{n}.
 
+@c ===beg===
+@c prev_prime(27);
+@c ===end===
 @example
 (%i1) prev_prime(27);
 (%o1)                       23
@@ -1020,6 +1032,10 @@ Returns the principal unit of the real quadratic number field
 i.e., the element whose norm is unity.
 This amounts to solving Pell's equation @code{a^2 - @var{n} b^2 = 1}.
 
+@c ===beg===
+@c qunit (17);
+@c expand (% * (sqrt(17) - 4));
+@c ===end===
 @example
 (%i1) qunit (17);
 (%o1)                     sqrt(17) + 4
@@ -1188,18 +1204,36 @@ Examples:
 The multiplication group modulo @code{14} is cyclic and its @code{6} elements 
 can be generated by a primitive root.
 
-@example
+@c ===beg===
+@c [zn_characteristic_factors(14), phi: totient(14)];
+@c [zn_factor_generators(14), g: zn_primroot(14)];
+@c M14: makelist(power_mod(g,i,14), i,0,phi-1);
+@c ===end===
+@example maxima
+@group
 (%i1) [zn_characteristic_factors(14), phi: totient(14)];
-(%o1)                              [[6], 6]
+(%o1)                       [[6], 6]
+@end group
+@group
 (%i2) [zn_factor_generators(14), g: zn_primroot(14)];
-(%o2)                              [[3], 3]
+(%o2)                       [[3], 3]
+@end group
+@group
 (%i3) M14: makelist(power_mod(g,i,14), i,0,phi-1);
-(%o3)                         [1, 3, 9, 13, 11, 5]
+(%o3)                 [1, 3, 9, 13, 11, 5]
+@end group
 @end example
 
 The multiplication group modulo @code{15} is not cyclic and its @code{8} elements 
 can be generated by two factor generators.
 
+@c ===beg===
+@c [[f1,f2]: zn_characteristic_factors(15), totient(15)];
+@c [[g1,g2]: zn_factor_generators(15), zn_primroot(15)];
+@c UG1: makelist(power_mod(g1,i,15), i,0,f1-1);
+@c UG2: makelist(power_mod(g2,i,15), i,0,f2-1);
+@c M15: create_list(mod(i*j,15), i,UG1, j,UG2);
+@c ===end===
 @example
 (%i1) [[f1,f2]: zn_characteristic_factors(15), totient(15)];
 (%o1)                             [[2, 4], 8]
@@ -1219,25 +1253,33 @@ for all @code{a} in @code{M15}.
 @code{M15} has two characteristic factors and therefore @code{8/2^2} quadratic residues, 
 and each of these has @code{2^2} square roots.
 
-@example
-(%i6) zn_power_table(15);
-                               [ 1   1  1   1 ]
-                               [              ]
-                               [ 2   4  8   1 ]
-                               [              ]
-                               [ 4   1  4   1 ]
-                               [              ]
-                               [ 7   4  13  1 ]
-(%o6)                          [              ]
-                               [ 8   4  2   1 ]
-                               [              ]
-                               [ 11  1  11  1 ]
-                               [              ]
-                               [ 13  4  7   1 ]
-                               [              ]
-                               [ 14  1  14  1 ]
-(%i7) map(lambda([i], zn_nth_root(i,2,15)), [1,4]);
-(%o7)                   [[1, 4, 11, 14], [2, 7, 8, 13]]
+@c ===beg===
+@c zn_power_table(15);
+@c map(lambda([i], zn_nth_root(i,2,15)), [1,4]);
+@c ===end===
+@example maxima
+@group
+(%i1) zn_power_table(15);
+                        [ 1   1  1   1 ]
+                        [              ]
+                        [ 2   4  8   1 ]
+                        [              ]
+                        [ 4   1  4   1 ]
+                        [              ]
+                        [ 7   4  13  1 ]
+(%o1)                   [              ]
+                        [ 8   4  2   1 ]
+                        [              ]
+                        [ 11  1  11  1 ]
+                        [              ]
+                        [ 13  4  7   1 ]
+                        [              ]
+                        [ 14  1  14  1 ]
+@end group
+@group
+(%i2) map(lambda([i], zn_nth_root(i,2,15)), [1,4]);
+(%o2)            [[1, 4, 11, 14], [2, 7, 8, 13]]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1274,6 +1316,12 @@ See also @mrefdot{zn_invert_by_lu}
 
 Examples:
 
+@c ===beg===
+@c m : matrix([1,3],[2,4]);
+@c zn_determinant(m, 5);
+@c m : matrix([2,4,1],[3,1,4],[4,3,2]);
+@c zn_determinant(m, 5);
+@c ===end===
 @example
 (%i1) m : matrix([1,3],[2,4]);
                                 [ 1  3 ]
@@ -1323,6 +1371,12 @@ See also @mrefdot{zn_determinant}
 
 Example:
 
+@c ===beg===
+@c m : matrix([1,3],[2,4]);
+@c zn_determinant(m, 5);
+@c mi : zn_invert_by_lu(m, 5);
+@c matrixmap(lambda([a], mod(a, 5)), m . mi);
+@c ===end===
 @example
 (%i1) m : matrix([1,3],[2,4]);
                                 [ 1  3 ]
@@ -1376,6 +1430,17 @@ Examples:
 
 @code{zn_log (a, g, n)} solves the congruence @code{g^x = a mod n}.
 
+@c ===beg===
+@c n : 22$
+@c g : zn_primroot(n);
+@c ord_7 : zn_order(7, n);
+@c powers_7 : makelist(power_mod(g, x, n), x, 0, ord_7 - 1);
+@c zn_log(9, g, n);
+@c map(lambda([x], zn_log(x, g, n)), powers_7);
+@c ord_5 : zn_order(5, n);
+@c powers_5 : makelist(power_mod(5,x,n), x, 0, ord_5 - 1);
+@c zn_log(9, 5, n);
+@c ===end===
 @example
 (%i1) n : 22$
 (%i2) g : zn_primroot(n);
@@ -1400,24 +1465,49 @@ The optional fourth argument must be of the same form as the list returned by
 @code{ifactors(zn_order(g))}.
 The running time primarily depends on the bitlength of the totient's greatest prime factor.
 
-@example
+@c ===beg===
+@c (p : 2^127-1, primep(p));
+@c ifs : ifactors(p - 1)$
+@c g : zn_primroot(p, ifs);
+@c a : power_mod(g, 4711, p)$
+@c zn_log(a, g, p, ifs);
+@c f_max : last(ifs);  
+@c ord_5 : zn_order(5,p,ifs)$
+@c (p - 1)/ord_5;
+@c ifs_5 : ifactors(ord_5)$
+@c a : power_mod(5, 4711, p)$
+@c zn_log(a, 5, p, ifs_5);
+@c ===end===
+@example maxima
+@group
 (%i1) (p : 2^127-1, primep(p));
-(%o1)                             true
+(%o1)                         true
+@end group
 (%i2) ifs : ifactors(p - 1)$
+@group
 (%i3) g : zn_primroot(p, ifs);
-(%o3)                              43
+(%o3)                          43
+@end group
 (%i4) a : power_mod(g, 4711, p)$
+@group
 (%i5) zn_log(a, g, p, ifs);
-(%o5)                             4711
-(%i6) f_max : last(ifs);  
-(%o6)                       [77158673929, 1]
+(%o5)                         4711
+@end group
+@group
+(%i6) f_max : last(ifs);
+(%o6)                   [77158673929, 1]
+@end group
 (%i7) ord_5 : zn_order(5,p,ifs)$
+@group
 (%i8) (p - 1)/ord_5;
-(%o8)                              73
+(%o8)                          73
+@end group
 (%i9) ifs_5 : ifactors(ord_5)$
 (%i10) a : power_mod(5, 4711, p)$
+@group
 (%i11) zn_log(a, 5, p, ifs_5);
-(%o11)                            4711
+(%o11)                        4711
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1459,6 +1549,10 @@ each row and column contains every element, the tables are symmetric, etc..
 If @var{gcd} is set to @code{all}, the table is printed for all non-zero 
 elements in (Z/@var{n}Z).
 
+@c ===beg===
+@c zn_mult_table(8);
+@c zn_mult_table(8, all);
+@c ===end===
 @example
 (%i1) zn_mult_table(8);
                                 [ 1  3  5  7 ]
@@ -1493,6 +1587,11 @@ identity builds a table which is easy to read. The mapping is accomplished via C
 In the second version of @code{T36_4} the identity, here @code{28}, is placed in 
 the top left corner, just like in table @code{T9}. 
 
+@c ===beg===
+@c T36_4: zn_mult_table(36,4);
+@c T9: zn_mult_table(36/4);
+@c T36_4: matrixmap(lambda([x], solve_congruences([0,x],[4,9])), T9);
+@c ===end===
 @example
 (%i1) T36_4: zn_mult_table(36,4);
                         [ *   4   8   16  20  28  32 ]
@@ -1569,6 +1668,10 @@ A power table of the multiplication group modulo @code{14}
 followed by a list of lists containing all @var{n}-th roots of @code{1} 
 with @var{n} from @code{1} to @code{6}.
 
+@c ===beg===
+@c zn_power_table(14);
+@c makelist(zn_nth_root(1,n,14), n,1,6);
+@c ===end===
 @example
 (%i1) zn_power_table(14);
                          [ 1   1   1   1   1   1 ]
@@ -1597,25 +1700,36 @@ Here @code{zn_power_table} shows all residues @code{x} in (Z/63Z)
 with @code{gcd(x,63) = 9}. This subgroup is isomorphic to (Z/7Z)*  
 and its identity @code{36} is computed via CRT.
 
-@example
+@c ===beg===
+@c m: 7*9$
+@c zn_power_table(m,9);
+@c zn_nth_root(27,3,m);
+@c id7:1$  id63_9: solve_congruences([id7,0],[7,9]);
+@c ===end===
+@example maxima
 (%i1) m: 7*9$
-
+@group
 (%i2) zn_power_table(m,9);
-                         [ 9   18  36  9   18  36 ]
-                         [                        ]
-                         [ 18  9   36  18  9   36 ]
-                         [                        ]
-                         [ 27  36  27  36  27  36 ]
-(%o2)                    [                        ]
-                         [ 36  36  36  36  36  36 ]
-                         [                        ]
-                         [ 45  9   27  18  54  36 ]
-                         [                        ]
-                         [ 54  18  27  9   45  36 ]
+                   [ 9   18  36  9   18  36 ]
+                   [                        ]
+                   [ 18  9   36  18  9   36 ]
+                   [                        ]
+                   [ 27  36  27  36  27  36 ]
+(%o2)              [                        ]
+                   [ 36  36  36  36  36  36 ]
+                   [                        ]
+                   [ 45  9   27  18  54  36 ]
+                   [                        ]
+                   [ 54  18  27  9   45  36 ]
+@end group
+@group
 (%i3) zn_nth_root(27,3,m);
-(%o3)                           [27, 45, 54]
+(%o3)                     [27, 45, 54]
+@end group
+@group
 (%i4) id7:1$  id63_9: solve_congruences([id7,0],[7,9]);
-(%o5)                                36
+(%o5)                          36
+@end group
 @end example
 
 In the following RSA-like example, where the modulus @code{N} is squarefree, 
@@ -1628,6 +1742,13 @@ The process of decryption needs the @code{e}-th root.
 In this case @code{zn_nth_root} effectively performs CRT-RSA. 
 (Please note that @code{flatten} removes braces but no solutions.)
 
+@c ===beg===
+@c [p,q,e]: [5,7,17]$  N: p*q$
+@c xs: makelist(x,x,0,N-1)$
+@c ys: map(lambda([x],power_mod(x,e,N)),xs)$
+@c zs: flatten(map(lambda([y], zn_nth_root(y,e,N)), ys))$
+@c is(zs = xs);
+@c ===end===
 @example
 (%i1) [p,q,e]: [5,7,17]$  N: p*q$
 
@@ -1644,17 +1765,25 @@ In this case @code{zn_nth_root} effectively performs CRT-RSA.
 In the following example the factorization of the modulus is known 
 and passed as the fourth argument.
 
-@example
+@c ===beg===
+@c p: 2^107-1$  q: 2^127-1$  N: p*q$
+@c ibase: obase: 16$
+@c msg: 11223344556677889900aabbccddeeff$
+@c enc: power_mod(msg, 10001, N);
+@c zn_nth_root(enc, 10001, N, [[p,1],[q,1]]);
+@c ===end===
+@example maxima
 (%i1) p: 2^107-1$  q: 2^127-1$  N: p*q$
-
 (%i4) ibase: obase: 16$
-
 (%i5) msg: 11223344556677889900aabbccddeeff$
-
+@group
 (%i6) enc: power_mod(msg, 10001, N);
-(%o6)    1a8db7892ae588bdc2be25dd5107a425001fe9c82161abc673241c8b383
+(%o6) 1A8DB7892AE588BDC2BE25DD5107A425001FE9C82161ABC673241C8B383
+@end group
+@group
 (%i7) zn_nth_root(enc, 10001, N, [[p,1],[q,1]]);
-(%o7)               [11223344556677889900aabbccddeeff]
+(%o7)          [11223344556677889900AABBCCDDEEFF]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -1683,6 +1812,16 @@ Examples:
 
 @code{zn_order} computes the order of the unit @var{x} in (Z/@var{n}Z)*.
 
+@c ===beg===
+@c n: 22$
+@c g: zn_primroot(n);
+@c units_22: sublist(makelist(i,i,1,21), lambda([x], gcd(x,n)=1));
+@c (ord_7: zn_order(7, n)) = totient(n);
+@c powers_7: makelist(power_mod(g,i,n), i,0,ord_7 - 1);
+@c map(lambda([x], zn_order(x, n)), powers_7);
+@c map(lambda([x], ord_7/gcd(x,ord_7)), makelist(i,i,0,ord_7-1));
+@c totient(totient(n));
+@c ===end===
 @example
 (%i1) n: 22$
 (%i2) g: zn_primroot(n);
@@ -1704,6 +1843,13 @@ Examples:
 The optional third argument must be of the same form as the list returned by 
 @code{ifactors(totient(n))}.
 
+@c ===beg===
+@c (p : 2^142 + 217, primep(p));
+@c ifs: ifactors( totient(p) )$
+@c g: zn_primroot(p, ifs);
+@c is( (ord_3 : zn_order(g, p, ifs)) = totient(p) );
+@c map(lambda([x], ord_3/zn_order(x,p,ifs)), makelist(i,i,2,15));
+@c ===end===
 @example
 (%i1) (p : 2^142 + 217, primep(p));
 (%o1)                         true
@@ -1759,33 +1905,56 @@ isomorphic to @code{G5}. @code{1} is the identity in @code{G5}.
 So are @code{1} resp. @code{6} the identities in @code{G10} resp. @code{G10_2}. 
 There are corresponding mappings for primitive roots, n-th roots, etc..
 
-@example
+@c ===beg===
+@c zn_power_table(10);
+@c zn_power_table(10,2);
+@c zn_power_table(10,5);
+@c zn_power_table(10,10);
+@c G5: [1,2,3,4];
+@c G10_2: map(lambda([x], solve_congruences([0,x],[2,5])), G5);
+@c G10: map(lambda([x], power_mod(3, zn_log(x,2,5), 10)), G5);
+@c ===end===
+@example maxima
+@group
 (%i1) zn_power_table(10);
-                              [ 1  1  1  1 ]
-                              [            ]
-                              [ 3  9  7  1 ]
-(%o1)                         [            ]
-                              [ 7  9  3  1 ]
-                              [            ]
-                              [ 9  1  9  1 ]
+                         [ 1  1  1  1 ]
+                         [            ]
+                         [ 3  9  7  1 ]
+(%o1)                    [            ]
+                         [ 7  9  3  1 ]
+                         [            ]
+                         [ 9  1  9  1 ]
+@end group
+@group
 (%i2) zn_power_table(10,2);
-                              [ 2  4  8  6 ]
-                              [            ]
-                              [ 4  6  4  6 ]
-(%o2)                         [            ]
-                              [ 6  6  6  6 ]
-                              [            ]
-                              [ 8  4  2  6 ]
+                         [ 2  4  8  6 ]
+                         [            ]
+                         [ 4  6  4  6 ]
+(%o2)                    [            ]
+                         [ 6  6  6  6 ]
+                         [            ]
+                         [ 8  4  2  6 ]
+@end group
+@group
 (%i3) zn_power_table(10,5);
-(%o3)                         [ 5  5  5  5 ]
+(%o3)                    [ 5  5  5  5 ]
+@end group
+@group
 (%i4) zn_power_table(10,10);
-(%o4)                         [ 0  0  0  0 ]
+(%o4)                    [ 0  0  0  0 ]
+@end group
+@group
 (%i5) G5: [1,2,3,4];
-(%o6)                          [1, 2, 3, 4]
+(%o5)                     [1, 2, 3, 4]
+@end group
+@group
 (%i6) G10_2: map(lambda([x], solve_congruences([0,x],[2,5])), G5);
-(%o6)                          [6, 2, 8, 4]
+(%o6)                     [6, 2, 8, 4]
+@end group
+@group
 (%i7) G10: map(lambda([x], power_mod(3, zn_log(x,2,5), 10)), G5);
-(%o7)                          [1, 3, 7, 9]
+(%o7)                     [1, 3, 7, 9]
+@end group
 @end example
 
 If @var{gcd} is set to @code{all}, the table contains powers of all elements 
@@ -1794,29 +1963,34 @@ in (Z/@var{n}Z).
 The third argument @var{max_exp} allows to set the highest exponent. 
 The following table shows a very small example of RSA.
 
-@example
-(%i1) N:2*5$ phi:totient(N)$ e:7$ d:inv_mod(e,phi)$
-
-(%i5) zn_power_table(N, all, e*d);
-      [ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 ]
-      [                                                               ]
-      [ 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 ]
-      [                                                               ]
-      [ 2  4  8  6  2  4  8  6  2  4  8  6  2  4  8  6  2  4  8  6  2 ]
-      [                                                               ]
-      [ 3  9  7  1  3  9  7  1  3  9  7  1  3  9  7  1  3  9  7  1  3 ]
-      [                                                               ]
-      [ 4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4 ]
-(%o5) [                                                               ]
-      [ 5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 ]
-      [                                                               ]
-      [ 6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6 ]
-      [                                                               ]
-      [ 7  9  3  1  7  9  3  1  7  9  3  1  7  9  3  1  7  9  3  1  7 ]
-      [                                                               ]
-      [ 8  4  2  6  8  4  2  6  8  4  2  6  8  4  2  6  8  4  2  6  8 ]
-      [                                                               ]
-      [ 9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9 ]
+@c ===beg===
+@c linel:100$ N:2*5$ phi:totient(N)$ e:7$ d:inv_mod(e,phi)$
+@c zn_power_table(N, all, e*d);
+@c ===end===
+@example maxima
+(%i1) linel:100$ N:2*5$ phi:totient(N)$ e:7$ d:inv_mod(e,phi)$
+@group
+(%i6) zn_power_table(N, all, e*d);
+                 [ 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 ]
+                 [                                                               ]
+                 [ 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 ]
+                 [                                                               ]
+                 [ 2  4  8  6  2  4  8  6  2  4  8  6  2  4  8  6  2  4  8  6  2 ]
+                 [                                                               ]
+                 [ 3  9  7  1  3  9  7  1  3  9  7  1  3  9  7  1  3  9  7  1  3 ]
+                 [                                                               ]
+                 [ 4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4  6  4 ]
+(%o6)            [                                                               ]
+                 [ 5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5 ]
+                 [                                                               ]
+                 [ 6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6 ]
+                 [                                                               ]
+                 [ 7  9  3  1  7  9  3  1  7  9  3  1  7  9  3  1  7  9  3  1  7 ]
+                 [                                                               ]
+                 [ 8  4  2  6  8  4  2  6  8  4  2  6  8  4  2  6  8  4  2  6  8 ]
+                 [                                                               ]
+                 [ 9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9  1  9 ]
+@end group
 @end example
 
 @opencatbox{Categories:}
commit c28dd2bb70e067033a4b6d78b15fcda0c6a271f8
Author: Raymond Toy <toy...@gm...>
Date:   Mon Sep 1 19:05:11 2025 -0700
    Add comment blocks for examples and regenerate them
    
    Also marked some examples with "maxima" to get syntax highlighting.
    These particular ones don't get code blocks since they're not really
    code examples to be executed.
    
    There are still examples that need comment blocks so they can be
    regenerated.
diff --git a/doc/info/Number.texi b/doc/info/Number.texi
index a89e11cf5..58cd02b0c 100644
--- a/doc/info/Number.texi
+++ b/doc/info/Number.texi
@@ -19,17 +19,27 @@ Bernoulli numbers equal to zero are suppressed if @code{zerobern} is
 
 See also @mrefdot{burn}
 
-@example
+@c ===beg===
+@c zerobern: true$
+@c map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
+@c zerobern: false$
+@c map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
+@c ===end===
+@example maxima
 (%i1) zerobern: true$
+@group
 (%i2) map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
-                      1  1       1      1        1
-(%o2)           [1, - -, -, 0, - --, 0, --, 0, - --]
-                      2  6       30     42       30
+                    1  1       1      1        1
+(%o2)         [1, - -, -, 0, - --, 0, --, 0, - --]
+                    2  6       30     42       30
+@end group
 (%i3) zerobern: false$
+@group
 (%i4) map (bern, [0, 1, 2, 3, 4, 5, 6, 7, 8]);
-                      1  1    1   1     1   5     691   7
-(%o4)           [1, - -, -, - --, --, - --, --, - ----, -]
-                      2  6    30  42    30  66    2730  6
+                 1  1    1   1     1   5     691   7
+(%o4)      [1, - -, -, - --, --, - --, --, - ----, -]
+                 2  6    30  42    30  66    2730  6
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -133,21 +143,44 @@ Solves the system of congruences @code{x = r_1 mod m_1}, @dots{}, @code{x = r_n
 The remainders @var{r_n} may be arbitrary integers while the moduli @var{m_n} have to be 
 positive and pairwise coprime integers.
 
-@example
+@c ===beg===
+@c mods : [1000, 1001, 1003, 1007];
+@c lreduce('gcd, mods);
+@c x : random(apply("*", mods));
+@c rems : map(lambda([z], mod(x, z)), mods);
+@c solve_congruences(rems, mods);
+@c solve_congruences([1, 2], [3, n]);
+@c %, n = 4;
+@c ===end===
+@example maxima
+@group
 (%i1) mods : [1000, 1001, 1003, 1007];
-(%o1)                   [1000, 1001, 1003, 1007]
+(%o1)               [1000, 1001, 1003, 1007]
+@end group
+@group
 (%i2) lreduce('gcd, mods);
-(%o2)                               1
+(%o2)                           1
+@end group
+@group
 (%i3) x : random(apply("*", mods));
-(%o3)                         685124877004
+(%o3)                     685124877004
+@end group
+@group
 (%i4) rems : map(lambda([z], mod(x, z)), mods);
-(%o4)                       [4, 568, 54, 624]
+(%o4)                   [4, 568, 54, 624]
+@end group
+@group
 (%i5) solve_congruences(rems, mods);
-(%o5)                         685124877004
+(%o5)                     685124877004
+@end group
+@group
 (%i6) solve_congruences([1, 2], [3, n]);
-(%o6)               solve_congruences([1, 2], [3, n])
+(%o6)           solve_congruences([1, 2], [3, n])
+@end group
+@group
 (%i7) %, n = 4;
-(%o7)                              10
+(%o7)                          10
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -205,38 +238,67 @@ integers.
 @code{cflength} controls how many periods of the continued fraction
 are computed for algebraic, irrational numbers.
 
-@example
+@c ===beg===
+@c cflength: 1$
+@c cf ((1 + sqrt(5))/2);
+@c cflength: 2$
+@c cf ((1 + sqrt(5))/2);
+@c cflength: 3$
+@c cf ((1 + sqrt(5))/2);
+@c ===end===
+@example maxima
 (%i1) cflength: 1$
+@group
 (%i2) cf ((1 + sqrt(5))/2);
 (%o2)                    [1, 1, 1, 1, 2]
+@end group
 (%i3) cflength: 2$
+@group
 (%i4) cf ((1 + sqrt(5))/2);
 (%o4)               [1, 1, 1, 1, 1, 1, 1, 2]
+@end group
 (%i5) cflength: 3$
+@group
 (%i6) cf ((1 + sqrt(5))/2);
 (%o6)           [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]
+@end group
 @end example
 
 @item
 A continued fraction can be evaluated by evaluating the arithmetic
 representation returned by @mrefdot{cfdisrep}
 
-@example
+@c ===beg===
+@c cflength: 3$
+@c cfdisrep (cf (sqrt (3)))$
+@c ev (%, numer);
+@c ===end===
+@example maxima
 (%i1) cflength: 3$
 (%i2) cfdisrep (cf (sqrt (3)))$
+@group
 (%i3) ev (%, numer);
-(%o3)                   1.731707317073171
+(%o3)                  1.7317073170731707
+@end group
 @end example
 
 @item
 Maxima does not know about operations on continued fractions outside of
 @code{cf}.
 
-@example
+@c ===beg===
+@c cf ([1,1,1,1,1,2] * 3);
+@c cf ([1,1,1,1,1,2]) * 3;
+@c ===end===
+@example maxima
+@group
 (%i1) cf ([1,1,1,1,1,2] * 3);
 (%o1)                     [4, 1, 5, 2]
+@end group
+@group
 (%i2) cf ([1,1,1,1,1,2]) * 3;
 (%o2)                  [3, 3, 3, 3, 3, 6]
+@end group
 @end example
 
 @end itemize
@@ -257,9 +319,16 @@ Constructs and returns an ordinary arithmetic expression
 of the form @code{a + 1/(b + 1/(c + ...))}
 from the list representation of a continued fraction @code{[a, b, c, ...]}.
 
-@example
+@c ===beg===
+@c cf ([1, 2, -3] + [1, -2, 1]);
+@c cfdisrep (%);
+@c ===end===
+@example maxima
+@group
 (%i1) cf ([1, 2, -3] + [1, -2, 1]);
 (%o1)                     [1, 1, 1, 2]
+@end group
+@group
 (%i2) cfdisrep (%);
                                   1
 (%o2)                     1 + ---------
@@ -268,6 +337,7 @@ from the list representation of a continued fraction @code{[a, b, c, ...]}.
                                       1
                                   1 + -
                                       2
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -282,17 +352,27 @@ from the list representation of a continued fraction @code{[a, b, c, ...]}.
 Returns a matrix of the numerators and denominators of the last (column 1) and
 next-to-last (column 2) convergents of the continued fraction @var{x}.
 
-@example
+@c ===beg===
+@c cf (rat (ev (%pi, numer)));
+@c cfexpand (%); 
+@c %[1,1]/%[2,1], numer;
+@c ===end===
+@example maxima
+@group
 (%i1) cf (rat (ev (%pi, numer)));
-
-`rat' replaced 3.141592653589793 by 103993/33102 =3.141592653011902
-(%o1)                  [3, 7, 15, 1, 292]
-(%i2) cfexpand (%); 
-                         [ 103993  355 ]
-(%o2)                    [             ]
-                         [ 33102   113 ]
+rat: replaced 3.141592653589793 by 80143857/25510582 = 3.1415926535897927
+(%o1)      [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14]
+@end group
+@group
+(%i2) cfexpand (%);
+                      [ 80143857  5419351 ]
+(%o2)                 [                   ]
+                      [ 25510582  1725033 ]
+@end group
+@group
 (%i3) %[1,1]/%[2,1], numer;
-(%o3)                   3.141592653011902
+(%o3)                  3.1415926535897927
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -309,16 +389,30 @@ Default value: 1
 function @code{cf} will give, as the value @code{cflength} times the period.
 Thus the default is to give one period.
 
-@example
+@c ===beg===
+@c cflength: 1$
+@c cf ((1 + sqrt(5))/2);
+@c cflength: 2$
+@c cf ((1 + sqrt(5))/2);
+@c cflength: 3$
+@c cf ((1 + sqrt(5))/2);
+@c ===end===
+@example maxima
 (%i1) cflength: 1$
+@group
 (%i2) cf ((1 + sqrt(5))/2);
 (%o2)                    [1, 1, 1, 1, 2]
+@end group
 (%i3) cflength: 2$
+@group
 (%i4) cf ((1 + sqrt(5))/2);
 (%o4)               [1, 1, 1, 1, 1, 1, 1, 2]
+@end group
 (%i5) cflength: 3$
+@group
 (%i6) cf ((1 + sqrt(5))/2);
 (%o6)           [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -337,15 +431,29 @@ raised to the @var{k}'th power.
 
 @code{divsum (@var{n})} returns the sum of the divisors of @var{n}.
 
-@example
+@c ===beg===
+@c divsum (12);
+@c 1 + 2 + 3 + 4 + 6 + 12;
+@c divsum (12, 2);
+@c 1^2 + 2^2 + 3^2 + 4^2 + 6^2 + 12^2;
+@c ===end===
+@example maxima
+@group
 (%i1) divsum (12);
 (%o1)                          28
+@end group
+@group
 (%i2) 1 + 2 + 3 + 4 + 6 + 12;
 (%o2)                          28
+@end group
+@group
 (%i3) divsum (12, 2);
 (%o3)                          210
+@end group
+@group
 (%i4) 1^2 + 2^2 + 3^2 + 4^2 + 6^2 + 12^2;
 (%o4)                          210
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -363,13 +471,23 @@ Euler numbers equal to zero are suppressed if @code{zerobern} is
 
 For the Euler-Mascheroni constant, see @code{%gamma}.
 
-@example
+@c ===beg===
+@c zerobern: true$
+@c map (euler, [0, 1, 2, 3, 4, 5, 6]);
+@c zerobern: false$
+@c map (euler, [0, 1, 2, 3, 4, 5, 6]);
+@c ===end===
+@example maxima
 (%i1) zerobern: true$
+@group
 (%i2) map (euler, [0, 1, 2, 3, 4, 5, 6]);
-(%o2)               [1, 0, - 1, 0, 5, 0, - 61]
+(%o2)              [1, 0, - 1, 0, 5, 0, - 61]
+@end group
 (%i3) zerobern: false$
+@group
 (%i4) map (euler, [0, 1, 2, 3, 4, 5, 6]);
-(%o4)               [1, - 1, 5, - 61, 1385, - 50521, 2702765]
+(%o4)       [1, - 1, 5, - 61, 1385, - 50521, 2702765]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -402,9 +520,14 @@ Returns the @var{n}'th Fibonacci number.
 @code{fib(0)} is equal to 0 and @code{fib(1)} equal to 1, and 
 @code{fib (-@var{n})} equal to @code{(-1)^(@var{n} + 1) * fib(@var{n})}.
 
-@example
+@c ===beg===
+@c map (fib, [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8]);
+@c ===end===
+@example maxima
+@group
 (%i1) map (fib, [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8]);
-(%o1)           [- 3, 2, - 1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21]
+(%o1)     [- 3, 2, - 1, 1, 0, 1, 1, 2, 3, 5, 8, 13, 21]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -482,13 +605,24 @@ the multiplicities of the computed prime factors. If @code{factors_only}
 is set to @code{true}, @code{ifactors} simply returns the list of 
 prime factors.
 
-@example
+@c ===beg===
+@c ifactors(51575319651600);
+@c apply("*", map(lambda([u], u[1]^u[2]), %));
+@c ifactors(51575319651600), factors_only : true;
+@c ===end===
+@example maxima
+@group
 (%i1) ifactors(51575319651600);
-(%o1)     [[2, 4], [3, 2], [5, 2], [1583, 1], [9050207, 1]]
+(%o1)   [[2, 4], [3, 2], [5, 2], [1583, 1], [9050207, 1]]
+@end group
+@group
 (%i2) apply("*", map(lambda([u], u[1]^u[2]), %));
-(%o2)                        51575319651600
+(%o2)                    51575319651600
+@end group
+@group
 (%i3) ifactors(51575319651600), factors_only : true;
-(%o3)                   [2, 3, 5, 1583, 9050207]
+(%o3)               [2, 3, 5, 1583, 9050207]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -511,15 +645,26 @@ The command @code{load("gcdex")} loads the function.
 
 Examples:
 
-@example
+@c ===beg===
+@c load("gcdex")$
+@c igcdex(30,18);
+@c igcdex(1526757668, 7835626735736);
+@c igcdex(fib(20), fib(21));
+@c ===end===
+@example maxima
 (%i1) load("gcdex")$
-
+@group
 (%i2) igcdex(30,18);
 (%o2)                      [- 1, 2, 6]
+@end group
+@group
 (%i3) igcdex(1526757668, 7835626735736);
 (%o3)            [845922341123, - 164826435, 4]
+@end group
+@group
 (%i4) igcdex(fib(20), fib(21));
 (%o4)                   [4181, - 2584, 1]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -533,10 +678,16 @@ Examples:
 
 Returns the integer @var{n}'th root of the absolute value of @var{x}.
 
-@example
+@c ===beg===
+@c l: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]$
+@c map (lambda ([a], inrt (10^a, 3)), l);
+@c ===end===
+@example maxima
 (%i1) l: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]$
+@group
 (%i2) map (lambda ([a], inrt (10^a, 3)), l);
 (%o2) [2, 4, 10, 21, 46, 100, 215, 464, 1000, 2154, 4641, 10000]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -552,13 +703,24 @@ Computes the inverse of @var{n} modulo @var{m}.
 @code{inv_mod (n,m)} returns @code{false}, 
 if @var{n} is a zero divisor modulo @var{m}.
 
-@example
+@c ===beg===
+@c inv_mod(3, 41);
+@c ratsimp(3^-1), modulus = 41;
+@c inv_mod(3, 42);
+@c ===end===
+@example maxima
+@group
 (%i1) inv_mod(3, 41);
-(%o1)                           14
+(%o1)                          14
+@end group
+@group
 (%i2) ratsimp(3^-1), modulus = 41;
-(%o2)                           14
+(%o2)                          14
+@end group
+@group
 (%i3) inv_mod(3, 42);
-(%o3)                          false
+(%o3)                         false
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -584,10 +746,16 @@ integer.
 
 Returns the Jacobi symbol of @var{p} and @var{q}.
 
-@example
+@c ===beg===
+@c l: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]$
+@c map (lambda ([a], jacobi (a, 9)), l);
+@c ===end===
+@example maxima
 (%i1) l: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]$
+@group
 (%i2) map (lambda ([a], jacobi (a, 9)), l);
 (%o2)         [1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0]
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -618,9 +786,14 @@ Returns the @var{n}'th Lucas number.
 in general, @code{lucas(@var{n}) = lucas(@var{n}-1) + lucas(@var{n}-2)}.  Also 
 @code{lucas(-@var{n})} is equal to @code{(-1)^(-@var{n}) * lucas(@var{n})}.
 
-@example
+@c ===beg===
+@c map (lucas, [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8]);
+@c ===end===
+@example maxima
+@group
 (%i1) map (lucas, [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8]);
 (%o1)    [7, - 4, 3, - 1, 2, 1, 3, 4, 7, 11, 18, 29, 47]
+@end group
 @end example
 
 
@@ -685,9 +858,14 @@ simplification rules:
 
 Returns the smallest prime bigger than @var{n}.
 
-@example
+@c ===beg===
+@c next_prime(27);
+@c ===end===
+@example maxima
+@group
 (%i1) next_prime(27);
-(%o1)                       29
+(%o1)                          29
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -710,22 +888,33 @@ the expansion falls out.
 @code{partfrac} ignores the value @code{true} of the option variable
 @code{keepfloat}.
 
-@example
+@c ===beg===
+@c 1/(1+x)^2 - 2/(1+x) + 2/(2+x);
+@c ratsimp (%);
+@c partfrac (%, x);
+@c ===end===
+@example maxima
+@group
 (%i1) 1/(1+x)^2 - 2/(1+x) + 2/(2+x);
                       2       2        1
 (%o1)               ----- - ----- + --------
                     x + 2   x + 1          2
                                     (x + 1)
+@end group
+@group
 (%i2) ratsimp (%);
                                  x
 (%o2)                 - -------------------
                          3      2
                         x  + 4 x  + 5 x + 2
+@end group
+@group
 (%i3) partfrac (%, x);
                       2       2        1
 (%o3)               ----- - ----- + --------
                     x + 2   x + 1          2
                                     (x + 1)
+@end group
 @end example
 @end deffn
 
commit 776e8a93df620e484eba4e1b26334dad80f9a046
Author: Raymond Toy <toy...@gm...>
Date:   Mon Sep 1 18:37:23 2025 -0700
    Regenerate existing examples
diff --git a/doc/info/Number.texi b/doc/info/Number.texi
index 2628dac3a..a89e11cf5 100644
--- a/doc/info/Number.texi
+++ b/doc/info/Number.texi
@@ -427,14 +427,19 @@ Examples:
 @c fibtophi (%);
 @c ratsimp (%);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) fibtophi (fib (n));
                            n             n
                        %phi  - (1 - %phi)
 (%o1)                  -------------------
                            2 %phi - 1
+@end group
+@group
 (%i2) fib (n-1) + fib (n) - fib (n+1);
 (%o2)          - fib(n + 1) + fib(n) + fib(n - 1)
+@end group
+@group
 (%i3) fibtophi (%);
             n + 1             n + 1       n             n
         %phi      - (1 - %phi)        %phi  - (1 - %phi)
@@ -444,8 +449,11 @@ Examples:
                                       %phi      - (1 - %phi)
                                     + ---------------------------
                                               2 %phi - 1
+@end group
+@group
 (%i4) ratsimp (%);
 (%o4)                           0
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -651,13 +659,19 @@ simplification rules:
 @c mod (a*x, a*y);
 @c mod (0, x);
 @c ===end===
-@example
+@example maxima
+@group
 (%i1) mod (x, 0);
 (%o1)                           x
+@end group
+@group
 (%i2) mod (a*x, a*y);
 (%o2)                      a mod(x, y)
+@end group
+@group
 (%i3) mod (0, x);
 (%o3)                           0
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -881,17 +895,23 @@ Examples:
 @c limit(zeta(x),x,1,plus);
 @c limit(zeta(x),x,1,minus);
 @c ===end===
-@example
-(%i1) zeta([-2, -1, 0, 0.5, 2, 3, 1+%i]);
-                                             2
-            1     1                       %pi
-(%o1) [0, - --, - -, - 1.460354508809586, ----, zeta(3), 
-            12    2                        6
+@example maxima
+@group
+(%i1) zeta([-2, -1, 0, 0.5, 2, 3,1+%i]);
+                                              2
+            1     1                        %pi
+(%o1) [0, - --, - -, - 1.4603545088095862, ----, zeta(3), 
+            12    2                         6
                                                     zeta(%i + 1)]
+@end group
+@group
 (%i2) limit(zeta(x),x,1,plus);
 (%o2)                          inf
+@end group
+@group
 (%i3) limit(zeta(x),x,1,minus);
 (%o3)                         minf
+@end group
 @end example
 
 @opencatbox{Categories:}
@@ -916,16 +936,20 @@ Examples:
 @c zeta%pi: false$
 @c zeta (4);
 @c ===end===
-@example
+@example maxima
 (%i1) zeta%pi: true$
+@group
 (%i2) zeta (4);
                                  4
                               %pi
 (%o2)                         ----
                                90
+@end group
 (%i3) zeta%pi: false$
+@group
 (%i4) zeta (4);
 (%o4)                        zeta(4)
+@end group
 @end example
 
 @opencatbox{Categories:}
-----------------------------------------------------------------------
hooks/post-receive
-- 
Maxima CAS
 |