ルギア君の戯言

雑多な記事。

imaxima

わざわざ大学のサイトライセンスを使って Mathematica 入れなくても Maxima でも十分だということがわかったw
どうせやっても微積分三角関数ないしは指数関数がでてくるような方程式の解を求めるぐらいのことしかしないし。


ことの始まりは Maxima を使うためにターミナルエミュレータを開くのは面倒(えー)。
wxMaxima はいくら Restart しても右下のステータスバーで Maxima terminated! って言われて使いものにならない(設定不足?)。
というわけで Emacs 用の iMaxima を使うことに落ち着いたんだが、

Maxima 5.18.1 http://maxima.sourceforge.net
Using Lisp CLISP 2.47 (2008-10-23)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) diff(log(x),x);

LaTeX error in: \frac{1}{x}
(%i2) Expand((x-2)^4,x);

LaTeX error in: \mathrm{Expand}\left(\left(x-2\right)^4 , \linebreak[0]x\right)
(%i3) expand((x-2)^4);

LaTeX error in: x^4-8\,x^3+24\,x^2-32\,x+16
(%i4) debug();

LaTeX error in: \mathrm{debug}\left(\right)
(%i5) 

LaTeX エラー・・・rz


まあ、単に emacs の M-x maxima でも良いんだけど、それじゃターミナルエミュレータと同じだからせっかく emacs なんだし、TeX でタイプセットして画像にしてもらえば見易いってものじゃないか? ちょっと遅そうだけどね。


ということで、原因究明開始。


調べてみたら LaTeX が吐いたメッセージを見ることができた。

This is pTeX, Version 3.141592-p3.1.10 (utf8.euc) (Web2C 7.5.4) (format=platex 2009.7.23)  6 OCT 2009 21:37
**&mylatex /tmp/imaxima266838De/1.tex
(/tmp/imaxima266838De/1.tex
pLaTeX2e <2006/11/10>+0 (based on LaTeX2e <2003/12/01> patch level 0)
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/leqno.clo
File: leqno.clo 1998/08/17 v1.1c Standard LaTeX option (left equation numbers)
)
(/usr/share/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen118
)
No file 1.aux.
\openout1 = `1.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for JY1/mc/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for JT1/mc/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
! Undefined control sequence.
l.6 \pagecolor
              [rgb]{0.996109,0.996109,0.996109}\pagestyle{empty}
? 
! Emergency stop.
l.6 \pagecolor
              [rgb]{0.996109,0.996109,0.996109}\pagestyle{empty}
End of file on the terminal!

 
Here is how much of TeX's memory you used:
 201 strings out of 94681
 2186 string characters out of 1168355
 51412 words of memory out of 1500000
 3574 multiletter control sequences out of 10000+50000
 8274 words of font info for 34 fonts, out of 1200000 for 2000
 566 hyphenation exceptions out of 8191
 22i,0n,19p,138b,40s stack positions out of 5000i,500n,6000p,200000b,5000s
No pages of output.

color.sty を読み込んでないのに pagecolor は使えませんよねー・・・


えーっと・・・

(setq imaxima-tex-program "platex")
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(imaxima-latex-preamble "\\usepackage{color}")
 '(imaxima-print-tex-command "platex %s; dvips -o imax.ps %s; gv imax.ps"))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

これで良いかな・・・いや、だめ?

\documentclass[11pt,leqno]{article}

% mylatex
\setlength{\textwidth}{177mm}
\begin{document}
\pagecolor[rgb]{0.996109,0.996109,0.996109}\pagestyle{empty}
\begin{normalsize}
\color[rgb]{1.000000,0.000000,0.000000}\tt\begin{dmath}[number={\%o1}]
\color[rgb]{0.078126,0.074220,0.070314}\frac{1}{x}\end{dmath}
\end{normalsize}
\end{document}

・・・入ってないぞー


覗いたら

/tmp/imaximaXXXXXXXX/format.tex

(XXXXXXXX は mktemp で作られるような文字列)
に足されてるw

\documentclass[11pt,leqno]{article}
\usepackage{color}\usepackage{color}
\usepackage{exscale}
...

(笑)

あ、タイプセットしようとしているファイルは

/tmp/imaximaXXXXXXXX/n.tex

らしい。
n は (%on) と同じ値。


謎。