[6445ab]: ui-tips.xml Maximize Restore History

Download this file

ui-tips.xml    170 lines (110 with data), 6.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="main.xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" id="ui-tips" xml:lang="en">
<head><title>Maxima user interface tips</title></head>
<body>
<h3 style="margin-top: 0; padding-top: 0"><code>describe</code> shortcut</h3>
<p>The <code>describe</code> command, e.g., <code>describe(integrate);</code> can be shortened to “<code>? </code>”, i.e., “<code>? integrate</code>”.</p>
<p>Unfortunately, this shortcut contains two exceptions to Maxima's usual input rules:</p>
<ul>
<li>Unlike practically every other input line in Maxima, the line does not require a semi-colon or dollar sign to signify the end of the entry.</li>
<li>The space is significant; “<code>?integrate</code>” has a separate meaning from “<code>? integrate</code>”; the former calls the Lisp function “<code>integrate</code>”.</li>
</ul>
<h3><code>:lisp</code> shortcut</h3>
<p>Individual Lisp commands may be entered by starting the input line with “<code>:lisp</code>”. Ordinarily, one enters Lisp mode with <code>to_lisp()</code>:</p>
<pre>(%i1) to_lisp();
Type (to-maxima) to restart
MAXIMA> (format t "hello from lisp~%")
hello from lisp
NIL
MAXIMA> (setf foo 1)
;
Warning: Declaring FOO special.
1
MAXIMA> (to-maxima)
Returning to Maxima
(%o1) TRUE
(%i2)</pre>
<p>The above example is equivalent to</p>
<pre>(%i1) :lisp (format t "hello from lisp~%")
hello from lisp
NIL
(%i1) :lisp (setf foo 1)
Warning: Declaring FOO special.
1
(%i1)</pre>
<p>Note that <code>:lisp</code> lines to not need to end with semi-colons or dollar signs.</p>
<h3>Input and output labels</h3>
<p>Before Maxima 5.9.1, the input and output labels were <code>C1</code>, <code>C2</code>, etc. and <code>D1</code>, <code>D2</code>, etc., respectively. Starting with 5.9.1, the <code>C</code> and <code>D</code> characters have been changed to <code>%i</code> and <code>%o</code>. The prompts are customizable via the <code>inchar</code> and <code>outchar</code> variables.</p>
<p>For example, the pre-5.9.1 behavior can be restored via</p>
<pre>inchar:C; outchar:D;</pre>
<p>Even though the variable names imply that they should evaluate to a single character, the prompts may have arbitrary lengths. For example,</p>
<pre>inchar:long_input_label; outchar:long_output_label;</pre>
<p>are also legal values.</p>
<h3>Re-enabling the Lisp debugger in Maxima</h3>
<p>As of Maxima 5.9.1, Lisp errors will cause the user to be dumped into the Lisp debugger. The Lisp debugger can be re-enabled by setting the <code>*debugger-hook*</code> variable in Lisp to <code>nil</code>, i.e.,</p>
<pre>(setf *debugger-hook* nil)</pre>
<p>To restore Maxima's default behavior, set <code>*debugger-hook*</code> to point to the function <code>maxima-lisp-debugger</code>, i.e.,</p>
<pre>(setf *debugger-hook* #'maxima-lisp-debugger)</pre>
<h3>Environment variables</h3>
<p>Maxima uses several environment variables. The following description comes from the man page:</p>
<dl>
<dt><code>MAXIMA_USERDIR</code></dt>
<dd>Points to a directory for user customization files. Maxima's default search paths include <code>MAXIMA_USERDIR</code>. Default value: <code>$HOME/.maxima</code>.</dd>
<dt><code>MAXIMA_PREFIX</code></dt>
<dd>Maxima looks for its input files in the directory configured at compile time, <code>/home/amundson/opt/maxima</code>. Maxima can be relocated to a different directory as long as the Maxima script maintains the same relative position with respect to the Maxima input files. If, for some reason, the Maxima script needs to be relocated independently, <code>MAXIMA_PREFIX</code> needs to be set to point to the top of the tree holding the input files.</dd>
<dt><code>MAXIMA_DIRECTORY</code></dt>
<dd><code>MAXIMA_DIRECTORY</code> is equivalent to <code>MAXIMA_PREFIX</code>. It is included only for backward compatibility with older versions of Maxima.</dd>
</dl>
<p>Maxima uses several other environment variables for communication between the Maxima script and the Lisp image. All such variables start with <code>MAXIMA_</code>. They should not need to be modified by the user.</p>
<h3>Customization files</h3>
<p>Maxima checks for the presence of the files <code>maxima-init.lisp</code> and <code>maxima-init.mac</code> in the search path and loads them if available. The most logical place to put these files is in <code>MAXIMA_USERDIR</code>, as defined above.</p>
<p>An example <code>maxima-init.lisp</code> that re-enables the Lisp debugger:</p>
<pre>(setf *debugger-hook* nil)
(format t "*** My personal maxima-init.lisp has been loaded ***~%")</pre>
<p>An example <code>maxima-init.mac</code> that enables gnuplot's <code>pm3d</code> mode:</p>
<pre>set_plot_option([gnuplot_pm3d,true]);
print("*** My very own personal maxima-init.mac has been loaded. ***");</pre>
<p>The <code>print</code>/<code>format</code> statements are useful for debugging. They can be removed once the init files are established to be working.</p>
<h3>Customizing the display of equations</h3>
<p>The Maxima variables <code>display2d</code>, stardisp and linel allow for customization of the display of equations.</p>
<p><code>display2d</code> is a boolean controlling the formatting of displayed equations:</p>
<pre>(%i1) display2d;
(%o1) TRUE
(%i2) x/(y^2+z^2);
x
(%o2) -------
2 2
z + y
(%i3) display2d:false;
(%o3) FALSE
(%i4) x/(y^2+z^2);
(%o4) x/(z^2+y^2)</pre>
<p><code>stardisp</code> controls whether spaces or <code>*</code>'s are used to represent multiplication:</p>
<pre>(%i1) stardisp;
(%o1) FALSE
(%i2) a*b*c;
(%o2) a b c
(%i3) stardisp:true;
(%o3) TRUE
(%i4) a*b*c;
(%o4) a*b*c</pre>
<p><code>linel</code> controls the number of characters per line:</p>
<pre>(%i1) linel;
(%o1) 79
(%i2) ratexpand((x+y+z)^3);
3 2 2 2 2 3 2 2
(%o2) z + 3 y z + 3 x z + 3 y z + 6 x y z + 3 x z + y + 3 x y + 3 x y
3
+ x
(%i3) linel:40;
(%o3) 40
(%i4) ratexpand((x+y+z)^3);
3 2 2 2
(%o4) z + 3 y z + 3 x z + 3 y z
2 3 2
+ 6 x y z + 3 x z + y + 3 x y
2 3
+ 3 x y + x</pre>
</body>
</html>