1<?xml version="1.0" encoding="UTF-8"?>
2<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:id="math_rendering_features_in_graphic" xml:lang="ja">
3    <refnamediv>
4        <refname>Math rendering in Scilab graphics</refname>
5        <refpurpose>LaTeX またはMathML言語によりScilabグラフィックスで数式を表示する.</refpurpose>
6    </refnamediv>
7    <refsection>
8        <title>使用方法</title>
9        <para>Scilab 5.2以降, LaTeX または MathML式を記述することが可能です.</para>
10        <para>LaTeX テキストは先頭を末尾を $ (ドル記号) とし,
11            MathMLは&lt; で開始し, &gt;で終了すること,また文法的に正しいことが必要です.
12        </para>
13        <para>初回の使用の際,MathMLエンジンの起動はLaTeXよりも時間がかかります.
14            (これらのライブラリは必要な時にオンザフライで読み込まれます)
15        </para>
16        <programlisting role="example"><![CDATA[
17// LaTeX / MathML目盛の例:
18plot2d();
19a=gca();
20
21mathml="<mrow><mfrac><mrow><mi>d</mi><mi>y</mi></mrow><mrow><mi>d</mi><mi>x</mi></mrow></mfrac><mo>=</mo><mfrac>" + ..
22"<mn>1</mn><msup><mi>y</mi><mn>2</mn></msup></mfrac></mrow>";
23// LaTeX/MathML式の混用
24a.x_ticks = tlist(["ticks", "locations", "labels"], (0:6)', [mathml;"1";"$\sin(x)$";"3";"$\cos(a) - test$";"5";"6"]);
25 ]]></programlisting>
26    </refsection>
27    <refsection>
28        <title>LaTeXに関する説明</title>
29        <para>レンダリングエンジンはJavaライブラリJLaTeXMathに基づいています.
30            JLaTeXMathはLaTeXの数式モードの実装の一つです.
31            全てのLaTeXのコマンドを処理することができます(欠けている場合には
32            バグレポートを遠慮なく投稿してください).
33            逆に, <literal>\over</literal> のようなTeX コマンドはサポートされていません.
34        </para>
35        <para>Scilab 5.2.1以降, ギリシャ文字, キリル文字およびラテンアルファベット文字に
36            関する完全な Unicode が Scilabグラフィックスで処理されます.
37        </para>
38        <scilab:image>
39            xtitle('$\big\sum_{n=1}^{+\infty}\frac1{n^2}=\frac{\pi^2}{6}$')
40        </scilab:image>
41        <programlisting role="example"><![CDATA[
42xtitle('$\textstyle\sum_{n=1}^{+\infty}\frac1{n^2}=\frac{\pi^2}{6}$')
43xtitle('$\big(\bigg)$')
44xtitle('$\mbox{Vector field for }\ddot{\theta}=\sin\theta$')
45xtitle('$\JLaTeXMath\ \mathfrak{and}\ \mathtt{Scilab}$')
46xstring(0.5,0.5,"$\overbrace{привет\ мир} \underbrace{γειά\ κόσμο}$")
47 ]]></programlisting>
48        <para>JLaTeXMath では以下のコマンドにより複数のフォントを
49            指定することができます:
50            <literal>\mathbb</literal>, <literal>\mathscr</literal>,
51            <literal>\mathcal</literal>, <literal>\mathbf</literal>,
52            <literal>\mathit</literal>, <literal>\mathsf</literal>,
53            <literal>\mathtt</literal>, <literal>\mathfrak</literal>,
54            <literal>\mathds</literal>, <literal>\mathrm</literal>,
55            コマンド<literal>\boldsymbol</literal>を付けることにより,
56            ボールド体を指定することが可能です:
57        </para>
58        <programlisting role="example"><![CDATA[
59xtitle('$\mathbb{SCILAB}\ \mathsf{or}\ \boldsymbol{\mathfrak{Scilab}}$')
60xtitle('$\mathscr{C}\mbox{ n''est pas }\boldsymbol{\mathcal{C}}$')
61 ]]></programlisting>
62        <para>以下のLaTeXパッケージが利用可能です:
63            <replaceable>amsmath</replaceable>, <replaceable>amssymb</replaceable>,
64            <replaceable>stmaryrd</replaceable>, <replaceable>amsxtra</replaceable>
65            および<replaceable>graphics</replaceable>のいくつかのコマンドをサポートする
66            <replaceable>accents</replaceable>.
67            これらのパッケージのコマンドのほとんどが使用可能です
68            (例えば,<replaceable>amsmath</replaceable>のいくつかのコマンドは利用できません).
69        </para>
70        <programlisting role="example"><![CDATA[
71xtitle('$\sideset{_\alpha^\beta}{_\gamma^\delta}\prod$')
72xtitle('$\hat{\accentset{\star}{\hat h}}\undertilde{ABC}$')
73xtitle('$\begin{pmatrix}\mathfrak{a}&\alpha\\\mathbb{A}&\mathcal{A}\end{pmatrix}\mbox{ or }..
74\begin{bmatrix}\mathfrak{a}&\alpha\\\mathbb{A}&\mathcal{A}\end{bmatrix}$')
75xstring(0.5,0.5,'$\left(\frac{\pi}{\sqrt[3]{2}}\middle|\sqrt{\frac{1+\frac1x}{x}}\right\rangle$')
76xtitle('$\doublecup\ddag\fatbslash\lll\oplus\ovee\circledcirc\circlearrowright$')
77xtitle('$\rotatebox{180}{\boxed{\JLaTeXMath}}\ \reflectbox{\JLaTeXMath}$')
78xtitle('$\scalebox{0.6}{\sum_{n=1}^{+\infty}\frac1{n^2}=\frac{\pi^2}6}$')
79xtitle('$\fcolorbox{black}{Tan}{\JLaTeXMath}$')
80xtitle('$\textcolor{Magenta}{\mathfrak{Scilab}}\mbox{ and }\textcolor{Green}{\mathcal{SCILAB}}$')
81 ]]></programlisting>
82        <para>以下のように新しいコマンドや環境を定義することも可能です:</para>
83        <programlisting role="example"><![CDATA[
84xtitle('$\newcommand{\op}{\left(}\newcommand{\cp}{\right)} \op\frac12\cp$')
85xtitle('$\newcommand{\myfrac}[2]{\frac{\mathfrak{#1}}{\mathcal{#2}}}\myfrac{A}{B}$')
86 ]]></programlisting>
87    </refsection>
88    <refsection>
89        <title>MathML に関する説明</title>
90        <para>MathML レンダリングは Jeuclidに基づいています. Jeuclid は MathML
91            実装の一つで,仕様全体をカバーしています.
92            これにより、 MathML言語の全てが Scilabによりサポートされます.
93        </para>
94        <para>Jeuclid ライブラリの大きさのため,
95            初回の使用時にロードに数秒かかります.
96            しかし,次回以降は高速化されます.
97        </para>
98        <scilab:image><![CDATA[
99str="<mrow><mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac><mo></mo><mfenced open=""{"" close=""}"">" + ..
100"<mrow><mfrac><mrow><mfrac><mrow><mi>a</mi></mrow><mrow><mi>b</mi></mrow></mfrac></mrow><mrow><mfrac><mrow>" +  ..
101"<mi>c</mi></mrow><mrow><mi>d</mi></mrow></mfrac></mrow></mfrac></mrow></mfenced></mrow>"
102xtitle(str)
103]]></scilab:image>
104        <programlisting role="example"><![CDATA[
105plot3d();
106a=get("current_axes");
107a.x_label.font_size= 5;
108a.x_label.text="<mrow><mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac><mo></mo><mfenced open=""{"" close=""}"">" + ..
109"<mrow><mfrac><mrow><mfrac><mrow><mi>a</mi></mrow><mrow><mi>b</mi></mrow></mfrac></mrow><mrow><mfrac><mrow>" + ..
110"<mi>c</mi></mrow><mrow><mi>d</mi></mrow></mfrac></mrow></mfrac></mrow></mfenced></mrow>"
111 ]]></programlisting>
112    </refsection>
113    <refsection role="see also">
114        <title>参照</title>
115        <simplelist type="inline">
116            <member>
117                <link linkend="xtitle">xtitle</link>
118            </member>
119            <member>
120                <link linkend="axes_properties">axes_properties</link>
121            </member>
122            <member>
123                <link linkend="label_properties">label_properties</link>
124            </member>
125            <member>
126                <link linkend="legend_properties">legend_properties</link>
127            </member>
128            <member>
129                <link linkend="text_properties">text_properties</link>
130            </member>
131            <member>
132                <link linkend="xstringb">xstringb</link>
133            </member>
134            <member>
135                <link linkend="xstringl">xstringl</link>
136            </member>
137            <member>
138                <link linkend="xstring">xstring</link>
139            </member>
140            <member>
141                <link linkend="uicontrol">uicontrol</link>
142            </member>
143            <member>
144                <link linkend="uimenu">uimenu</link>
145            </member>
146        </simplelist>
147    </refsection>
148</refentry>
149