WxMaxima は数式処理システム(CAS) Maxima のためのグラフィカルユーザーインターフェース(GUI)です。WxMaxima を使えば Maxima のすべての関数を利用できます。さらに、よく使われる機能を手軽に使うための便利なウィザードも備えています。このマニュアルでは、wxMaxima を Maxima の最も人気のある GUI のひとつにしている機能のいくつかを説明します。
オープンソースの世界では、大きなシステムは通常、少人数の開発者グループでも扱いやすい小さなプロジェクトに分割されます。たとえば CD 書き込みプログラムは、実際に CD を書き込むコマンドラインツールと、ユーザーがコマンドラインのオプションをすべて覚えることなく、実のところコマンドラインをまったく使わずにそれを利用できるようにするグラフィカルユーザーインターフェースから成り立っています。この方式の利点のひとつは、コマンドラインプログラムに注がれた開発の労力を多くのプログラムで共有できることです。同じ CD 書き込みコマンドラインプログラムを、ファイルマネージャの「CD に送る」プラグインとしても、音楽プレーヤーの「CD に書き込む」機能としても、DVD バックアップツールの CD ライターとしても使えます。もうひとつの利点は、ひとつの大きな作業を小さな部分に分けることで、開発者が同じプログラムに対して複数のユーザーインターフェースを提供できるようになることです。
Maxima のような数式処理システム(CAS)もこの枠組みに当てはまります。CAS は任意精度の電卓アプリケーションの裏側にある論理を提供することも、より大きなシステム(たとえば Sage)の裏側で数式の自動変形を行うこともできます。また、単独のシステムとして直接使うこともできます。 Maxima にはコマンドラインからアクセスできます。しかし多くの場合、特に初心者にとっては、 wxMaxima のようなインターフェースのほうがソフトウェアを効率よく使う方法になります。
Maxima は本格的な数式処理システム(CAS)です。CAS とは、結果の数値を出力するだけでなく、数式を変形して問題を解く式を見つけることで数学の問題を解けるプログラムです。言い換えると、 Maxima は変数の数値表現を与える電卓として使えるだけでなく、解析解を求めることもできます。さらに、解析的に解けない方程式や連立方程式に対しては、さまざまな数値解析手法も提供しています。
Maxima の詳しいドキュメントは インターネットで入手できます。このドキュメントの一部は wxMaxima のヘルプメニューからも利用できます。ヘルプキー(多くのシステムでは F1 キー)を押すと、 wxMaxima の状況依存ヘルプ機能が、カーソル位置にあるコマンドの Maxima マニュアルのページへ自動的に移動します。
WxMaxima is a graphical user interface that provides the full functionality and flexibility of Maxima. WxMaxima offers users a graphical display and many features that make working with Maxima easier. For example wxMaxima allows one to export any cell’s contents (or, if that is needed, any part of a formula, as well) as text, as LaTeX or as MathML specification at a simple right-click. Indeed, an entire workbook can be exported, either as a HTML file, as a LaTeX file or as a Typst file. Documentation for wxMaxima, including workbooks to illustrate aspects of its use, is online at the wxMaxima help site, as well as via the help menu.
wxMaxima に入力された計算は、バックグラウンドで Maxima コマンドラインツールによって実行されます。
wxMaxima の大部分は見ればわかるものですが、いくつかの細かい点には注意が必要です。 このサイト には、 wxMaxima のさまざまな面を扱ったワークシートがいくつも掲載されています。そのいくつか(特に「10 分でわかる (wx)Maxima」チュートリアル)に取り組めば、 Maxima の内容と、 Maxima と対話するための wxMaxima の使い方の両方に慣れることができます。このマニュアルでは、 wxMaxima のうち、見ただけでは分かりにくく、オンラインの資料でも扱われていないかもしれない点の説明に重点を置いています。
wxMaxima のごく少ない標準的でない点のひとつは、 Maxima に渡すデータをセルにまとめ、ユーザーが要求したときにだけ評価する(つまり Maxima に送る)ことです。セルを評価すると、そのセルの中の、そしてそのセルだけのすべてのコマンドがひとまとまりとして評価されます。(正確に言えばこれは少し違います。隣り合う複数のセルを選択してまとめて評価することもできますし、ワークシート中のすべてのセルを一度に評価するよう Maxima に指示することもできます。) WxMaxima のこのコマンド実行方式は、最初は見慣れないかもしれません。しかし、大きな文書(変更のたびに文書全体が自動的に再評価されるのは困る場合)での作業がずっと楽になります。また、この方式はデバッグにもとても便利です。
wxMaxima に文字を入力すると、自動的に新しいワークシートのセルが作られます。セルの種類はツールバーで選べます。コードセルを作った場合、そのセルを Maxima に送ることができ、計算結果がコードの下に表示されます。以下にそのようなコマンドの組を示します。
入力セルの内容を評価すると、 Maxima
は入力にラベルを付けます(既定では赤で表示され、 %i
で見分けられます)。このラベルを使って、 wxMaxima
のセッション中で後からその入力を参照できます。 Maxima
が生成する出力にも %o
で始まるラベルが付きますが、ユーザーが出力に名前を付けない限り、既定では表示されません。名前を付けた場合は、既定ではユーザー定義のラベルが表示されます。それでも
Maxima が自動生成した %o
形式のラベルも引き続き使えます。
wxMaxima では入力セルのほかに、説明用のテキストセル、画像セル、タイトルセル、章セル、節セルも使えます。セルごとに個別の取り消し(アンドゥ)バッファがあるので、いくつかのセルの値を変えてデバッグし、不要になった変更を少しずつ元に戻すのはとても簡単です。さらに、ワークシート自体にも、セルの編集・追加・削除を取り消せる全体の取り消しバッファがあります。
下の図は、さまざまな種類のセル(タイトルセル、節セル、小節セル、テキストセル、入出力セル、画像セル)を示しています。
ワークシートはセルで構成されています。WxMaxima には次の種類のセルがあります。
文字を入力したときの wxMaxima の既定の動作は、自動的に数式セルを作ることです。ほかの種類のセルは、セルメニュー、メニューに表示されているショートカットキー、ツールバーのドロップダウンリストを使って作れます。数式セル以外のセルを作った後は、入力した内容はすべてテキストとして扱われます。
数式セルには、次のように(C 言語風の) コメント
を含めることができます:
/* This comment will be ignored by Maxima */
“/*” はコメントの開始を、 “*/”
は終了を表します。
ユーザーが文全体を選択しようとすると、ワープロは選択範囲を自動的に単語の境界で始まり単語の境界で終わるように広げようとします。同じように、複数のセルが選択されると、 wxMaxima は選択範囲をセル全体に広げます。
標準的でないのは、 wxMaxima が 2 種類のカーソルを定義することでドラッグ&ドロップの柔軟性を実現している点です。 WxMaxima は必要に応じて自動的にこれらを切り替えます。
wxMaxima
を起動すると、点滅する横カーソルだけが表示されます。入力を始めると自動的に数式セルが作られ、カーソルは通常の縦カーソルに変わります(「プロンプト」として右向きの矢印が表示され、数式セルを評価する(CTRL+ENTER)と
(%i1) 、 (%o1)
などのラベルが表示されます)。
ワークシートを作り始めるときに、これから何をするかを説明する別の種類のセル(タイトルセルやテキストセルなど)を(「セル」メニューで)作りたくなるかもしれません。
The cell the cursor is in can be turned into another type with the keyboard: CTRL+SHIFT+1 makes it a text cell, 2 to 7 make it a title, section, subsection, subsubsection, heading 5 or heading 6, the same numbers that insert these cells with CTRL alone, and CTRL+SHIFT+ESC makes it a code cell.
セルの間を移動すると、ワークシートにセルを挿入できる位置に(点滅する)横カーソルが表示されます(数式を入力し始めれば数式セルを、メニューを使えば別の種類のセルを挿入できます)。
コードセルのコマンドは、 CTRL+ENTER 、 SHIFT+ENTER 、またはテンキーの ENTER キーを押すと一度実行されます。 wxMaxima の既定では CTRL+ENTER または SHIFT+ENTER でコマンドが送られますが、 ENTER でコマンドを実行するように wxMaxima を設定することもできます。
WxMaxima には自動補完機能があり、メニュー(セル/単語補完)から、またはキーの組み合わせ CTRL+SPACE を押して呼び出せます。自動補完は状況に応じて動作します。たとえば ezUnits の単位指定の中で使うと、使える単位の一覧が表示されます。
自動補完は、ファイル名、単位名、入力中のコマンドや変数の名前を補完するだけでなく、ほとんどのコマンドについて、そのコマンドが受け取る引数の型(と意味)を示すテンプレートを表示できます。この機能を使うには SHIFT+CTRL+SPACE を押すか、対応するメニュー項目(セル/Show Template)を選びます。
コンピュータは伝統的に文字を 8 ビットの値で保存してきました。これで最大 256 種類の文字を扱えます。ほぼどんな言語でも、すべての文字、数字、制御記号(送信終了、文字列の終わり、メニュー用の四角形を描く線や角 など )はこの範囲に収まります。
しかし多くの国で選ばれた 256 文字のコードページには、数学でよく使われるギリシャ文字などが含まれていません。こうした制約を克服するために Unicode が考案されました。英語のテキストは今まで通り扱えながら、256 文字よりはるかに多くの文字を使えるようにする符号化方式です。
Maxima は、Unicode をサポートするか、フォントの符号化を気にしない Lisp コンパイラでコンパイルされていれば、Unicode を扱えます。この 2 つの条件の少なくとも一方は満たされていることが多いでしょう。 WxMaxima はキーボードでギリシャ文字を入力する方法を提供しています。
| キー | ギリシャ文字 | キー | ギリシャ文字 | キー | ギリシャ文字 |
|---|---|---|---|---|---|
| a | alpha | i | iota | r | rho |
| b | beta | k | kappa | s | sigma |
| g | gamma | l | lambda | t | tau |
| d | delta | m | mu | u | upsilon |
| e | epsilon | n | nu | f | phi |
| z | zeta | x | xi | c | chi |
| h | eta | om | omicron | y | psi |
| q | theta | p | pi | o | omega |
| A | Alpha | I | Iota | R | Rho |
| B | Beta | K | Kappa | S | Sigma |
| G | Gamma | L | Lambda | T | Tau |
| D | Delta | M | Mu | U | Upsilon |
| E | Epsilon | N | Nu | P | Phi |
| Z | Zeta | X | Xi | C | Chi |
| H | Eta | Om | Omicron | Y | Psi |
| T | Theta | P | Pi | O | Omega |
ギリシャ文字は「ギリシャ文字」サイドバーからも入力できます。
ラテン文字のいくつかはギリシャ文字とよく似ています。たとえばラテン文字の “A” とギリシャ文字の “アルファ” です。見た目は同じでも、異なる Unicode コードポイント(番号)で表される 2 つの別々の Unicode 文字です。
変数 A に値を代入し、後でこの変数を使うつもりでギリシャ文字のアルファを使うと、特に印刷物では問題になることがあります。ギリシャ文字のミュー(マイクロの接頭辞としても使われます)にも、2 つの異なる Unicode コードポイントがあります。
そのため「ギリシャ文字」サイドバーには、よく似た文字を表示しないオプションがあります(右クリックメニューで変更できます)。
同じ仕組みで、いくつかの数学記号も入力できます。
| 入力するキー | 数学記号 |
|---|---|
| hbar | プランク定数:上に横棒の付いた h |
| Hbar | 上に横棒の付いた H |
| 2 | 2 乗 |
| 3 | 3 乗 |
| /2 | 1/2 |
| partial | 偏微分記号(dx/dt の d) |
| integral | 積分記号 |
| sq | 平方根 |
| ii | 虚数 |
| ee | 要素 |
| in | 属する |
| impl implies | ならば |
| inf | 無限大 |
| empty | 空集合 |
| TB | 右向きの大きな三角形 |
| tb | 右向きの小さな三角形 |
| and | かつ(and) |
| or | または(or) |
| xor | 排他的論理和(xor) |
| nand | nand |
| nor | nor |
| equiv | 同値 |
| not | 否定(not) |
| union | 和集合 |
| inter | 共通部分 |
| subseteq | 部分集合または等しい |
| subset | 部分集合 |
| notsubseteq | 部分集合でも等しくもない |
| notsubset | 部分集合でない |
| approx | ほぼ等しい |
| propto | 比例 |
| neq != /= or # | 等しくない |
| +/- or pm | プラスマイナス記号 |
| <= or leq | 以下 |
| >= or geq | 以上 |
| << or ll | はるかに小さい |
| >> or gg | はるかに大きい |
| qed | 証明終わり |
| nabla | ナブラ演算子 |
| sum | 総和記号 |
| prod | 総乗記号 |
| exists | 存在記号 |
| nexists | 「存在しない」記号 |
| parallel | 平行記号 |
| perp | 垂直記号 |
| leadsto | 「導く」記号 |
| -> | 右矢印 |
| –> | 長い右矢印 |
これらの数学記号は「数学記号」サイドバーからも入力できます。
特殊な記号が一覧にない場合は、 ESC [文字の番号(16 進数)] ESC と押せば、任意の Unicode 文字を入力できます。さらに「数学記号」サイドバーには右クリックメニューがあり、このツールバーやワークシートに追加できるすべての Unicode 記号の一覧を表示できます。
ESC61ESC therefore
results in an a. While you type the number, the list of
symbols shows the character it stands for and its Unicode name.
If the number also is the beginning of a symbol’s name
(be could be the start of beta, or the
character ¾ with the number be), the name wins. A leading
0 or u+ makes it a number:
ESCu+beESC and
ESC00beESC both result in a
¾.
A letter with an accent that Unicode has no character of its own for,
like a t with a bar on top of it, is a letter followed by a “combining”
accent:
tESC304ESC
results in t̄, which Maxima treats as a variable
name like any other.
Symbols one needs often can be added to the “Symbols” sidebar in the “Options” tab of the configuration dialog (Edit -> Configure), where they can also be given a keyboard shortcut. A letter with accents counts as one symbol there and gets one button. The Greek letters and the symbols the sidebars show anyway can be given a keyboard shortcut there, too, or by right-clicking their button in the sidebar. A shortcut has to contain Ctrl or Alt or be a function key, and types its symbol while the worksheet has the keyboard focus. The configuration dialog warns if a menu entry already uses the same keys.
これらの記号のほとんど(論理記号は重要な例外です)は Maxima では特別な意味を持たないため、普通の文字として扱われることに注意してください。Unicode 文字をサポートしない Lisp で Maxima がコンパイルされている場合は、エラーメッセージの原因になることがあります。
たとえばギリシャ文字や数学記号が選択中のフォントに含まれていない場合は、表示できません。 この問題を解決するには、別のフォントを選んでください(編集 -> 設定 -> スタイル)。
wxMaxima will replace several Unicode characters with their
respective Maxima expressions, e.g. ² with ^2,
³ with ^3, ≠ with #
or ≤ with <=.
Unicode characters that stand for a Maxima name are instead defined
as Maxima aliases of that name when wxMaxima starts
Maxima: π for %pi, ⅈ for
%i, ⅇ for %e, ∞ for
inf, the (mathematical) Sigma sign (which is not the same
Unicode character as the corresponding Greek letter) for
sum, ∏ for product,
∫ for integrate, the square root sign for
sqrt and ⋀, ⋁, ⊻,
⊼, ⊽, ⇒, ⇔ and
¬ for and, or, xor,
nand, nor, implies,
equiv and not. This means they work in files
loaded by batch() or load(), too, and
aliases lists the names they stand for. As Maxima
reads these characters as letters they need to be separated from
neighbouring names by spaces in such a file: a⋀b is a
variable name, a ⋀ b means a and b. In an
input cell wxMaxima adds these spaces automatically. It also puts
parenthesis around a number or a variable that directly follows the
square root sign, so √2 means sqrt(2).
Unicode には、よく使われるいくつかの分数が 1 つの Unicode
コードポイントとして符号化されています:
¼, ½, ¾, ⅐, ⅑, ⅒, ⅓, ⅔, ⅕, ⅖, ⅗, ⅘, ⅙, ⅚, ⅛, ⅜, ⅝, ⅞
wxMaxima は入力を Maxima に送る前に、これらを Maxima
での表現(たとえば (1/4) )に置き換えます。 1/
に置き換えられる ⅟ と、 (0/3) に置き換えられる
↉ (野球で使われます)もあります。
入力セルでは(これらの Unicode コードポイントではなく)
Maxima のコード を使うことをお勧めします(理由:(a)
数式入力に使っているフォントにこれらの文字が含まれていない可能性がある、(b)
文書を wxm
ファイルとして保存すると通常は(コマンドラインの)Maxima
でも読めるが、これらの置き換えはもちろんコマンドラインの Maxima
では働かない)。ただし、別の文書から数式をコピー&ペーストすると、こうした文字が入ることがあります。
サイドペインを使うと、重要な Maxima コマンドへのショートカット、目次、デバッグメッセージのウィンドウ、最近実行したコマンドの履歴などにアクセスできます。サイドペインは「表示」メニューで有効にできます。どれも wxMaxima ウィンドウの内外の別の場所へ移動できます。マウスでギリシャ文字を入力できるペインも便利です。
「目次」サイドペインでは、見出しを右クリックして一つ上または一つ下の見出しの種類を選ぶだけで、見出しのレベルを上げたり下げたりできます。
いくつかのワープロや類似のプログラムは、 MathML の入力を認識して編集可能な 2 次元の数式として自動的に挿入するか、(LibreOffice のように)「クリップボードから MathML をインポート」機能を持つ数式エディタを備えています。RTF の数式に対応しているものもあります。そのため WxMaxima は右クリックメニューにいくつかの項目を用意しています。
Edit → Paste LaTeX/MathML as Maxima Code (also in
the right-click menu) converts a formula from the clipboard into a
Maxima command, for example one copied from a paper, a web page
or an equation editor. LaTeX may come with or without $…$,
\(…\) or \[…\] around it, so
\int_0^1 \frac{\sin x}{x}\,dx becomes
integrate(sin(x)/x,x,0,1). The command goes where the
cursor is, or into a new code cell. MathML pasted into a code cell with
the ordinary Paste is converted the same way, since
nobody wants the XML in a code cell. If MathML copied with Copy
as MathML is pasted back, the result is the original command:
wxMaxima adds it to the MathML as an annotation.
LaTeX and MathML describe what a formula looks like, not what it
means, so the conversion has to interpret it. Fractions, roots, powers,
subscripts (x_1 becomes the name x_1,
a_{n+1} the array element a[n+1]), functions
with or without parentheses (\sin 2x),
\frac{d}{dx}, f'(x), integrals ending in
dx, sums and products with limits,
\lim_{x\to 0}, |x| and matrices are
understood. An e is Euler’s number, but an i
is only the imaginary unit when set upright (\mathrm{i}),
as it more often is an index. A product of a name and parentheses, like
x(y+1), is taken as a product unless the name is
f, g, h or longer than one
letter. Anything without a single meaning, like \pm,
\dots or text, isn’t guessed at: wxMaxima says
what it couldn’t convert instead. Check the command before evaluating
it.
WxMaxima は、数学の記法と衝突しない標準的な Markdown の記法をいくつかサポートしています。そのひとつが箇条書きです。
普通のテキスト
* 項目、インデントレベル 1
* インデントレベル 1 の別の項目
* 2 番目のインデントレベルの項目
* 2 番目のインデントレベルの 2 つ目の項目
* 1 番目のインデントレベルの 3 つ目の項目
普通のテキスト
WxMaxima は、 >
で始まるテキストをブロック引用として認識します。
普通のテキスト
> 引用 引用 引用 引用
> 引用 引用 引用 引用
> 引用 引用 引用 引用
普通のテキスト
WxMaxima の TeX および HTML 出力は、 =>
も認識して対応する Unicode 記号に置き換えます。
cogito => sum.
HTML と TeX のエクスポートが認識するその他の記号には、比較のための
<= と >= 、両向きの二重矢印(
<=> )、一重矢印( <-> 、
-> 、 <- )、そして対応する記号としての
+/- があります。TeX 出力では << と
>> も認識されます。
A web address in a text cell that starts with http://,
https:// or mailto: is shown as a link. Since
clicking into a text cell places the cursor there, a link is followed by
CTRL+clicking it (CMD+clicking on macOS), or by
right-clicking it and choosing “Open Link”; hovering over it shows where
it leads. The HTML export turns it into a link, the TeX export into a
\url{}. Links are always recognized from the text itself,
so nothing about them is stored in the file.
Links in a code cell’s comments (/* ... */) work the
same way. Elsewhere in code, for example inside a string, an address is
Maxima syntax and is not a link.
The same goes for web addresses in Maxima’s output, for
example in a string printed by
print("See https://wxmaxima-developers.github.io/wxmaxima/"):
CTRL+clicking the address or choosing “Open Link” from its
context menu opens it, while a plain click still selects the output.
Text in a text cell, a title or a section heading can be made bold, italic, underlined or struck through. Select the text and press the respective button in the toolbar; pressing the button again removes that formatting from the selection. With nothing selected the button switches the formatting on or off for what is typed next. The buttons are hidden by right-clicking the toolbar and unchecking “Text formatting buttons”. Code cells cannot be formatted: their colors already show the syntax of the code.
Superscript and subscript buttons work the same way: they make the text smaller and raise it above or lower it below the line, as in E = mc² or H₂O. A character cannot be both, so switching one of them on switches the other off. A line that contains a superscript, a subscript or a character that is taller than the font’s usual ones, for example an emoji, gets as much additional room as it needs.
The formatting is saved in .wxmx files. Older versions
of wxMaxima open such a file without the formatting but keep
all of the text. .wxm files, the exports and the clipboard
contain the text without its formatting.
ほとんどのショートカットキーは、それぞれのメニューの文字列に書かれています。ショートカットキーは実際にはメニューの文字列から取られており、 wxMaxima の翻訳によって各地のキーボードの利用者に合わせて変更できるので、ここでは記載しません。ただし、メニューに記載されていないショートカットキーや別名がいくつかあります。
A cell’s output can be selected, and explored part by part, without a mouse:
テキストセルが TeX: で始まっている場合、TeX
エクスポートには TeX:
の後に続くテキストがそのまま出力されます。この機能を使うと、
wxMaxima のワークシートに TeX
のマークアップを書き込めます。
Typst is a typesetting system whose
formula syntax is similar to LaTeX’s, but shorter. File →
Export can write a worksheet as a Typst (.typ)
file, and Edit → Copy as Typst (also in the right-click
menu) copies the selection: part of an output becomes a formula between
$ … $, whole cells become what the export makes of them.
The exported document defines two small functions, wxinput
and wxoutput, that put the prompts and labels beside the
input and the output; changing them changes the look of every cell.
Plots and images are written into a folder named after the document,
with _img appended; an animation shows its first frame.
Typst reads a name of several letters as one variable, so names like
abc are exported as strings ("abc"), which
Typst sets upright, and functions it doesn’t know as
op("asinh").
wxMaxima のセッションで作成した内容は、後で使うために次の 3 つのいずれかの方法で保存できます。
.mac ファイルは Maxima
のコマンドを含む普通のテキストファイルです。 Maxima の
batch() コマンドや load() コマンド、あるいは
wxMaxima
のファイル/バッチファイルメニュー項目で読み込めます。
以下に一例を示します。 Quadratic.mac
は関数を定義し、その後 wxdraw2d()
でグラフを描きます。続いてファイル Quadratic.mac
の内容が表示され、新しく定義された関数 f()
が評価されます。
注意:ファイル Quadratic.mac は Maxima
の通常の拡張子( .mac )を持っていますが、
wxMaxima でしか読めません。コマンド wxdraw2d() は
wxMaxima による Maxima
の拡張だからです。(コマンドラインの)Maxima は未知のコマンド
wxdraw2d()
を無視し、それをそのまま出力として表示します。
.mac
ファイルは独自のマクロのライブラリを書くのに使えます。しかし構造の情報が十分に含まれていないため、
wxMaxima のセッションとして読み戻すことはできません。
.wxm ファイルには、 Maxima
の出力を除いたワークシートが含まれます。Maxima のバージョンが 5.38
より新しければ、.mac ファイルと同じように Maxima の
load() 関数で読み込めます。まあ、ほとんどは。質問(
asksign(x)
など)は問題になります。答えは(読み込み後に提案できるように)
.wxm ファイルに書き込まれますが、Maxima
はそれを評価できないからです。 Maxima が知りたがる性質を
assume() で宣言しておけば、Maxima
に質問させないようにできます。
このプレーンテキスト形式では、新しい機能を使ったワークシートが古いバージョンの wxMaxima と下位互換にならないことが避けられない場合があります。
これは単なるプレーンテキストファイルで(テキストエディタで開けます)、セルの内容を特別な Maxima のコメントとして含んでいます。
ファイルは次のコメントで始まります。
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 24.02.2_DevelopmentSnapshot ] */その後に、Maxima のコメントとして符号化されたセルが続きます。たとえば節セルは次のようになります。
/* [wxMaxima: section start ]
Title of the section
[wxMaxima: section end ] */また(数式セルでは、入力はもちろんコメントアウト されません
(出力は wxm ファイルには保存されません)):
/* [wxMaxima: input start ] */
f(x):=x^2+1$
f(2);
/* [wxMaxima: input end ] */画像は、1 行目に画像の種類を書いたうえで Base64 で符号化 されます:
/* [wxMaxima: image start ]
jpg
[very chaotic looking character sequence]
[wxMaxima: image end ] */改ページは次の内容を含む 1 行だけです。
/* [wxMaxima: page break ] */折りたたまれたセルは次のように示されます。
/* [wxMaxima: fold start ] */
...
/* [wxMaxima: fold end ] */この XML ベースのファイル形式は、ズーム倍率やウォッチリストなども含めてワークシート全体を保存します。推奨されるファイル形式です。
wxmx ファイルはバイナリ形式のように見えますが、OS
に含まれているツールで扱えます。これは zip ファイルで、
unzip で展開できます(OS
の展開プログラムが認識するよう、先に名前を変える必要があるかもしれません)。圧縮機能は使っておらず、複数のファイルを
1
つのファイルにまとめる機能だけを使っています。画像はもともと圧縮されており、残りは単純なテキストです(含まれている大きな画像よりたいていずっと小さいでしょう)。
次のファイルが含まれています。
mimetype :wxMaxima ファイルの MIME タイプ
text/x-wxmathml が書かれていますformat.txt :wxMaxima と wxmx
ファイル形式についての短い説明content.xml :文書のさまざまなセルを XML 形式で含む XML
文書。ですから何かがうまくいかなくなったときは、wxMaxima
の文書を展開し(先に zip
ファイルに名前を変えるとよいでしょう)、テキストエディタで
content.xml
ファイルを修正したり、壊れた画像を差し替えたりして、ファイルを再び zip
でまとめ、 zip を wxmx
ファイルに名前を戻せば、修正された wxmx
ファイルが得られます。
よく使われるいくつかの設定変数について、 wxMaxima は 2 通りの設定方法を提供しています。
新しいアニメーションに使われるフレームレートは、変数
wxanimate_framerate
に保持されています。新しいワークシートでこの変数が持つ初期値は、設定ダイアログで変更できます。
次回の起動以降、 maxima によって wxplot_size
の値が変更されない限り、ワークシートに埋め込まれるグラフはこのサイズで作られます。
1 つのグラフだけのサイズを設定するには、変数の値を 1 つのコマンドに対してだけ設定する次の記法が使えます。
wxdraw2d(
explicit(
x^2,
x,-5,5
)
), wxplot_size=[480,480]$このオプションを有効にすると、次の 2 つのことが行われます。
/* is closed by an
inserted */. Typing */ in front of it moves
the cursor past it instead.このオプションを設定すると、ワークシートのファイルはユーザーが要求したときにだけ上書きされます。それでも、クラッシュや停電などに備えて、一時ディレクトリに最近のバックアップが用意されます。
このオプションを設定しない場合、 wxMaxima は最近の携帯電話のアプリのように振る舞います。
The toolbar is made of sections, like the “Open” and “Save” buttons, the evaluation buttons or the drop-down list that sets the type of a cell. The “Toolbar” tab of the configuration dialog lists them in the order the toolbar shows them in: drag a section to another place, or select it and press “Up” or “Down”, to move it, and uncheck it to hide it. The flexible space pushes every section after it to the right edge of the window. “Default order” restores the original arrangement. Sections can also be shown or hidden by right-clicking the toolbar.
The “Page settings” tab of the configuration dialog sets the paper
the worksheet is printed and exported to PDF on: its size and
orientation, the margins (in millimetres) and the print scale, which
makes everything on paper bigger or smaller. Its “Default” tab is what
every document is printed with; its “This document” tab, which
Edit → Page Settings… opens on its own, can give the
current document settings of its own instead. These are saved in the
document’s .wxmx file, so the document is printed on the
same paper wherever it is opened (a .wxm file doesn’t keep
them).
View → Page View shows the worksheet the way it will be printed: it becomes as wide as the printable part of the page, so lines break where they will on paper, a matrix too large for the page is shrunk or split as it will be when printed, images get the size they will have on paper, and a dashed line marks where each page ends. The page view can be switched on and off at any time; it stays on for the next window opened.
Unix/Linux を使っている場合、設定情報はホームディレクトリのファイル
.wxMaxima (wxWidgets < 3.1.1 を使っている場合)、または
.config/wxMaxima.conf (wxWidgets >= 3.1.1
を使っている場合、XDG 標準)に保存されます。wxWidgets
のバージョンはコマンド wxbuild_info();
か、メニューのヘルプ->wxMaximaについて で確認できます。 wxWidgets は wxMaxima
の土台となっているクロスプラットフォームの GUI ライブラリです(名前の
wx はここから来ています)。
(ファイル名がドットで始まるため、 .wxMaxima や
.config は隠しファイルになります。)
Windows を使っている場合、設定はレジストリに保存されます。
wxMaxima のエントリはレジストリの次の場所にあります:
HKEY_CURRENT_USER\Software\wxMaxima
WxMaxima は何よりもまず Maxima のグラフィカルユーザーインターフェースです。そのため主な目的は、コマンドを Maxima に渡し、それを実行した結果を伝えることです。しかし場合によっては、 wxMaxima が Maxima に機能を追加します。ワークシートの内容を HTML や LaTeX ファイルにエクスポートしてレポートを作る WxMaxima の機能についてはすでに触れました。この節では、 wxMaxima がセッションへのグラフィックスの取り込みを強化するいくつかの方法を取り上げます。
wxsubscripts は、 wxMaxima
が変数名を自動的に添字付きで表示するかどうか(およびその方法)を指定します。
false の場合、この機能はオフで、wxMaxima
は変数名のアンダースコアの後ろの部分を自動的に添字にしません。
'all
に設定すると、アンダースコアの後ろのすべてが添字になります。
true に設定すると、 x_y
の形の変数名は次の場合に添字を使って表示されます。
x か y のどちらかが 1
文字である、またはy が整数である(複数の桁でもかまいません)。
A variable the rules above don’t cover can still be declared as “to
be subscripted” using the command
wxdeclare_subscripted(variable_name); or
wxdeclare_subscripted([variable_name1,variable_name2,...]);
Declaring a variable as subscripted can be reverted using the following
command: wxdeclare_subscripted(variable_name,false);, which
also keeps a variable the rules above do cover from being
subscripted.
wxdeclare_subscript(text_snippet); or
wxdeclare_subscript([text_snippet1,text_snippet2,...]);
instead declares a text snippet: every variable whose name ends in an
underscore followed by that snippet is subscripted, however long the two
parts are.
これらの値はメニュー「表示->Autosubscript」でも設定できます。
時間のかかるコマンドは、ステータスバーでユーザーにフィードバックを表示できます。このフィードバックは、新しいフィードバックが表示されるたびに置き換えられ(進捗表示として使えます)、
Maxima に送られた現在のコマンドが終わるとすぐに消されます。
wxstatusbar() は、( wxMaxima ではなく)素の
Maxima
でも使われるかもしれないライブラリの中でも安全に使えます。
wxMaxima がなければ、 wxstatusbar()
コマンドは評価されずにそのまま残るだけです。
for i:1 thru 10 do (
/* どこまで進んだかをユーザーに知らせる */
wxstatusbar(concat("Pass ",i)),
/* (sleep n) は Lisp の関数で、前に */
/* "?" を付けると使える。プログラムの */
/* 実行を遅らせる(ここでは 3 秒) */
?sleep(3)
)$コマンド wxworksheettohtml() は、実行中の
Maxima セッションの中から現在のワークシートを HTML
ファイルにエクスポートします。スクリプトやバッチ処理でのエクスポートに便利です。
wxstatusbar() と同様に、素の(コンソールの)
Maxima でも実行されるかもしれないコードの中で安全に使えます。
wxMaxima がなければ、コマンドは評価されずに残るだけです。
wxworksheettohtml("report.html")$
wxworksheettohtml("report.html", flavor="svg", wxmx=true)$相対ファイル名は Maxima の作業ディレクトリからの相対パスとして解釈されます。省略可能なキーワードオプションは次のとおりです。
| オプション | 値 | 意味 |
|---|---|---|
flavor |
mathml (既定)、 mathjax 、
svg 、 bitmap |
エクスポートしたページでの数式の表示方法 |
wxmx |
false (既定)、 true |
セッションのダウンロード可能な .wxmx
のコピーを埋め込む |
The images and the .wxmx copy are written into a folder
named after the HTML file, with _htmlimg appended. If
“Embed images into the .html file” is checked in the Export tab of the
configuration dialog, they are embedded into the HTML file instead, so
it can be mailed as a single file.
flavor の値は、GUI の ファイル →
エクスポート ダイアログで選べる数式の形式に対応しています。
mathml
はインターネット接続の要らない自己完結したページを作り、
mathjax はまだ MathML に対応していないブラウザ向けに
MathJaX による代替表示を加え、 svg / bitmap
はすべての数式を画像として描画します。
対になるコマンド wxworksheettotex() は、同じようにして
LaTeX( .tex )ファイルにエクスポートします。
wxworksheettotex("report.tex")$
wxworksheettotex("report.tex", documentclass="report", documentclassoptions="12pt,a4paper")$| オプション | 意味 |
|---|---|
documentclass |
LaTeX の \documentclass を上書きする(例:
"article" 、 "report" ) |
documentclassoptions |
そのオプションを上書きする(例: "12pt,a4paper" ) |
wxworksheettopdf() exports the worksheet to a PDF file,
as File → Export does when a .pdf file is
chosen:
wxworksheettopdf("report.pdf")$
wxworksheettopdf("report.pdf", language="de", paper="letter", landscape=true)$| option | meaning |
|---|---|
title |
the document title PDF viewers show (default: the worksheet’s title cell, or the file name) |
language |
the document’s language, e.g. "en" or
"de-AT" (default: the language of wxMaxima’s
menus) |
paper |
a4, a3, a5,
letter or legal (default: the paper of the
page settings) |
landscape |
false, true (default: the orientation of
the page settings) |
The PDF looks like a printout, on the paper, with the margins and the
print scale, of the document’s page settings (see “Page settings and the
page view”). Unlike a printout to a PDF printer, it keeps the text as
text, in the worksheet’s fonts, all of which are embedded in the file;
characters that the worksheet’s fonts lack, Greek letters and
mathematical symbols for example, are taken from another installed font
that has them. The PDF is also tagged: screen readers and other
assistive technology can tell headings, text, code and formulas apart
and read them in the right order. Each formula carries Maxima’s
linear notation of it as its spoken description and its MathML, which
screen readers that understand MathML present as a formula, and each
plot the command that created it. Screen readers need to know the
document’s language to pronounce it, which is what the
language option is for.
グラフの描画は(本質的にグラフィックスに関わるものなので)、グラフィカルユーザーインターフェースが元のプログラムに拡張を加えなければならない部分です。
Maxima は通常、外部プログラム Gnuplot に、作成する図ごとに別のウィンドウを開くよう指示します。グラフをワークシートに埋め込むほうが便利なことが多いので、 wxMaxima は独自のグラフ描画関数を提供しています。これらは対応する maxima の関数と名前以外は変わりません。すべて名前の先頭に「wx」が付いています。
次のグラフ描画関数には wx 版があります。
| wxMaxima のグラフ関数 | Maxima のグラフ関数 |
|---|---|
wxplot2d() |
plot2d |
wxplot3d() |
plot3d |
wxdraw2d() |
draw2d |
wxdraw3d() |
draw2d |
wxdraw() |
draw |
wximplicit_plot() |
implicit_plot |
wxhistogram() |
histogram |
wxscatterplot() |
scatterplot |
wxbarsplot() |
barsplot |
wxpiechart() |
piechart |
wxboxplot() |
boxplot |
wxm ファイルを(コンソールの)Maxima
で読み込むと、これらの関数は無視されます(そして Maxima
のほかの未知の関数と同様に、出力として表示されます)。
これらの関数のどれかで問題が起きた場合は、Maxima
の関数でも同じ問題が起きるか確認してください(たとえば
wxplot2d() でエラーになったら、同じグラフを Maxima
のコマンド plot2d()
(グラフを別ウィンドウで開きます)で試してください)。それでも問題が消えなければ、おそらく
Maxima の問題なので、 Maxima
のバグトラッカー に報告してください。あるいは Gnuplot
の問題かもしれません。
前述のとおり、設定ダイアログでは作成されるグラフの既定のサイズを変更でき、これにより
wxplot_size の初期値が設定されます。 wxMaxima
のグラフ描画ルーチンは、グラフのサイズをピクセル単位で指定するこの変数に従います。この変数はいつでも参照でき、また以降のグラフのサイズを設定するのにも使えます。
wxplot_size:[1200,800]$
wxdraw2d(
explicit(
sin(x),
x,1,10
)
)$1 つのグラフのサイズだけを変える場合、 Maxima
には属性を現在のセルに対してだけ変更する標準的な方法があります。この使い方では、指定
wxplot_size = [value1, value2] を wxdraw2d( )
コマンドの後ろに付け加えます。これは wxdraw2d
コマンドの一部ではありません。
wxdraw2d(
explicit(
sin(x),
x,1,10
)
),wxplot_size=[1600,800]$wxplot_size で埋め込みグラフのサイズを設定する方法は、
wxplot 、 wxdraw 、
wxcontour_plot 、 wximplicit_plot
などのコマンドによる埋め込みグラフや、 with_slider_draw 、
wxanimate
コマンドによる埋め込みアニメーションで使えます。
wxplot_size tells Gnuplot how many pixels to
draw. If a plot is wider than the window, wxMaxima shrinks it
until it fits. If one specific plot is meant to be shown larger, even if
that means it no longer fits on the screen, or smaller than that, the
variable wxplot_scale (default: 1) tells
wxMaxima to show it that many times as large as it would
otherwise:
wxdraw2d(
explicit(
sin(x),
x,1,10
)
),wxplot_scale=2$Unlike a bigger wxplot_size, which makes the text and
lines of a plot smaller in relation to the plot,
wxplot_scale makes everything larger, the text included.
The factor is stored in the worksheet with the plot, so it survives
saving and re-opening the file. It is respected by the same commands as
wxplot_size. If wxMaxima shows plots as scalable
vector graphics (see “Create scalable plots” in the configuration
dialog) they stay sharp at any scale; a bitmap plot gets blurry if it is
enlarged a lot.
A plot that should be wide but not high, for example a waveform, is
better made with wxplot_size: a wider
wxplot_size gives more room for the data, at the same
height and with text of the same size. As such a plot would normally be
shrunk to fit into the window, which makes its text tiny again,
wxplot_scale='native tells wxMaxima to show it at
exactly the size wxplot_size asks for, even if that is
wider than the window:
wxdraw2d(
explicit(
sin(10*x)*exp(-x/3),
x,0,10
)
),wxplot_size=[1600,300],wxplot_scale='native$Gnuplot には、Cairo
ライブラリによる高品質なビットマップ出力に対応しているかどうかを判定する移植性のある方法がないようです。
Gnuplot
がこのライブラリを使うようにコンパイルされているシステムでは、設定メニューの
pngCairo オプション(変数 wxplot_pngcairo
で上書きできます)を使うと、アンチエイリアスと追加の線のスタイルが使えるようになります。
Gnuplot が対応していないのに wxplot_pngCairo
を設定すると、グラフの代わりにエラーメッセージが表示されます。
wxdraw 系のコマンドで作られたグラフで(
wxplot2d と wxplot3d
はこの機能に対応していません)、もとになる Gnuplot
プロジェクトのファイルサイズが大きすぎない場合、 wxMaxima
はグラフを対話的な Gnuplot
ウィンドウで開ける右クリックメニューを提供します。
plot
ウィンドウで Gnuplot のコマンドコンソールを開くMS Windows には gnuplot.exe と wgnuplot.exe
の 2 つの Gnuplot
プログラムがあります。どちらを使うかは設定メニューで設定できます。
wgnuplot.exe には gnuplot
のコマンドを入力できるコンソールウィンドウを開く機能がありますが、
gnuplot.exe にはありません。残念ながら
wgnuplot.exe を使うと、グラフを準備するたびに
Gnuplot
が短い間キーボードのフォーカスを「奪って」しまいます。
3 次元の図では、定量的なデータが読み取りにくくなりがちです。代わりに
3 番目のパラメーターをマウスホイールに割り当てるのも有効な方法です。
with_slider_draw
コマンドは、複数のグラフを用意し、画面上部のスライダーを動かしてそれらを切り替えられるようにした
wxdraw2d の一種です。 WxMaxima
はこのアニメーションをアニメーション GIF
としてエクスポートできます。
with_slider_draw の最初の 2
つの引数は、グラフごとに値を変える変数の名前と、その変数の値のリストです。その後に続く引数は
wxdraw2d の通常の引数です。
with_slider_draw(
f,[1,2,3,4,5,6,7,10],
title=concat("f=",f,"Hz"),
explicit(
sin(2*%pi*f*x),
x,0,1
),grid=true
);3 次元グラフ用の同じ機能は with_slider_draw3d
として使え、3 次元グラフを回転させることができます。
wxanimate_autoplay:true;
wxanimate_framerate:20;
with_slider_draw3d(
α,makelist(i,i,1,360,3),
title=sconcat("α=",α),
surface_hide=true,
contour=both,
view=[60,α],
explicit(
sin(x)*sin(y),
x,-π,π,
y,-π,π
)
)$グラフの大まかな形が重要な場合は、グラフを少し動かすだけで、その立体的な形を直感的に把握できることがあります。
wxanimate_autoplay:true;
wxanimate_framerate:20;
with_slider_draw3d(
t,makelist(i,i,0,2*π,.05*π),
title=sconcat("α=",α),
surface_hide=true,
contour=both,
view=[60,30+5*sin(t)],
explicit(
sin(x)*y^2,
x,-2*π,2*π,
y,-2*π,2*π
)
)$with_slider_draw and with_slider_draw3d
make each frame out of a single 2D or 3D scene.
with_slider_draw_bare instead hands the arguments that
follow the variable and its values to a plain draw command.
Each frame can therefore consist of several gr2d and
gr3d scenes, and draw’s global options like
columns or dimensions can be used as well:
with_slider_draw_bare(
f,[1,2,3,4,5],
columns=2,
gr2d(
title=concat("f=",f),
explicit(sin(f*x),x,0,2*π)
),
gr3d(
explicit(sin(f*x)*cos(y),x,0,2*π,y,0,2*π)
)
);Like with_slider_draw,
with_slider_draw_bare accepts
file_name="name", which saves the animation as
name.gif in Maxima’s working directory. As
draw cannot turn a frame of several scenes into a single
frame of a gif, wxMaxima assembles that gif from the frames it shows,
and the animation is still shown in the worksheet. The gif file is only
written when the command is evaluated in wxMaxima.
draw より plot に慣れている人のために、もう
1 組の関数があります。
with_slider とwxanimate.通常、アニメーションは wxMaxima
の設定で選んだフレームレートで再生またはエクスポートされます。個々のアニメーションの再生速度を設定するには、変数
wxanimate_framerate を使います。
wxanimate(a, 10,
sin(a*x), [x,-5,5]), wxanimate_framerate=6$アニメーション関数は Maxima の makelist
コマンドを使っているため、同じ落とし穴があります。スライダー変数の値が式に代入されるのは、その変数が式の中に直接現れている場合だけです。そのため次の例はうまくいきません。
f:sin(a*x);
with_slider_draw(
a,makelist(i/2,i,1,10),
title=concat("a=",float(a)),
grid=true,
explicit(f,x,0,10)
)$スライダーの値を代入するよう Maxima に明示的に指示すれば、グラフは問題なく描けます。
f:sin(a*x);
with_slider_draw(
b,makelist(i/2,i,1,10),
title=concat("a=",float(b)),
grid=true,
explicit(
subst(a=b,f),
x,0,10
)
)$wxMaxima が提供している機能ではありませんが、 Maxima のこの機能は(対応している環境では)便利なことがあります。次の例は、Mario Rodriguez が Maxima のメーリングリストに投稿したものです。
load(draw);
/* ウィンドウ 1 に放物線 */
draw2d(terminal=[wxt,1],explicit(x^2,x,-1,1));
/* ウィンドウ 2 に放物線 */
draw2d(terminal=[wxt,2],explicit(x^2,x,-1,1));
/* ウィンドウ 3 に放物面 */
draw3d(terminal=[wxt,3],explicit(x^2+y^2,x,-1,1,y,-1,1));同じウィンドウに複数のグラフを描くこともできます(コマンドラインの
Maxima でも、標準の draw()
コマンドで同じことができます)。
wxdraw(
gr2d(
key="sin (x)",grid=[2,2],
explicit(sin(x),x,0,2*%pi)),
gr2d(
key="cos (x)",grid=[2,2],
explicit(cos(x),x,0,2*%pi))
);「Plot using Draw」サイドバーには簡単なコード生成機能が隠れていて、 maxima に付属している draw パッケージの柔軟性の一部を活かしたシーンを生成できます。
2 次元のシーンを描く draw()
コマンドのひな形を生成します。このシーンには後で、シーンの内容を生成するコマンドを入れる必要があります。たとえば
“2D” ボタンの下の行にあるボタンを使います。
2D ボタンの便利な機能のひとつは、シーンを、ある変数(既定では t )がフレームごとに異なる値をとるアニメーションとして設定できることです。動く 2 次元のグラフのほうが、同じデータを静止した 3 次元のグラフで見るより解釈しやすいことがよくあります。
3 次元のシーンを描く draw()
コマンドのひな形を生成します。2 次元のシーンも 3
次元のシーンも設定されていない場合、ほかのボタンはすべて、そのボタンが生成するコマンドを含む
2 次元のシーンを設定します。
sin(x) 、 x*sin(x) 、
x^2+2*x-4 のような式の標準的なグラフを、カーソルがある
draw() コマンドに追加します。draw
コマンドがない場合は、そのグラフを含む 2
次元のシーンが生成されます。各シーンには任意の数のグラフを入れられます。
y=sin(x) 、 y*sin(x)=3 、
x^2+y^2=4
のような式が成り立つすべての点を探し、得られた曲線をカーソルがある
draw() コマンドの中に描きます。draw
コマンドがない場合は、そのグラフを含む 2
次元のシーンが生成されます。
変数を下限から上限まで変化させ、 t*sin(t) と
t*cos(t) のような 2 つの式を使って曲線の x、y(3
次元グラフでは z も)座標を生成し、その曲線を現在の draw
コマンドに入れます。
多数の点を描きます。点は線でつなぐこともできます。点の座標は、リストのリスト、2 次元配列、または軸ごとに 1 つのリストや配列から取られます。
図の上端にタイトルを描きます。
軸を設定します。
(3 次元グラフのみ):現在の draw()
コマンドの中で後に続くグラフのコマンドや、図の底面に、山の地図に見られるような等高線を追加します。また、このウィザードを使って曲面の描画を省き、等高線図だけを表示することもできます。
次のグラフの名前を示す項目を図の凡例に追加します。名前を空にすると、以降のグラフについて凡例の項目は生成されなくなります。
現在の draw コマンドに含まれる以降のグラフの線の色を設定します。
現在の draw コマンドに含まれる以降のグラフの塗りつぶしの色を設定します。
グリッド線を設定するウィザードを開きます。
どのグラフ描画プログラムにもある速度と精度のトレードオフの中で、適切な点を選べるようにします。
特に高解像度のディスプレイを使っていると、既定のフォントサイズがとても小さいことがあります。
draw ベースのコマンドでは、 font=... 、
font_size=...
のようなオプションでフォントとフォントサイズを設定できます。例:
wxdraw2d(
font="Helvetica",
font_size=30,
explicit(sin(x),x,1,10));plot 系のコマンド( wxplot2d 、
wxplot3d など)では、 gnuplot_preamble
コマンドでフォントサイズとフォントを設定できます。例:
wxplot2d(sin(x),[x,1,10],
[gnuplot_preamble, "set tics font \"Arial, 30\"; set xlabel font \",20\"; set ylabel font \",20\";"]);これは、数字のフォントをサイズ 30 の Arial に、xlabel と ylabel のフォントのサイズを(既定のフォントで)20 に設定します。
詳しくは Maxima と Gnuplot のドキュメントを参照してください。注意:Gnuplot は大きなフォントサイズで問題があるようです。 wxMaxima issue 1966 を参照してください。
.wxmx ファイル形式を使っている場合、 wxMaxima
のプロジェクトにファイルを埋め込むのはドラッグ&ドロップするだけの簡単さです。しかし場合によっては(たとえばセッションの途中で画像の内容が変わるかもしれない場合)、評価時に画像を読み込むようファイルに書いておくほうがよいこともあります。
show_image("man.png");wxMaxima の設定ダイアログでは、起動時に実行されるコマンドを書いた 2 つのファイルを編集できます。
maxima-init.macwxmaxima-init.macたとえば Gnuplot が /opt
にインストールされている場合(MacOS
ではよくあります)、これらのファイルに
gnuplot_command:"/opt/local/bin/gnuplot"$ (または
/opt/gnuplot/bin/gnuplot などのパス)を追加できます。
これらのファイルは Maxima のユーザーディレクトリ(Windows では通常
%USERPROFILE%/maxima 、それ以外では
$HOME/.maxima
)にあります。場所は次のコマンドで調べられます:
maxima_userdir;
wxsubscripts は、アンダースコアを含む変数名(
R_150 など)を添字付きの変数に変換するかどうかを
Maxima に伝えます。どの変数名が自動的に変換されるかの詳細は
wxdeclare_subscript を参照してください。wxfilename :この変数には、 wxMaxima
で現在開いているファイルの名前が入っています。wxdirname :この変数には、 wxMaxima
で現在開いているファイルがあるディレクトリの名前が入っています。wxplot_pngcairo は、 wxMaxima
が、より多くの線のスタイルと全体的により良いグラフィックス品質を提供する
Gnuplot の pngcairo
ターミナルを使おうとするかどうかを示します。wxplot_size は埋め込みグラフの解像度を定義します。wxchangedir :ほとんどの OS では、 wxMaxima は
Maxima
の作業ディレクトリを現在のファイルのディレクトリに自動的に設定します。これにより、ファイル入出力(たとえば
read_matrix
)で、読み書きするファイルのフルパスを指定する必要がなくなります。Windows
ではこの機能がエラーメッセージの原因になることがあるため、設定ダイアログで
false に設定できます。wxanimate_framerate :以降のアニメーションを再生する 1
秒あたりのフレーム数。wxanimate_autoplay
:既定でアニメーションを自動再生するかどうか。wxmaximaversion : wxMaxima
のバージョン番号を返します。wxwidgetsversion : wxMaxima が使っている
wxWidgets のバージョンを返します。wxdirs : wxMaxima
自身が使うパスを保持する構造体です。これらのパスはパッケージ作成者、ディストリビューション、OS
によって異なるためです。
wxdirs@userconfdir
:ユーザーの設定が保存されているディレクトリ。
maxima_userdir
(上記参照)と同じディレクトリで、どちらも同じ場所を指しています。
wxdirs@userconfdir が役に立つのは、 .mac
ファイルからは Maxima 側の変数より使いやすい場合だけです。wxdirs@datadir : wxMaxima
自身のデータ(アイコン、組み込みの自動補完リストなど)がインストールされているディレクトリ。wxdirs@helpdir
:このマニュアルのオフライン版がインストールされているディレクトリ。wxdirs@localedir : wxMaxima
の翻訳ファイルがインストールされているディレクトリ。wxdirs@maximalocation : wxMaxima
が起動するよう設定されている Maxima 実行ファイルのパス。関数 table_form() は、2 次元のリストを Maxima
の既定の出力ルーチンよりも読みやすい形で表示します。入力は、1
つ以上のリストからなるリストです。“print”
コマンドと同じく、このコマンドはドル記号で終えても出力を表示します。セミコロンで終えると、同じ表に加えて
“done” が表示されます。
table_form(
[
[1,2],
[3,4]
]
)$次の例が示すように、 table_form
コマンドがまとめるリストは、コマンドを実行する前に作っておくこともできます。
また、行列はリストのリストなので、同じようにして行列を表に変換できます。
関数 wx_matrix() は Maxima の matrix()
コマンドのラッパーで、wxMaxima
で行列をより柔軟に整形できるようにします。
wx_matrix( <matrix>, [options] )
lines=true
:セルの間に内部の区切り線を描きます。見出しとデータを視覚的に分けるのに必要です。rownames=true
:行列の最初の列がラベルであることを wxMaxima に伝えます。colnames=true
:行列の最初の行がラベルであることを wxMaxima に伝えます。parenstyle=<style>
:行列の周りに描く括弧の種類を設定します。使えるスタイルは
round () 、 square
[] 、 angled <> 、
straight || 、 none です。oversized=<mode>: Decides how
this one matrix is shown if it is too large for the window, whatever the
option Matrices too large for the window (see below) says:
full draws it in full, elide leaves out its
middle rows and columns, and scroll shows it in a box the
size of the window, with scrollbars of its own.banding=<mode>: Decides whether
every other row and column of this matrix is faintly shaded (see below):
true always shades them, even if the matrix fits the
window, false never does, not even in the window
double-clicking opens, and auto, the default, shades them
only if the matrix is too large for the window.例:
wx_matrix(matrix(["Name", "Value"], ["X", 10], ["Y", 20]),
lines=true, rownames=true, colnames=true, parenstyle=square);wx_matrix() doesn’t display anything itself: it returns
the matrix with the formatting attached, which is used whenever that
value is displayed. So it can be stored in a variable and displayed
later, formatted, and a matrix ended with $ isn’t displayed
at all. A new matrix calculated from it, for example by adding to it or
transposing it, is displayed the normal way again.
A matrix cannot be broken into lines the way a long sum can. So by
default wxMaxima leaves out the middle rows and columns of a matrix that
is too large for the window and marks the gap with ⋯,
⋮ and ⋱, the way a large matrix is written by
hand. The first and last rows and columns always stay visible, and
hovering the mouse over the matrix tells which rows and columns are not
shown. The option Matrices too large for the window in the
Worksheet tab of the configuration dialog can instead draw such
a matrix in full, which makes the whole worksheet scroll sideways, or
show it in a box the size of the window, with scrollbars of its own;
there the mouse wheel scrolls the worksheet, unless that matrix or
something inside it is selected, and such a matrix is printed with its
middle rows and columns left out. Whether it is elided or shown in a
scrolling box, every other row and column of such a matrix is faintly
shaded, so that a row or a column is easy to follow across it; a matrix
that fits the window stays plain, unless wx_matrix()’s
banding option says otherwise. All of this affects only
what is shown on screen and printed: copying, saving and exporting the
matrix always include every entry. wx_matrix()’s
oversized option overrides that option for a single matrix;
a matrix it asks to scroll is still elided on paper, and exporting a
matrix as an image still always shows all of it. On paper – printing and
the PDF export – a matrix that is drawn in full but is too wide for the
page is shrunk to fit it, though not below 60% of its size; one that
would have to shrink further is split into blocks of columns printed one
below the other, each headed with the numbers of its columns. A matrix
taller than a page continues on the next page between two of its rows.
Double-clicking a matrix that is elided or shown in a scrolling box
opens a window of its own that shows all of it; the window can be
resized and scrolled, and Escape closes it. Ctrl+F in
that window searches the matrix: each match selects the entry it is in
and scrolls it into view, and searching again steps on to the next
matching entry.
WxMaxima には、現在のシステムについてバグ報告用の情報を集める関数がいくつかあります。
wxbuild_info() は、現在実行中の wxMaxima
のバージョンについての情報を集めますwxbug_report()
は、バグをどこにどのように報告すればよいかを示しますMaxima の box() コマンドの 2
番目の引数がテキスト highlight の場合、 wxMaxima
はその引数を赤い前景色で表示します。
set_display() で、wxMaxima
が出力をどのように表示するかを設定できます。
set_display('xml) が既定値です。この場合、Maxima
は(機械が読める)XML の方言で wxMaxima と通信し(「Raw XML
monitor」サイドバーで確認できます)、結果の数式をきれいに表示します。たとえば見栄えのよい行列、根号、分数などです。
set_display('ascii) を使うと、wxMaxima
はコマンドラインの Maxima
と同じように、数式をアスキーアートとして出力します。
set_display('none) は「1 行」の ASCII
の結果になります。コマンドラインの Maxima のコマンド
display2d:false; と同じです。
WxMaxima のヘルプメニューから、Maxima と wxMaxima
のマニュアル、ヒント、いくつかのワークシートの例、コマンドラインの
Maxima に含まれているデモ( demo()
コマンド)にアクセスできます。
デモには次のように表示されることに注意してください。
At the ’_’ prompt, type ’;’ and <enter> to proceed with the demonstration.
これはコマンドラインの Maxima では正しいのですが、wxMaxima では既定で次のキーでデモを続ける必要があります: CTRL+ENTER
(これは 設定->ワークシート->“Hotkeys for sending commands to Maxima” で設定できます。)
Help > Troubleshooting checks the things that most often
keep wxMaxima from working: whether it finds Maxima,
whether Maxima starts, connects to wxMaxima, sends its
first prompt and proves that it is the Maxima wxMaxima
started, whether it accepts wxMaxima’s Lisp code and can load
packages and draw, whether its temp directory is usable for
plots, whether gnuplot can draw png and
pngcairo plots, whether wxMaxima can stop
Maxima again, and whether the manuals, the help sidebar, a web
browser, the translations, text in SVG images and the AI sidebar are
available. For that it starts a Maxima of its own, so the
worksheet’s Maxima and anything it is calculating are left
alone. The checks are grouped into pages (Maxima, packages and
plots, help and manuals, user interface), each marked with the symbol of
its most important result: a green check mark if everything works, a red
cross if something doesn’t. Selecting a line tells what was found and,
for a problem, what can be done about it; Copy report puts all
of it on the clipboard, ready to be pasted into a bug report.
Maxima (実際の数学の計算をするプログラム)と wxMaxima (使いやすいユーザーインターフェースを提供するプログラム)は別々のプログラムで、ローカルのネットワーク接続を通じて通信しています。そのため最も考えられる原因は、この接続が何らかの理由で機能していないことです。たとえばファイアウォールが、インターネットからの不正な接続を防ぐ(そしてインターネットへの接続の一部も遮断するかもしれない)だけでなく、同じコンピュータ内のプロセス間通信まで遮断するように設定されているかもしれません。 Maxima は Lisp 処理系によって実行されているため、遮断されているプロセスの名前が “maxima” であるとは限らないことに注意してください。ネットワーク接続を開くプログラムのよくある名前は、sbcl、gcl、ccl、lisp.exe などです。
Unix のコンピュータでは、同じコンピュータ内の 2 つのプログラムの間でネットワーク接続を提供するループバックネットワークが正しく設定されていないことも原因として考えられます。
最近の XML ベースの形式のほとんどは、内部的には普通の zip
ファイルです。 WxMaxima は圧縮を有効にしていないので、
.wxmx
ファイルの内容はどんなテキストエディタでも見られます。
壊れた .wxmx ファイルの名前を .zip
に変えた後もファイル末尾の zip の署名が無事であれば、ほとんどの OS
で、中に保存されている情報の任意の部分を取り出す方法があります。ワープロの文書から元の画像ファイルを取り出す必要があるときにも、この方法が使えます。zip
の署名が壊れていても、それで終わりとは限りません。 wxMaxima
が保存中に問題を検出した場合は .wxmx~
ファイルができており、その内容が役に立つかもしれません。
そのようなファイルがない場合でも、 .wxmx
ファイルはコンテナ形式で、XML の部分は圧縮されずに保存されています。
.wxmx ファイルの名前を .txt
ファイルに変え、テキストエディタを使ってファイルの内容から XML
の部分を取り出すことができます(
<?xml version="1.0" encoding="UTF-8"?> で始まり、
</wxMaximaDocument>
で終わります。このテキストの前後には、テキストエディタでは読めないバイナリの内容が表示されます)。
この内容だけを含むテキストファイル(たとえばこのテキストを新しいファイルにコピー&ペーストしたもの)を、
.xml で終わるファイル名で保存すれば、 wxMaxima
はその文書からテキストを復元できます。
通常、 wxMaxima は 2
次元の数式全体が転送されるのを待ってから組版を始めます。これにより、途中までしか届いていない数式を何度も組版しようとする時間を節約しています。ただし
disp コマンドを使えば、現在の Maxima
コマンドの終了を待たずに、すぐにデバッグ出力を表示できます。
for i:1 thru 10 do (
disp(i),
/* (sleep n) は Lisp の関数で、前に */
/* "?" を付けると使える。プログラムの */
/* 実行を遅らせる(ここでは 3 秒) */
?sleep(3)
)$あるいは、上で説明した wxstatusbar()
コマンドを使う方法もあります。
これは、 Maxima が Gnuplot に作成させるはずだったファイルを wxMaxima が読めなかったことを意味します。
このエラーの原因として考えられるのは次のとおりです。
implicit_plot
のようなサードパーティのパッケージの一部なのに、グラフを描く前にそのパッケージを
Maxima の load()
コマンドで読み込んでいなかった。maxima_userdir が指すディレクトリにある
.gnuplot で終わるファイルに、 Maxima から
Gnuplot
への指示が書かれています。そのため、問題を調べるときにはたいていこのファイルの内容が役に立ちます。wxplot_pngcairo を true
に設定しないでください。.png ファイルを出力しなかった。スライダー変数の値は、既定では描画する式の中にその変数が現れている場合にだけ代入されます。スライダー変数を描画する式に代入する
subst コマンドを使えば、この問題は解決します。 アニメーションをワークシートに埋め込む
の節の最後に例があります。
セルの操作とセル内の変更には別々の取り消し機能があるので、こうしたことが起きる可能性は低いでしょう。それでも起きてしまった場合は、データを取り戻す方法がいくつかあります。
playback();考えられる原因のひとつは、 wxMaxima の設定ダイアログの「Maxima」タブで設定された場所に Maxima が見つからず、まったく実行できないことです。動作する Maxima の実行ファイルへのパスを設定すれば、この問題は解決するはずです。
理論上は、 Maxima が計算を終えたことに wxMaxima が気づかず、そのため Maxima に新しいデータを送ってよいことを知らされないままになる可能性があります。その場合は、“Trigger evaluation”(評価のきっかけを与える)で 2 つのプログラムが再び同期するかもしれません。
Lisp コンパイラ SBCL
は既定で、性能の低いコンピュータでも動くようなメモリ制限を持っています。Lapack
のような大きなソフトウェアパッケージをコンパイルしたり、非常に大きな方程式のリストを扱ったりすると、この制限では足りないことがあります。制限を広げるには、SBCL
に何メガバイト確保するかを指示するコマンドラインパラメーター
--dynamic-space-size を渡します。32 ビットの Windows 版
SBCL は最大 999 メガバイトまで確保できます。Windows 上で動く 64
ビット版の SBCL なら、Lapack のコンパイルに必要な約 1280
メガバイトより多くを使うよう指示できます。
Maxima (つまり SBCL)にコマンドラインパラメーターを渡す方法のひとつは、 wxMaxima の設定ダイアログの「Maximaにパラメーターを追加」欄です。
パッケージ ibus-gtk
をインストールすればこの問題は解決するはずです。詳しくは(https://bugs.launchpad.net/ubuntu/+source/wxwidgets3.0/+bug/1421558)を参照してください。
Maxima が SBCL ベースの場合は、 .sbclrc
に次の行を追加する必要があります。
(setf sb-impl::*default-external-format* :utf-8)このファイルを置くフォルダーは、システムやインストール方法によって異なります。しかし、現在のセッションですでにセルを 1 つ評価した SBCL ベースの Maxima なら、次のコマンドを受け取るとその場所を教えてくれます。
:lisp (sb-impl::userinit-pathname)Wayland ディスプレイサーバーと wxWidgets の間にはいくつか問題があるようです。WxMaxima もその影響を受けることがあり、たとえばサイドバーを移動できなくなります。
Wayland を(全体で)無効にして X11 を使うか、次の設定で wxMaxima
だけに X Window System を使わせることができます:
GDK_BACKEND=x11
たとえば次のように wxMaxima を起動します。
GDK_BACKEND=x11 wxmaxima
一部の KDE Plasma
環境では、グローバルメニューバーをクリックすると消えてしまいます。これはグローバルメニューのプロキシの不具合なので、避ける唯一の方法は、グローバルメニューの代わりに独自のメニューバーを使うよう
wxMaxima に指示することです。次のように設定します:
UBUNTU_MENUPROXY=0
バージョン 26.05.0 以降の wxMaxima は、影響を受けるシステム(KDE、Unity、古い wxWidgets を使う Ubuntu)を検出すると、この変数を自動的に設定しようとします。
自動の修正がうまくいかない場合は、次のように手動で wxMaxima を起動できます。
UBUNTU_MENUPROXY=0 wxmaxima
wxWidgets が Microsoft の webview2 をサポートするようにコンパイルされていないか、Microsoft の webview2 がインストールされていないかのどちらかです。
Help/About lists which of the things the integrated browser needs this wxMaxima has and which it is missing; the log window (View/Toggle log window) shows the same list.
HTML ブラウザーが snap、flatpak、AppImage 版なのかもしれません。これらはどれも、ローカルシステムにインストールされたファイルに通常アクセスできません。別の理由として、maxima や wxMaxima が snap、flatpak など、ホストシステムから中身にアクセスできない形式でインストールされていることも考えられます。3 つ目の理由として、maxima の HTML マニュアルがインストールされておらず、オンラインのマニュアルにもアクセスできないことが考えられます。
ワークシートには .png ファイルが埋め込まれます。
WxMaxima では、それをどこに作るかをユーザーが指定できます。
wxdraw2d(
file_name="test", /* 拡張子 .png は自動的に付く */
explicit(sin(x),x,1,10)
);別の形式を使いたい場合は、画像を作ってからワークシートに取り込み直すほうが簡単です。
load("draw");
pngdraw(name,[contents]):=
(
draw(
append(
[
terminal=pngcairo,
dimensions=wxplot_size,
file_name=name
],
contents
)
),
show_image(printf(false,"~a.png",name))
);
pngdraw2d(name,[contents]):=
pngdraw(name,gr2d(contents));
pngdraw2d("Test",
explicit(sin(x),x,1,10)
);変数 wxplot_size を使います。
wxdraw2d(
explicit(sin(x),x,1,10)
),wxplot_size=[1000,1000];1 HIToolbox 0x00007ff80cd91726 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 102
2 HIToolbox 0x00007ff80cd912b8 _ZN15MenuBarInstance14EnableAutoShowEv + 52
3 HIToolbox 0x00007ff80cd35908 SetMenuBarObscured + 408
...
これは OS の問題かもしれません。メニューバーの自動非表示をオフにする(システム設定 => デスクトップと Dock => メニューバー)と解決することがあります。詳しくは wxMaxima issue #1746 を参照してください。
plot2d
or draw open no window, but print “Broken pipe”A message like
WARNING:
Couldn't write to #<SB-SYS:FD-STREAM for "descriptor 9" {1002FC5EF3}>:
Broken pipe
means that Gnuplot stopped before Maxima could send
it the plot. On MacOS the usual reason is that MacOS blocks a
Gnuplot that was downloaded from the internet: since
Maxima starts Gnuplot in the background, MacOS can’t
ask whether it may run. Starting Gnuplot once from a Terminal,
or allowing it in System Settings => Privacy & Security, tells
MacOS that it may; xattr -r -d com.apple.quarantine
followed by the path of Gnuplot (for example
Gnuplot.app) does the same. See wxMaxima
issue #1461.
XQuartz isn’t needed for plots in separate windows: neither
wxMaxima nor Maxima chooses a Gnuplot
terminal for them, so Gnuplot uses its own default one. That is
qt for a Gnuplot from Homebrew and
aqua (AquaTerm) for one from MacPorts, both of which draw
without XQuartz. Only a Gnuplot that offers nothing
but its x11 terminal, or GNUTERM set to
x11, needs XQuartz. Embedded plots
(wxplot2d, wxdraw and friends) never open a
window and don’t need any of this.
ログメッセージは問題の調査に役立つことがあります。WxMaxima は多くのイベントを記録できます。ほとんどのログの項目は、特に問題やバグがあるときに開発者の役に立ちます。「リリース」ビルドを実行している場合、 ログウィンドウは既定では表示されません。開発版を実行している場合は、既定で 2 つ目のウィンドウとして表示されます。このウィンドウは メニュー項目「表示->Toggle log window」で表示・非表示を切り替えられます。
ログウィンドウを表示していなくてもメッセージは「失われ」ません。後でログウィンドウを表示すると、(消去していなければ)過去のログメッセージを見られます。
こうしたメッセージは、バグ報告を作るとき(あるいは自分でバグを探すとき)に役立つことがあります。
コマンドラインオプション「–logtostderr」を使うと、ログメッセージを(追加で)STDERR にも出力できます。Windows の GUI アプリケーションには標準入出力がつながっていないため、Windows ではそのために別のテキストコンソールが開きます。
あります。 LaTeX パッケージ “geometry” を使って余白の大きさを指定します。
余白を 1cm にするには、LaTeX のプリアンブルに次の行を追加します(たとえば設定ダイアログの対応する欄 “エクスポート”->“TeXのプリアンブルに追加する行” を使います)。
\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}wxWidgets が十分に新しければ、OS のほかの部分がダークモードのとき
wxMaxima
も自動的にダークモードになります。ワークシート自体は既定で明るい背景ですが、別の設定にすることもできます。また、ワークシートの明暗をすばやく反転できる
View/Invert worksheet brightness
メニュー項目もあります。
Most images are drawn for a white background, and black line art with a transparent background would be invisible on a dark worksheet. So by default, if the worksheet background is dark, the transparent parts of images are filled with a backdrop color. Its color is the style Backdrop of transparent images in the Style tab of the configuration dialog, and the option Behind transparent parts of images in its Worksheet tab can switch the backdrop off, or draw it on a bright worksheet, too.
WxMaxima は、 Maxima の 1000 ページを超えるマニュアルの解析といった大きな作業をバックグラウンドのタスクに任せており、通常はまったく気づかれません。ただし、そのタスクの結果が必要になった時点で、 wxMaxima が作業を続ける前に数秒待たなければならないことがあります。
(ほかのアプリケーションでも同じ問題が起きることがあります。)’OK’ をクリックすると翻訳は問題なさそうに見えます。WxMaxima は自身の翻訳だけでなく、wxWidgets フレームワークの翻訳も使っています。
これらのロケールがシステムにないのかもしれません。Ubuntu/Debian
では次のコマンドで生成できます:
dpkg-reconfigure locales
これらの記号は Unicode サイドバーにあります(’double-struck capital’ で検索してください)。ただし、選択しているフォントもこれらの記号に対応している必要があります。正しく表示されない場合は、別のフォントを選んでください。
wxMaxima を使っている場合、Maxima の変数 maxima_frontend
は wxmaxima に設定されます。この場合、Maxima の変数
maxima_frontend_version には wxMaxima
のバージョンが入っています。
フロントエンドを使っていない場合(コマンドラインの Maxima
を使っている場合)、これらの変数は false です。
wx_version_min("26.09.0") returns true if
the running wxMaxima is at least version 26.09.0, and
false if it is older, or if the command runs in command
line Maxima. The parts of the version number are compared as
numbers, so 26.10.0 counts as newer than 26.9.0, and a part that is left
out counts as 0: wx_version_min("26.9") is the same as
wx_version_min("26.09.0"). A development version counts as
the version it will be released as.
wxMaxima 26.08.0 and older don’t know
wx_version_min() yet. There, as with any function
Maxima doesn’t know, the call isn’t an error: it just returns
itself, unevaluated, as wx_version_min("26.09.0"), which is
neither true nor false. So a plain
if wx_version_min("26.09.0") then ... stays unevaluated on
these versions, too. A worksheet that has to work with them as well can
compare the result with true, which gives
false there:
if wx_version_min("26.09.0") = true then
wx_matrix(M, oversized=scroll)
else
M;wxmx ファイルとして保存できない場合は、文書を wxm ファイルとして保存してみてください(逆の場合も同様です)。また、すべての出力を削除して(メニューの セル->全ての出力をクリア)からファイルを保存してみることもできます。予期しない出力が保存処理で問題を起こしているのかもしれません。
グラフィカルユーザーインターフェースを持つプログラムは、通常はデスクトップのアイコンやデスクトップメニューの項目をクリックするだけで起動できます。それでも WxMaxima をコマンドラインから起動する場合には、いくつかのコマンドラインオプションが使えます。
-v または --version
:バージョン情報を出力します-h または --help
:短いヘルプを出力します-o または --open=<str>
:このオプションの引数として与えたファイル名のファイルを開きます-e または --eval
:ファイルを開いた後に評価します。-b or --batch: If the command-line opens a
file all cells in this file are evaluated and the file is saved
afterward. This is for example useful if the session described in the
file makes Maxima generate output files. Batch-processing will
be stopped if wxMaxima detects that Maxima has output
an error and will exit if Maxima asks a question no scripted
answer exists for: Mathematics is somewhat interactive by nature so a
completely interaction-free batch processing cannot always be
guaranteed.-d or --diff: Compare 2 or 3 files
side-by-side using the Diff viewer.--single_process: Open all worksheets from within the
same process.--single_thread: Run all background tasks from within
the main thread.--logtostderr: Log all “debug messages” sidebar
messages to stderr, too.--pipe: Pipe messages from Maxima to stderr.--debug: Enable costly debug checks.--exit-on-error: Close the program on any maxima
error.--language=<lang>: Use this language for the user
interface instead of the one configured in the settings, for example
de, pt_BR or zh_CN. The setting
is not saved. Useful for checking a translation, or for making
screenshots for a translated manual.-f or --ini=<str>: Use the init file
that was given as an argument to this command-line switch-u, --use-version=<str>: Use maxima
version <str>.-l, --lisp=<str>: Use a Maxima
compiled with Lisp compiler <str>.-X, --extra-args=<str>: Allows to
specify extra Maxima arguments-m or --maxima=<str>: allows
specifying the location of the maxima binary--enableipc: Lets Maxima control wxMaxima via
interprocess communications. Use this option with care.--screenshot=<file>: Evaluate the file that is
opened, save a screenshot as <file> once
Maxima is idle and exit. What the screenshot shows is read from
the [Screenshot] group of the configuration file given by
--ini. Used for making the screenshots in this manual; see
info/screenshots/README.md in wxMaxima’s source code.--wxmathml-lisp=<str>: Location of wxMathML.lisp
(if not the built-in should be used, mainly for developers).OS によっては、コマンドラインオプションの前にマイナス記号ではなくダッシュを使うことがあります。
On Linux and other Unix-like systems wxMaxima installs completions for bash, zsh and fish, so the Tab key completes these options and the names of the files wxMaxima can open.
A successful run exits with status 0. A batch run that had to stop before finishing exits with one of the following statuses instead, so a script that calls wxMaxima can tell why it stopped without reading its log:
90: Maxima reported an error and
--exit-on-error was given.91: Maxima asked a question no scripted answer
exists for.92: The file named on the command line could not be
opened.93: Saving the worksheet failed.94: The data of an image in the worksheet could not be
loaded.95: An image in the worksheet could not be decoded
(only checked with --debug).wxMaxima は主に C++ プログラミング言語と wxWidgets フレームワーク で開発されており、ビルドシステムには CMake を使っています。ごく一部は Lisp で書かれています。これらのプログラミング言語の知識があり、オープンソースプロジェクト wxMaxima を手伝って貢献したい方は、 https://github.com/wxMaxima-developers/wxmaxima で wxMaxima プロジェクトに参加できます。
でも、必要なのはプログラマーだけではありません!ドキュメントの改善を手伝ったり、バグを見つけて報告したり(できれば修正も)、新しい機能を提案したり、wxMaxima やマニュアルをあなたの言語に翻訳する手伝いをしたりすることでも、wxMaxima に貢献できます(wxMaxima とマニュアルの翻訳方法については、 locale サブディレクトリ の README.md を読んでください)。
あるいは、ディスカッションフォーラムでほかのユーザーの質問に答えることでも貢献できます。
wxMaxima のソースコードは Doxygen でドキュメント化されています: こちら 。
このプログラムはほぼ自己完結しており、システムライブラリ(と
wxWidgets ライブラリ)を除けば外部の依存関係(グラフィックファイルや
Lisp の部分、つまり wxmathML.lisp
ファイルなど)は必要ありません。これらのファイルは実行ファイルに含まれています。
開発者の方で、すべてを再コンパイルせずに変更した
wxmathML.lisp
ファイルを試したい場合は、コマンドラインオプション
--wxmathml-lisp=<str>
を使えば、組み込みのものではなく別の Lisp ファイルを使えます。