|
From: rtoy <rt...@us...> - 2025-08-31 19:51:17
|
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 8a872710195853ff5f153fb7d8f412581170d395 (commit)
from 1a1a308b448e8d27064c149770ff66394fcee53a (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 8a872710195853ff5f153fb7d8f412581170d395
Author: Raymond Toy <toy...@gm...>
Date: Sun Aug 31 12:46:51 2025 -0700
Add comment blocks to generate examples and run update_examples
This allows these examples to have syntax highlighting applied if
enabled.
diff --git a/doc/info/Command.texi b/doc/info/Command.texi
index dd12de7b6..18604b3bd 100644
--- a/doc/info/Command.texi
+++ b/doc/info/Command.texi
@@ -52,7 +52,7 @@ Examples:
@c [aa : 1, bb : 2, cc : 3];
@c (aa + bb + cc)/(dd + ee + g(x));
@c ===end===
-@example
+@example maxima
@group
(%i1) print ("I was called as", __);
I was called as print(I was called as, __)
@@ -123,7 +123,7 @@ Examples:
@c a + b;
@c ev (_);
@c ===end===
-@example
+@example maxima
@group
(%i1) 13 + 29;
(%o1) 42
@@ -221,34 +221,47 @@ Examples:
The following two examples yield the same result.
-@example
+@c ===beg===
+@c block (integrate (x^5, x), ev (%%, x=2) - ev (%%, x=1));
+@c block ([prev], prev: integrate (x^5, x),
+@c ev (prev, x=2) - ev (prev, x=1));
+@c ===end===
+@example maxima
+@group
(%i1) block (integrate (x^5, x), ev (%%, x=2) - ev (%%, x=1));
21
(%o1) --
2
+@end group
+@group
(%i2) block ([prev], prev: integrate (x^5, x),
- ev (prev, x=2) - ev (prev, x=1));
+ ev (prev, x=2) - ev (prev, x=1));
21
(%o2) --
2
-
+@end group
@end example
A compound statement may comprise other compound statements. Whether a
statement be simple or compound, @code{%%} is the value of the previous
statement.
-@example
-(%i3) block (block (a^n, %%*42), %%/6);
+@c ===beg===
+@c block (block (a^n, %%*42), %%/6);
+@c ===end===
+@example maxima
+@group
+(%i1) block (block (a^n, %%*42), %%/6);
n
-(%o3) 7 a
+(%o1) 7 a
+@end group
@end example
Within a compound statement, the value of @code{%%} may be inspected at a break
prompt, which is opened by executing the @mref{break} function. For example,
entering @code{%%;} in the following example yields @code{42}.
-@example
+@example maxima
(%i4) block (a: 42, break ())$
Entering a Maxima break point. Type 'exit;' to resume.
@@ -285,15 +298,23 @@ Example:
output expressions. This example sets @code{s} to the sum of the last five
output expressions.
-@example
+@c ===beg===
+@c 1;2;3;4;5;
+@c block (s: 0, for i:1 thru 5 do s: s + %th(i), s);
+@c ===end===
+@example maxima
+@group
(%i1) 1;2;3;4;5;
(%o1) 1
(%o2) 2
(%o3) 3
(%o4) 4
(%o5) 5
+@end group
+@group
(%i6) block (s: 0, for i:1 thru 5 do s: s + %th(i), s);
(%o6) 15
+@end group
@end example
@opencatbox{Categories:}
@@ -354,7 +375,7 @@ Example:
@c %;
@c %o1;
@c ===end===
-@example
+@example maxima
(%i1) 1 + 2 + 3 $
@group
(%i2) %;
@@ -380,7 +401,7 @@ Example:
@c ===beg===
@c 1 + 2 + 3;
@c ===end===
-@example
+@example maxima
@group
(%i1) 1 + 2 + 3;
(%o1) 6
@@ -412,7 +433,7 @@ Example:
@c inchar: "input";
@c expand((a+b)^3);
@c ===end===
-@example
+@example maxima
@group
(%i1) inchar: "input";
(%o1) input
@@ -704,13 +725,20 @@ was truly an option variable.
Example:
-@example
+@c ===beg===
+@c optionset:true;
+@c gamma_expand:true;
+@c ===end===
+@example maxima
+@group
(%i1) optionset:true;
-assignment: assigning to option optionset
(%o1) true
+@end group
+@group
(%i2) gamma_expand:true;
assignment: assigning to option gamma_expand
(%o2) true
+@end group
@end example
@opencatbox{Categories:}
@@ -745,7 +773,7 @@ Example:
@c outchar: "output";
@c expand((a+b)^3);
@c ===end===
-@example
+@example maxima
@group
(%i1) outchar: "output";
(output1) output
@@ -873,7 +901,7 @@ See also @mref{readonly}
Example:
-@example
+@example maxima
(%i1) foo: 42$
(%i2) foo: read ("foo is", foo, " -- enter new value.")$
foo is 42 -- enter new value.
@@ -900,7 +928,7 @@ See also @mrefdot{read}
Examples:
-@example
+@example maxima
(%i1) aa: 7$
(%i2) foo: readonly ("Enter an expression:");
Enter an expression:
@@ -968,7 +996,7 @@ inspected on the property list, then the function definition is extracted,
factored and stored in the variable @code{$result}. The variable can be used in Maxima
after returning to Maxima.
-@example
+@example maxima
(%i1) f(x):=x^2+x;
2
(%o1) f(x) := x + x
@@ -1009,34 +1037,34 @@ Examples:
@c eval_string_lisp ("(defun $foo (x) (* 2 x))");
@c foo (5);
@c ===end===
-@example
+@example maxima
@group
(%i1) eval_string_lisp ("");
-(%o1) []
+(%o1) []
@end group
@group
(%i2) eval_string_lisp ("(values)");
-(%o2) []
+(%o2) []
@end group
@group
(%i3) eval_string_lisp ("69");
-(%o3) [69]
+(%o3) [69]
@end group
@group
(%i4) eval_string_lisp ("1 2 3");
-(%o4) [3]
+(%o4) [3]
@end group
@group
(%i5) eval_string_lisp ("(values 1 2 3)");
-(%o5) [1,2,3]
+(%o5) [1, 2, 3]
@end group
@group
(%i6) eval_string_lisp ("(defun $foo (x) (* 2 x))");
-(%o6) [foo]
+(%o6) [foo]
@end group
@group
(%i7) foo (5);
-(%o7) 10
+(%o7) 10
@end group
@end example
@@ -1075,7 +1103,7 @@ The values are removed from the variables. @code{values} is the empty list.
@c [kill(a), remove(b,value), remvalue(c)];
@c values;
@c ===end===
-@example
+@example maxima
@group
(%i1) [a:99, b:: a-90, c:a-b, d, f(x):=x^2];
2
@@ -1122,7 +1150,7 @@ Example:
@c %edispflag:true$
@c %e^-10;
@c ===end===
-@example
+@example maxima
@group
(%i1) %e^-10;
- 10
@@ -1156,11 +1184,17 @@ signs around expressions which are more than one line tall.
Example:
-@example
+@c ===beg===
+@c display2d_unicode: false $
+@c abs((x^3+1));
+@c ===end===
+@example maxima
(%i1) display2d_unicode: false $
+@group
(%i2) abs((x^3+1));
- ! 3 !
-(%o2) !x + 1!
+ | 3 |
+(%o2) |x + 1|
+@end group
@end example
@opencatbox{Categories:}
@@ -1237,7 +1271,7 @@ There may be any number of index properties, in any order.
@c B[w, x, y];
@c C[w, x, y, z];
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [presubscript, postsubscript]);
(%o1) done
@@ -1284,7 +1318,7 @@ Otherwise, index properties are ignored.
@c stringdisp: true $
@c string (A[w, x]);
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [presubscript, postsubscript]);
(%o1) done
@@ -1387,7 +1421,7 @@ The value is assigned by @code{put(@var{A}, @var{S}, display_index_separator)},
@c put (A, ";", display_index_separator);
@c A[w, x, y, z];
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [postsuperscript, postsuperscript,
presubscript, presubscript]);
@@ -1413,7 +1447,7 @@ The assigned value is retrieved by @code{get(@var{A}, display_index_separator)}.
@c put (A, ";", display_index_separator);
@c get (A, display_index_separator);
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [postsuperscript, postsuperscript,
presubscript, presubscript]);
@@ -1447,7 +1481,7 @@ or @code{false}, indicating the default separator, or any expression.
@c put (A, 'foo, display_index_separator);
@c A[w, x, y, z];
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [postsuperscript, postsuperscript,
presubscript, presubscript]);
@@ -1519,7 +1553,7 @@ The default separator is a comma.
@c presubscript, presubscript]);
@c A[w, x, y, z];
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [postsuperscript, postsuperscript,
presubscript, presubscript]);
@@ -1544,7 +1578,7 @@ Each symbol has its own value of @code{display_index_separator}.
@c put (B, ";", display_index_separator);
@c A[w, x, y, z] + B[w, x, y, z];
@c ===end===
-@example
+@example maxima
@group
(%i1) declare_index_properties (A, [postsuperscript, postsuperscript,
presubscript, presubscript]);
@@ -1555,7 +1589,8 @@ Each symbol has its own value of @code{display_index_separator}.
(%o2)
@end group
@group
-(%i3) declare_index_properties (B, [postsuperscript, postsuperscript, presubscript, presubscript]);
+(%i3) declare_index_properties (B, [presuperscript, presuperscript,
+ postsubscript, postsubscript]);
(%o3) done
@end group
@group
@@ -1564,9 +1599,9 @@ Each symbol has its own value of @code{display_index_separator}.
@end group
@group
(%i5) A[w, x, y, z] + B[w, x, y, z];
- w;x w x
+ w;x w x
(%o5) B + A
- y;z y z
+ y;z y z
@end group
@end example
@@ -1592,7 +1627,7 @@ Example:
@c x:123$
@c disp(x, b[1,2], sin(1.0));
@c ===end===
-@example
+@example maxima
(%i1) b[1,2]:x-x^2$
(%i2) x:123$
@group
@@ -1632,7 +1667,7 @@ Example:
@c x:123$
@c display(x, b[1,2], sin(1.0));
@c ===end===
-@example
+@example maxima
(%i1) b[1,2]:x-x^2$
(%i2) x:123$
@group
@@ -1696,7 +1731,7 @@ Example:
@c display2d:false$
@c x/(x^2+1);
@c ===end===
-@example
+@example maxima
@group
(%i1) x/(x^2+1);
x
@@ -1828,17 +1863,23 @@ as @code{ncexpt (A, B)} in the case of @code{A^^B}).
Example:
-@example
+@c ===beg===
+@c dispterms(2*a*sin(x)+%e^x);
+@c ===end===
+@example maxima
+@group
(%i1) dispterms(2*a*sin(x)+%e^x);
-
+
2 a sin(x)
+
x
%e
+
(%o1) done
+@end group
@end example
@opencatbox{Categories:}
@@ -1872,19 +1913,33 @@ with negative exponents using quotients. See also @mrefdot{%edispflag}
Example:
-@example
+@c ===beg===
+@c exptdispflag:true;
+@c 10^-x;
+@c exptdispflag:false;
+@c 10^-x;
+@c ===end===
+@example maxima
+@group
(%i1) exptdispflag:true;
(%o1) true
+@end group
+@group
(%i2) 10^-x;
1
(%o2) ---
x
10
+@end group
+@group
(%i3) exptdispflag:false;
(%o3) false
+@end group
+@group
(%i4) 10^-x;
- x
(%o4) 10
+@end group
@end example
@opencatbox{Categories:}
@@ -1935,7 +1990,7 @@ Examples:
@c grind (cholesky);
@c string (fundef (cholesky));
@c ===end===
-@example
+@example maxima
@group
(%i1) aa + 1729;
(%o1) aa + 1729
@@ -2017,7 +2072,7 @@ bb+aa^10
if i = j then p[i] : 1 / sqrt(x) else L[j, i] : x * p[i]),
for i thru n do L[i, i] : 1 / p[i],
for i thru n do for j : i + 1 thru n do L[i, j] : 0, L)$
-define: warning: redefining the built-in function cholesky
+define: warning: redefining the built-in operator cholesky
@end group
@group
(%i15) grind (cholesky);
@@ -2098,7 +2153,7 @@ Examples:
@c obase;
@c 1111111111111111;
@c ===end===
-@example
+@example maxima
(%i1) ibase : 2 $
@group
(%i2) obase;
@@ -2124,7 +2179,7 @@ be prepended by a 0.
@c 0abcd;
@c symbolp (0abcd);
@c ===end===
-@example
+@example maxima
(%i1) ibase : 16 $
@group
(%i2) obase;
@@ -2161,7 +2216,7 @@ it is interpreted in base 10.
@c 1234;
@c 1234.;
@c ===end===
-@example
+@example maxima
(%i1) ibase : 36 $
@group
(%i2) obase;
@@ -2194,13 +2249,25 @@ See also @mrefcomma{disp} @mrefcomma{display} and @mrefdot{ldisplay}
Examples:
-@example
+@c ===beg===
+@c e: (a+b)^3;
+@c f: expand (e);
+@c ldisp (e, f);
+@c %t3;
+@c %t4;
+@c ===end===
+@example maxima
+@group
(%i1) e: (a+b)^3;
3
(%o1) (b + a)
+@end group
+@group
(%i2) f: expand (e);
3 2 2 3
(%o2) b + 3 a b + 3 a b + a
+@end group
+@group
(%i3) ldisp (e, f);
3
(%t3) (b + a)
@@ -2209,12 +2276,17 @@ Examples:
(%t4) b + 3 a b + 3 a b + a
(%o4) [%t3, %t4]
-(%i4) %t3;
+@end group
+@group
+(%i5) %t3;
3
-(%o4) (b + a)
-(%i5) %t4;
+(%o5) (b + a)
+@end group
+@group
+(%i6) %t4;
3 2 2 3
-(%o5) b + 3 a b + 3 a b + a
+(%o6) b + 3 a b + 3 a b + a
+@end group
@end example
@opencatbox{Categories:}
@@ -2237,13 +2309,25 @@ See also @mrefcomma{display} @mrefcomma{disp} and @mrefdot{ldisp}
Examples:
-@example
+@c ===beg===
+@c e: (a+b)^3;
+@c f: expand (e);
+@c ldisplay (e, f);
+@c %t3;
+@c %t4;
+@c ===end===
+@example maxima
+@group
(%i1) e: (a+b)^3;
3
(%o1) (b + a)
+@end group
+@group
(%i2) f: expand (e);
3 2 2 3
(%o2) b + 3 a b + 3 a b + a
+@end group
+@group
(%i3) ldisplay (e, f);
3
(%t3) e = (b + a)
@@ -2252,12 +2336,17 @@ Examples:
(%t4) f = b + 3 a b + 3 a b + a
(%o4) [%t3, %t4]
-(%i4) %t3;
+@end group
+@group
+(%i5) %t3;
3
-(%o4) e = (b + a)
-(%i5) %t4;
+(%o5) e = (b + a)
+@end group
+@group
+(%i6) %t4;
3 2 2 3
-(%o5) f = b + 3 a b + 3 a b + a
+(%o6) f = b + 3 a b + 3 a b + a
+@end group
@end example
@opencatbox{Categories:}
@@ -2277,14 +2366,23 @@ See also @mref{display2d} to switch between 1D- and 2D-display.
Example:
-@example
+@c ===beg===
+@c expand((x+1)^3);
+@c leftjust:true$
+@c expand((x+1)^3);
+@c ===end===
+@example maxima
+@group
(%i1) expand((x+1)^3);
3 2
(%o1) x + 3 x + 3 x + 1
+@end group
(%i2) leftjust:true$
+@group
(%i3) expand((x+1)^3);
3 2
(%o3) x + 3 x + 3 x + 1
+@end group
@end example
@opencatbox{Categories:}
@@ -2326,7 +2424,7 @@ Examples:
@c lispdisp: true$
@c ?foo + ?bar;
@c ===end===
-@example
+@example maxima
(%i1) lispdisp: false$
@group
(%i2) ?foo + ?bar;
@@ -2391,17 +2489,17 @@ Examples:
@c obase : 36;
@c 36^8 - 1;
@c ===end===
-@example
+@example maxima
@group
(%i1) obase : 2;
(%o1) 10
@end group
@group
-(%i10) 2^8 - 1;
-(%o10) 11111111
+(%i2) 2^8 - 1;
+(%o2) 11111111
@end group
@group
-(%i11) obase : 8;
+(%i3) obase : 8;
(%o3) 10
@end group
@group
@@ -2443,21 +2541,37 @@ displayed as a leading multiplicative term @code{1/n}.
Examples:
-@example
+@c ===beg===
+@c pfeformat: false$
+@c 2^16/7^3;
+@c (a+b)/8;
+@c pfeformat: true$
+@c 2^16/7^3;
+@c (a+b)/8;
+@c ===end===
+@example maxima
(%i1) pfeformat: false$
+@group
(%i2) 2^16/7^3;
65536
(%o2) -----
343
+@end group
+@group
(%i3) (a+b)/8;
b + a
(%o3) -----
8
-(%i4) pfeformat: true$
+@end group
+(%i4) pfeformat: true$
+@group
(%i5) 2^16/7^3;
(%o5) 65536/343
+@end group
+@group
(%i6) (a+b)/8;
-(%o6) 1/8 (b + a)
+(%o6) (1/8) (b + a)
+@end group
@end example
@opencatbox{Categories:}
@@ -2479,17 +2593,31 @@ By default, terms of a sum are displayed in order of decreasing power.
Example:
-@example
+@c ===beg===
+@c powerdisp:true;
+@c x^2+x^3+x^4;
+@c powerdisp:false;
+@c x^2+x^3+x^4;
+@c ===end===
+@example maxima
+@group
(%i1) powerdisp:true;
(%o1) true
+@end group
+@group
(%i2) x^2+x^3+x^4;
2 3 4
(%o2) x + x + x
+@end group
+@group
(%i3) powerdisp:false;
(%o3) false
+@end group
+@group
(%i4) x^2+x^3+x^4;
4 3 2
(%o4) x + x + x
+@end group
@end example
@opencatbox{Categories:}
@@ -2515,17 +2643,24 @@ To display the contents of a file, see @mrefdot{printfile}
Examples:
-@example
-(%i1) r: print ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is",
- radcan (log (a^10/b)))$
+@c ===beg===
+@c r: print ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is", radcan (log (a^10/b)))$
+@c r;
+@c disp ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is", radcan (log (a^10/b)))$
+@c ===end===
+@example maxima
+@group
+(%i1) r: print ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is", radcan (log (a^10/b)))$
3 2 2 3
(a+b)^3 is b + 3 a b + 3 a b + a log (a^10/b) is
-
10 log(a) - log(b)
+@end group
+@group
(%i2) r;
(%o2) 10 log(a) - log(b)
-(%i3) disp ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is",
- radcan (log (a^10/b)))$
+@end group
+@group
+(%i3) disp ("(a+b)^3 is", expand ((a+b)^3), "log (a^10/b) is", radcan (log (a^10/b)))$
(a+b)^3 is
3 2 2 3
@@ -2534,6 +2669,8 @@ Examples:
log (a^10/b) is
10 log(a) - log(b)
+
+@end group
@end example
@opencatbox{Categories:}
-----------------------------------------------------------------------
Summary of changes:
doc/info/Command.texi | 295 ++++++++++++++++++++++++++++++++++++--------------
1 file changed, 216 insertions(+), 79 deletions(-)
hooks/post-receive
--
Maxima CAS
|