卒研関連


変更履歴
05-01-10 : tmathml を置く。
05-01-20 : TeX 命令にコマンド実行機能を追加。データファイルの構造も変更。 名前は tmathml-05-01-17。
05-01-23 : ToDo list追加。
05-02-09 : samle data 掲載。
05-02-16 : symbol.dat 掲載。

tiny MathML prototypeについて

「 tmathml target.tex>target.xml 」でMathML ファイルを出力。
current directoryにtMathML.dat必要(変更可)。
日本語はEUCのみ対応。
\title等の引数に日本語があると不具合が起きる場合があるかもしれない。
スパゲッティプログラムです。
tMathML.dat の構造
データは「TeXcommand,引数の数,置き換えデータ」 という形をしている。
置き換えデータ内の$1,$2,...,$k が引数と置き換わる。 frac,2,<mfrac> $1 $2 </mfrac>の場合\frac a b が <mfrac> a b</mfrac>に変る。実際はmath modeで変換されるので <mfrac> <mi> a </mi> <mi> b </mi> </mfrac> に変る。 但し、引数が負の場合は 「command,-k,data,n」の形をしており、 「com,-2,<baka>$-1 $-2 $1 $3 $2 </baka>,3 」の場合 「a b \com c d e」 は「<baka> a b c e d </baka>」に変る。
tMathML.datのデータは殆ど入力されていない。
「# normal」 行以降は non-math mode で使用される命令。 「# math」行以降は math mode で使用される命令。 「# commom」 行以降は共通に使用される命令。複数指定可。 それ意外の # で始まる行はコメント。
ToDo list
\[\],\(\)
sub & sup
lim型大型演算子のsub sup
\begin{aaa} bbb \end{aaa} に対する変換は変更が必要。
\section 等の自動numbering : XMLにすでにその仕組みがあると思われるがXMLについては詳細を知らない。
子カウンター
カウンターの表示
同じカウンターを使う異なる環境
\begin{eqation*}
\begin{eqnarray*}
\begin{array}
\begin{tabular}
\left\right
\enumerate
\item
\label,\ref
直後に[*をoptionでとる命令 : 例えば\sqrt[n]{5}
なにもない部分にsub,supをつけるとエラーになる。{}にならエラーにはならない。
データファイルの場所を環境変数等で設定する様に。
\tableofcontents
\newcommand,パターンマッチを含まない\def
未対応
\input,\include
\def

その他多数
疑問
math modeでの aの表示が異なるのはなぜか。(Linux上のmozillaの場合)
\{の処理はうまくいっているのか。
\ ,\spaceがあると挙動がおかしくなる。


次のtest.texをtmathmlにかけると 後ろにあるoutput xml file が得られる。
%% -- test.tex ------------------------------------------------------ \documentclass[a4j,12pt]{jarticle} \usepackage{kno2} \usepackage{kfig2} %------------------------------- \title{tiny MathML prototypeのtestについて} \author{河野正晴(北見工業大学)} %\date{\today} %\date{} \pagestyle{plain} %-------------------------------------- %\def\calB{{\cal B}} %\def\thefootnote{(\arabic{footnote})} %-------------------------------------- \begin{document} \maketitle %---------------------------------------------------------- $ 2 ^ 3 = 8$ は math mode であり。 $$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ は display math mode である。 定理を示すためには次の2つの命題を示せばよい。 %--------------------------------- \begin{prop} 2つの GS $\Sigma=(S,G,f)$ と $\Sigma'=(S,G',f')$ が同じラベル付きグラフを 決めるとき,つまり$L(\Sigma)\equiv L(\Sigma')$ となるとき, $M(\Sigma)$と$M(\Sigma')$ は同相,つまり $M(\Sigma)\cong M(\Sigma')$ である。 \end{prop} 2つとかいてあるのに1つしか命題がない。 % (この上の行に\%が書いてある)は消えるが, \% は消えない。 \end{document}
  • test source file
  • output xml file
    Files
  • tiny MathML prototype
  • tiny MathML prototype data file
  • tiny MathML prototype(1/17)
  • tiny MathML prototype data file(1/17)
  • sample data
  • symbol.dat
    その他
  • 原信一郎『Rubyプログラミング入門』オーム社
    E-mail: kouno@math.cs.kitami-it.ac.jp
    Tel & Fax: 0157-26-9337
    Last modified: Jan 10, 2005