ulmul 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Changes ADDED
@@ -0,0 +1,9 @@
1
+ = Changes in each version
2
+ == 0.5.1
3
+ * ulmul2mathjax, a new command, converts ulmul texts into MathJax documents.
4
+ * Way to give @subs_rules is changed.
5
+
6
+ == 0.5.0
7
+ * \Fig:foo--/Fig:foo, \Table:bar--/Table:bar, \Code:baz--/Code:baz, and \Eq:hoge--/Eq:hoge.
8
+ * Start to use AASM library internally.
9
+
data/README-en CHANGED
@@ -11,13 +11,13 @@ Homepage of ULMUL: http://ulmul.rubyforge.org/
11
11
  Download ULMUL from: http://rubygems.org/gems/ulmul or http://rubyforge.org/projects/ulmul
12
12
 
13
13
  == Features
14
- * TeX style equations between two dollar marks ($) and between \Eq:foo and /Eq:foo
15
- will be converted into MathML. You can use Firefox4, IE9, etc. to read MathML.
14
+ * TeX style equations between two dollar marks ($) and between "\Eq:foo" and "/Eq:foo"
15
+ will be converted into MathML. You can use Firefox 4, IE9, etc. to read MathML.
16
16
  * ulmul2html5 output is good with the Slidy presentation environment
17
17
  http://www.w3.org/Talks/Tools/Slidy/ using Firefox+CSS+XHTML+JavaScript.
18
18
  Please use ulmul-slidy.js and ulmul-slidy.css in the package.
19
19
  * Figures, tables and code can be inserted to the document.
20
- They can be easily refered in the text.
20
+ They can be easily referred in the text.
21
21
  * Lines starting from "#" are comments.
22
22
  * You can add your conversion rules to @subs_rules.
23
23
  * "Table of Contents" will be automatically generated.
@@ -44,7 +44,7 @@ Starting with "= ", "== ", "=== ", "==== ", "===== ", and "====== ".
44
44
  ==== asterisk
45
45
  Lines starting with asterisks become itemizing list.
46
46
  For example,
47
- # Nesting is allowed uo to 5th level.
47
+ # Nesting is allowed up to 4th--5th level.
48
48
  * First
49
49
  * Second
50
50
  * Third
@@ -54,7 +54,7 @@ For example,
54
54
  * More for third
55
55
  * More for first
56
56
  become
57
- # Nesting is allowed uo to 5th level.
57
+ # Nesting is allowed up to 4th--5th level.
58
58
  * First
59
59
  * Second
60
60
  * Third
@@ -88,9 +88,11 @@ Mass $m$ can be converted into energy $E$ as
88
88
  E=mc^2.
89
89
  /Eq:Emc2
90
90
 
91
+ You can refer the equation in a way like "Eq:Einstein", as Eq:Emc2.
92
+
91
93
  To view the equations in MathML correctly, please use
92
- * Firefox 4 http://mozilla.jp/firefox/
93
- * IE9
94
+ * Firefox 4 http://mozilla.jp/firefox/
95
+ * IE9 http://windows.microsoft.com/en-US/internet-explorer/products/ie/home
94
96
  * etc.
95
97
 
96
98
  === Figures
@@ -103,12 +105,14 @@ Input:
103
105
  \Fig:ruby ruby.jpg
104
106
  The is a dummy figure for an example.
105
107
  Cute red logo of Ruby, isn't it?
108
+ You can write equations even in a caption as $ax^2+bx+c=0$.
106
109
  /Fig:ruby
107
110
 
108
111
  Output:
109
112
  \Fig:ruby ruby.jpg
110
113
  The is a dummy figure for an example.
111
114
  Cute red logo of Ruby, isn't it?
115
+ You can write equations even in a caption as $ax^2+bx+c=0$.
112
116
  /Fig:ruby
113
117
 
114
118
  === Tables
@@ -182,6 +186,12 @@ If you do not need the Table of Contents, specify 1.
182
186
  === ulmul2xhtml is obsolete
183
187
  ulmul2xhtml will be removed from next version 0.6.x.
184
188
 
189
+ == Usage of ulmul2mathjax
190
+ It uses MathJax http://www.mathjax.org/ to show equations.
191
+ $ ulmul2mathjax --help
192
+ $ ulmul2mathjax -s ulmul2html5.css -s google-code-prettify/src/prettify.css -j google-code-prettify/src/prettify.js \
193
+ -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html
194
+
185
195
  == Usage of ulmul2latex
186
196
  $ ulmul2latex --help
187
197
  $ ulmul2latex test.ulmul | tee test.tex
@@ -191,9 +201,9 @@ ulmul2xhtml will be removed from next version 0.6.x.
191
201
  ulmul2latex is still under development. Sorry.
192
202
 
193
203
  == TODO
194
- * More usefull error messages for syntax errors.
204
+ * More useful error messages for syntax errors.
195
205
  * Unit test, tests/ulmul_test.rb
196
- * @body shoud be XML object, not a String.
206
+ * @body should be XML object, not a String.
197
207
  * Citation.
198
208
  For more, see TODO file.
199
209
 
data/README-ja CHANGED
@@ -9,11 +9,11 @@ Rubyで書かれています。ulmul.rbをライブラリとして利用する
9
9
  ダウンロード: http://rubygems.org/gems/ulmul または http://rubyforge.org/projects/ulmul/
10
10
 
11
11
  == 特徴
12
- * 文章中の2つのドル記号($)で挟まれた部分と\Eq:fooと/Eq:fooとで挟まれた行が
12
+ * 文章中の2つのドル記号($)で挟まれた部分と"\Eq:foo"と"/Eq:foo"とで挟まれた行が
13
13
  数式としてTeX形式からMathML形式に変換されます。MathMLとはXMLで数式を記述
14
14
  するための規格です。込み入った規格なので人間が直接MathMLを記述する
15
15
  ことは想定されていませんが、ULMULでやっているようにTeXなどからの変換により
16
- 生成することができます。Firefox4やIE9で読めるようです。
16
+ 生成することができます。Firefox 4やIE9で読めるようです。
17
17
  math_ml.rb http://www.hinet.mydns.jp/?mathml.rb を使っています。
18
18
  * ウェブ・ブラウザ+CSS+XHTML+JavaScriptを使ったプレゼン環境
19
19
  Slidy http://www.w3.org/Talks/Tools/Slidy/ に対応したxhtmlが出力可能。
@@ -28,7 +28,7 @@ Rubyで書かれています。ulmul.rbをライブラリとして利用する
28
28
  * テキストファイルはutf-8で書きます。自然言語は--language=jaなどとオプションで指定できます。
29
29
 
30
30
  == インストール方法
31
- gemでインストールすれば必要なライブラリも自動的にインストールされます:
31
+ RubyGems https://rubygems.org/ でインストールすれば必要なライブラリも自動的にインストールされます:
32
32
  $ sudo gem install ulmul
33
33
 
34
34
  == ULMULテキストの書き方
@@ -42,9 +42,9 @@ ulmul.rbは状態遷移 (state machine) ライブラリaasmを使っていて、
42
42
  "= ", "== ", "=== ", "==== ", "===== ", または "====== " で始めてください。
43
43
  「= ABCD EFGH」ならABCD EFGHがタイトルになります。Slidyの表紙にもなります。
44
44
  ==== アスタリスクで始まる行は箇条書きになります (asterisk)
45
- 5段までネストした箇条書きが可能です:
45
+ 4〜5段までネストした箇条書きが可能です:
46
46
  たとえば、
47
- # Nesting is allowed uo to 5th level.
47
+ # Nesting is allowed uo to 4th--5th level.
48
48
  * First
49
49
  * Second
50
50
  * Third
@@ -54,7 +54,7 @@ ulmul.rbは状態遷移 (state machine) ライブラリaasmを使っていて、
54
54
  * More for third
55
55
  * More for first
56
56
 
57
- # Nesting is allowed uo to 5th level.
57
+ # Nesting is allowed uo to 4th--5th level.
58
58
  * First
59
59
  * Second
60
60
  * Third
@@ -69,7 +69,7 @@ ulmul.rbは状態遷移 (state machine) ライブラリaasmを使っていて、
69
69
  ==== 終わり (end)
70
70
  EOF と "=end" が出てくると処理が終了します。
71
71
  ==== 無視される行 (ignore)
72
- Lines starting with"#" and "=begin" are ignored.
72
+ "#" または "=begin" で始まる行は無視されます。
73
73
  ==== その他の入力行 (normal)
74
74
  地の文になります。
75
75
 
@@ -94,9 +94,11 @@ Mass $m$ can be converted into energy $E$ as
94
94
  E=mc^2.
95
95
  /Eq:Emc2
96
96
 
97
+ 数式は"Eq:Einstein"のように参照します。こんなかんじ Eq:Emc2 。
98
+
97
99
  数式を正しくご覧いただくには
98
- * Firefox4 http://mozilla.jp/firefox/
99
- * IE9
100
+ * Firefox 4 http://mozilla.jp/firefox/
101
+ * IE9 http://windows.microsoft.com/ja-JP/internet-explorer/downloads/ie
100
102
  などのブラウザを試してみて下さい。
101
103
 
102
104
  === 図の挿入方法
@@ -107,14 +109,16 @@ Mass $m$ can be converted into energy $E$ as
107
109
 
108
110
  入力:
109
111
  \Fig:ruby ruby.jpg
110
- The is a dummy figure for an example.
111
- Cute red logo of Ruby, isn't it?
112
+ これは図のキャプションの例です。
113
+ Rubyのロゴを描いてみました。
114
+ キャプションに数式を$ax^2+bx+c=0$と書くこともできます。
112
115
  /Fig:ruby
113
116
 
114
117
  出力:
115
118
  \Fig:ruby ruby.jpg
116
- The is a dummy figure for an example.
117
- Cute red logo of Ruby, isn't it?
119
+ これは図のキャプションの例です。
120
+ Rubyのロゴを描いてみました。
121
+ キャプションに数式を$ax^2+bx+c=0$と書くこともできます。
118
122
  /Fig:ruby
119
123
 
120
124
  === 表の挿入方法
@@ -169,7 +173,13 @@ JavaScriptのファイル名を指定します。
169
173
  === ulmul2xhtmlは消します
170
174
  次のバージョン (0.6.x) からulmul2xhtmlは消します。
171
175
 
172
- == Usage of ulmul2latex
176
+ == ulmul2mathjaxの使用方法
177
+ 数式を MathJax http://www.mathjax.org/ で出力します。
178
+ $ ulmul2mathjax --help
179
+ $ ulmul2mathjax -s ulmul2html5.css -s google-code-prettify/src/prettify.css -j google-code-prettify/src/prettify.js \
180
+ -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html
181
+
182
+ == ulmul2latexの使用方法
173
183
  $ ulmul2latex --help
174
184
  $ ulmul2latex test.ulmul | tee test.tex
175
185
  $ latex test.tex
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  #! /usr/bin/env rake
2
2
  # -*-Ruby-*-
3
- # Time-stamp: <2011-04-02 19:31:51 takeshi>
3
+ # Time-stamp: <2011-04-09 13:38:30 takeshi>
4
4
  # Author: Takeshi Nishimatsu
5
5
  ##
6
6
  $LOAD_PATH.unshift('lib')
@@ -85,8 +85,7 @@ end
85
85
 
86
86
  desc "Create README-en.tex"
87
87
  file "README-en.tex" => ["bin/ulmul2latex", "README-en", "lib/ulmul.rb", "Rakefile"] do |t|
88
- sh "ruby -I lib #{t.prerequisites[0]} #{t.prerequisites[1]} | sed -e 's/\(\$\)/(\\\\$)/' -e 's/#/\\\\#/' \
88
+ sh "ruby -I lib #{t.prerequisites[0]} #{t.prerequisites[1]} | sed -e 's/\(\$\)/(\\\\$)/' -e 's/\"#/\"\\\\#/' \
89
89
  -e 's/subs_/subs\\\\_/' -e 's/eim_/eim\\\\_/' -e 's/math_/math\\\\_/' -e 's/ulmul_/ulmul\\\\_/' \
90
- -e 's/t_nissie/t\\\\_nissie/' -e 's/\\\\Eq/\\\\\\\\Eq/' \
91
- -e 's/\\\\Fig/\\\\\\\\Fig/' -e 's/\\\\Table/\\\\\\\\Table/' -e 's/\\\\Code/\\\\\\\\Code/' > #{t.name}"
90
+ -e 's/t_nissie/t\\\\_nissie/' -e 's/\"\\\\Eq/\"$\\\\backslash$Eq/' -e 's/\"\\\\Fig/\"$\\\\backslash$Fig/' -e 's/\"\\\\Table/\"$\\\\backslash$Table/' -e 's/\"\\\\Code/\"$\\\\backslash$Code/' > #{t.name}"
92
91
  end
data/bin/ulmul2latex CHANGED
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  # ulmul2latex
3
- # Time-stamp: <2011-03-28 19:47:33 takeshi>
3
+ # Time-stamp: <2011-04-09 13:15:37 takeshi>
4
4
  # Author: Takeshi Nishimatsu
5
5
  ##
6
6
  require "ulmul"
7
+ Version = Ulmul::VERSION
7
8
  name = ENV['USER'] || ENV['LOGNAME'] || Etc.getlogin || Etc.getpwuid.name
8
9
  packages = []
9
10
  $MAX_TABLE_OF_CONTENTS = 3
10
11
  opts = OptionParser.new
11
- opts.on("-p PACKAGE_FILENAME","--style PACKAGE_FILENAME","Specify package filename."){|v| stylesheets<<v}
12
+ opts.on("-p PACKAGE_FILENAME","--package PACKAGE_FILENAME","Specify package filename."){|v| packages<<v}
12
13
  opts.on("-n YOUR_NAME","--name YOUR_NAME","Specify your name."){|v| name=v}
13
14
  opts.on("-m MAX_TABLE_OF_CONTENTS","--max-table-of-contents MAX_TABLE_OF_CONTENTS",Integer,
14
15
  "Specify the maximum level for table of contents."){|v| $MAX_TABLE_OF_CONTENTS=v}
15
16
  opts.on_tail("-h", "--help", "Show this message."){puts opts.to_s.sub(/options/,'options] [filename'); exit}
16
17
  opts.parse!(ARGV)
17
- stylesheets=['ulmul2html5.css'] if stylesheets==[]
18
18
  Itemize::ITEMIZE_INITIATOR = '\begin{itemize}'
19
19
  Itemize::ITEMIZE_TERMINATOR = '\end{itemize}'
20
20
  Itemize::ITEM_INITIATOR = '\item '
@@ -27,8 +27,9 @@ class Ulmul
27
27
  include LaTeX
28
28
  end
29
29
  u=Ulmul.new()
30
+ u.subs_rules = lambda{|s| return s}
30
31
  u.parse(ARGF)
31
32
  puts u.file(packages,name)
32
33
  # Local variables:
33
- # compile-command: "ruby -I ../lib ulmul2latex ../lib/test.ulmul | tee test.tex && latex test.tex && dvipdfmx test.dvi"
34
+ # compile-command: "ruby -I ../lib ulmul2latex ../lib/test.ulmul | tee test.tex && latex test.tex && latex test.tex && dvipdfmx test.dvi"
34
35
  # End:
data/bin/ulmul2mathjax ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # ulmul2mathjax
3
+ # Time-stamp: <2011-04-06 06:52:05 takeshi>
4
+ # Author: Takeshi Nishimatsu
5
+ ##
6
+ =begin
7
+ = ulmul2mathjax
8
+ == Usage
9
+ === Examples
10
+ $ ulmul2mathjax --help
11
+ $ ulmul2mathjax -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' foo.txt
12
+ $ ulmul2mathjax --style=style.css --name="John Smith" foo.ulmul > foo.html
13
+ =end
14
+ require "ulmul"
15
+ # Local variables:
16
+ # compile-command: "cd .. && ruby -I lib bin/ulmul2mathjax -s ulmul2html5.css -s google-code-prettify/src/prettify.css -j google-code-prettify/src/prettify.js -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html"
17
+ # End:
data/index.en.html CHANGED
@@ -5,6 +5,13 @@
5
5
  <title>ULMUL (Ultra Lightweight MarkUp Language)</title>
6
6
  <meta name="author" content="Takeshi Nishimatsu" />
7
7
  <meta name="copyright" content="Copyright &#169; 2011 Takeshi Nishimatsu" />
8
+ <script type="text/x-mathjax-config">
9
+ MathJax.Hub.Config({
10
+ tex2jax: {
11
+ inlineMath: [ ['$','$'] ]
12
+ }
13
+ });
14
+ </script>
8
15
  <link rel="stylesheet" href="ulmul2html5.css" type="text/css" />
9
16
  <link rel="stylesheet" href="google-code-prettify/src/prettify.css" type="text/css" />
10
17
  <script src="google-code-prettify/src/prettify.js" type="text/javascript"></script>
@@ -49,11 +56,12 @@ Table of Contents:
49
56
  <li><a href="#LABEL-27">ULMUL and Slidy examples</a></li>
50
57
  <li><a href="#LABEL-28">ulmul2xhtml is obsolete</a></li>
51
58
  </ul></li>
52
- <li><a href="#LABEL-29">Usage of ulmul2latex</a></li>
53
- <li><a href="#LABEL-30">TODO</a></li>
54
- <li><a href="#LABEL-31">Subversion repository</a></li>
55
- <li><a href="#LABEL-32">Copying</a></li>
56
- <li><a href="#LABEL-33">Author of ULMUL</a></li>
59
+ <li><a href="#LABEL-29">Usage of ulmul2mathjax</a></li>
60
+ <li><a href="#LABEL-30">Usage of ulmul2latex</a></li>
61
+ <li><a href="#LABEL-31">TODO</a></li>
62
+ <li><a href="#LABEL-32">Subversion repository</a></li>
63
+ <li><a href="#LABEL-33">Copying</a></li>
64
+ <li><a href="#LABEL-34">Author of ULMUL</a></li>
57
65
  </ul>
58
66
  </div>
59
67
 
@@ -64,13 +72,13 @@ Table of Contents:
64
72
  <h2 id="LABEL-2">Features</h2>
65
73
 
66
74
  <ul>
67
- <li>TeX style equations between two dollar marks ($) and between \Eq:foo and /Eq:foo
68
- will be converted into MathML. You can use Firefox4, IE9, etc. to read MathML.</li>
75
+ <li>TeX style equations between two dollar marks ($) and between "\Eq:foo" and "/Eq:foo"
76
+ will be converted into MathML. You can use Firefox 4, IE9, etc. to read MathML.</li>
69
77
  <li>ulmul2html5 output is good with the Slidy presentation environment
70
78
  <a href="http://www.w3.org/Talks/Tools/Slidy/">http://www.w3.org/Talks/Tools/Slidy/</a> using Firefox+CSS+XHTML+JavaScript.
71
79
  Please use ulmul-slidy.js and ulmul-slidy.css in the package.</li>
72
80
  <li>Figures, tables and code can be inserted to the document.
73
- They can be easily refered in the text.</li>
81
+ They can be easily referred in the text.</li>
74
82
  <li>Lines starting from "#" are comments.</li>
75
83
  <li>You can add your conversion rules to @subs_rules.</li>
76
84
  <li>"Table of Contents" will be automatically generated.</li>
@@ -121,7 +129,7 @@ Lines starting with asterisks become itemizing list.
121
129
  For example,
122
130
  </p>
123
131
  <pre>
124
- # Nesting is allowed uo to 5th level.
132
+ # Nesting is allowed up to 4th--5th level.
125
133
  * First
126
134
  * Second
127
135
  * Third
@@ -189,16 +197,19 @@ Mass $m$ can be converted into energy $E$ as
189
197
  Output:
190
198
  </p>
191
199
  <p>
192
- Mass <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>m</mi></math> can be converted into energy <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi></math> as
193
- <math id="Eq:Emc2" display='block' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
200
+ Mass <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>m</mi></math> can be converted into energy <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>E</mi></math> as
201
+ <math id="Eq:Emc2" xmlns='http://www.w3.org/1998/Math/MathML' display='block'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
202
+ </p>
203
+ <p>
204
+ You can refer the equation in a way like "Eq:Einstein", as <a href="#Eq:Emc2">Eq. (1)</a>.
194
205
  </p>
195
206
  <p>
196
207
  To view the equations in MathML correctly, please use
197
208
  </p>
198
209
 
199
210
  <ul>
200
- <li>Firefox 4 <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
201
- <li>IE9</li>
211
+ <li>Firefox 4 <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
212
+ <li>IE9 <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home">http://windows.microsoft.com/en-US/internet-explorer/products/ie/home</a></li>
202
213
  <li>etc.</li>
203
214
  </ul>
204
215
  <h3 id="LABEL-15">Figures</h3>
@@ -215,6 +226,7 @@ Input:
215
226
  \Fig:ruby ruby.jpg
216
227
  The is a dummy figure for an example.
217
228
  Cute red logo of Ruby, isn't it?
229
+ You can write equations even in a caption as $ax^2+bx+c=0$.
218
230
  /Fig:ruby
219
231
  </pre>
220
232
  <p>
@@ -225,6 +237,7 @@ Output:
225
237
  <figcaption>
226
238
  Figure 1: The is a dummy figure for an example.
227
239
  Cute red logo of Ruby, isn't it?
240
+ You can write equations even in a caption as <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>a</mi><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mi>b</mi><mi>x</mi><mo>+</mo><mi>c</mi><mo>=</mo><mn>0</mn></math>.
228
241
  </figcaption>
229
242
  </figure>
230
243
  <h3 id="LABEL-16">Tables</h3>
@@ -350,7 +363,20 @@ ulmul2xhtml will be removed from next version 0.6.x.
350
363
 
351
364
 
352
365
  <div class="slide">
353
- <h2 id="LABEL-29">Usage of ulmul2latex</h2>
366
+ <h2 id="LABEL-29">Usage of ulmul2mathjax</h2>
367
+ <p>
368
+ It uses MathJax <a href="http://www.mathjax.org/">http://www.mathjax.org/</a> to show equations.
369
+ </p>
370
+ <pre>
371
+ $ ulmul2mathjax --help
372
+ $ ulmul2mathjax -s ulmul2html5.css -s google-code-prettify/src/prettify.css -j google-code-prettify/src/prettify.js \
373
+ -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html
374
+ </pre>
375
+ </div>
376
+
377
+
378
+ <div class="slide">
379
+ <h2 id="LABEL-30">Usage of ulmul2latex</h2>
354
380
  <pre>
355
381
  $ ulmul2latex --help
356
382
  $ ulmul2latex test.ulmul | tee test.tex
@@ -365,12 +391,12 @@ ulmul2latex is still under development. Sorry.
365
391
 
366
392
 
367
393
  <div class="slide">
368
- <h2 id="LABEL-30">TODO</h2>
394
+ <h2 id="LABEL-31">TODO</h2>
369
395
 
370
396
  <ul>
371
- <li>More usefull error messages for syntax errors.</li>
397
+ <li>More useful error messages for syntax errors.</li>
372
398
  <li>Unit test, tests/ulmul_test.rb</li>
373
- <li>@body shoud be XML object, not a String.</li>
399
+ <li>@body should be XML object, not a String.</li>
374
400
  <li>Citation.</li>
375
401
  </ul>
376
402
  <p>
@@ -380,7 +406,7 @@ For more, see TODO file.
380
406
 
381
407
 
382
408
  <div class="slide">
383
- <h2 id="LABEL-31">Subversion repository</h2>
409
+ <h2 id="LABEL-32">Subversion repository</h2>
384
410
  <p>
385
411
  You can checkout the latest source tree of ULMUL anonymously from RubyForge
386
412
  with svn(1) command:
@@ -392,7 +418,7 @@ $ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul
392
418
 
393
419
 
394
420
  <div class="slide">
395
- <h2 id="LABEL-32">Copying</h2>
421
+ <h2 id="LABEL-33">Copying</h2>
396
422
  <p>
397
423
  Copyright © 2008-2011 by Takeshi Nishimatsu
398
424
  </p>
@@ -422,7 +448,7 @@ Apache License, Version 2.0.
422
448
 
423
449
 
424
450
  <div class="slide">
425
- <h2 id="LABEL-33">Author of ULMUL</h2>
451
+ <h2 id="LABEL-34">Author of ULMUL</h2>
426
452
  <p>
427
453
  Takeshi Nishimatsu (t_nissie{at}yahoo.co.jp) <a href="http://t-nissie.users.sourceforge.net/">http://t-nissie.users.sourceforge.net/</a>
428
454
  </p>
data/index.ja.html CHANGED
@@ -5,6 +5,13 @@
5
5
  <title>ULMUL取扱説明書</title>
6
6
  <meta name="author" content="Takeshi Nishimatsu" />
7
7
  <meta name="copyright" content="Copyright &#169; 2011 Takeshi Nishimatsu" />
8
+ <script type="text/x-mathjax-config">
9
+ MathJax.Hub.Config({
10
+ tex2jax: {
11
+ inlineMath: [ ['$','$'] ]
12
+ }
13
+ });
14
+ </script>
8
15
  <link rel="stylesheet" href="ulmul2html5.css" type="text/css" />
9
16
  <link rel="stylesheet" href="google-code-prettify/src/prettify.css" type="text/css" />
10
17
  <script src="google-code-prettify/src/prettify.js" type="text/javascript"></script>
@@ -47,10 +54,11 @@ Table of Contents:
47
54
  <li><a href="#LABEL-27">実際の使用例</a></li>
48
55
  <li><a href="#LABEL-28">ulmul2xhtmlは消します</a></li>
49
56
  </ul></li>
50
- <li><a href="#LABEL-29">Usage of ulmul2latex</a></li>
51
- <li><a href="#LABEL-30">最新のソース・ツリーの入手方法</a></li>
52
- <li><a href="#LABEL-31">著作権表示</a></li>
53
- <li><a href="#LABEL-32">作者</a></li>
57
+ <li><a href="#LABEL-29">ulmul2mathjaxの使用方法</a></li>
58
+ <li><a href="#LABEL-30">ulmul2latexの使用方法</a></li>
59
+ <li><a href="#LABEL-31">最新のソース・ツリーの入手方法</a></li>
60
+ <li><a href="#LABEL-32">著作権表示</a></li>
61
+ <li><a href="#LABEL-33">作者</a></li>
54
62
  </ul>
55
63
  </div>
56
64
 
@@ -61,11 +69,11 @@ Table of Contents:
61
69
  <h2 id="LABEL-2">特徴</h2>
62
70
 
63
71
  <ul>
64
- <li>文章中の2つのドル記号($)で挟まれた部分と\Eq:fooと/Eq:fooとで挟まれた行が
72
+ <li>文章中の2つのドル記号($)で挟まれた部分と"\Eq:foo"と"/Eq:foo"とで挟まれた行が
65
73
  数式としてTeX形式からMathML形式に変換されます。MathMLとはXMLで数式を記述
66
74
  するための規格です。込み入った規格なので人間が直接MathMLを記述する
67
75
  ことは想定されていませんが、ULMULでやっているようにTeXなどからの変換により
68
- 生成することができます。Firefox4やIE9で読めるようです。
76
+ 生成することができます。Firefox 4やIE9で読めるようです。
69
77
  math_ml.rb <a href="http://www.hinet.mydns.jp/?mathml.rb">http://www.hinet.mydns.jp/?mathml.rb</a> を使っています。</li>
70
78
  <li>ウェブ・ブラウザ+CSS+XHTML+JavaScriptを使ったプレゼン環境
71
79
  Slidy <a href="http://www.w3.org/Talks/Tools/Slidy/">http://www.w3.org/Talks/Tools/Slidy/</a> に対応したxhtmlが出力可能。
@@ -85,7 +93,7 @@ Table of Contents:
85
93
  <div class="slide">
86
94
  <h2 id="LABEL-3">インストール方法</h2>
87
95
  <p>
88
- gemでインストールすれば必要なライブラリも自動的にインストールされます:
96
+ RubyGems <a href="https://rubygems.org/">https://rubygems.org/</a> でインストールすれば必要なライブラリも自動的にインストールされます:
89
97
  </p>
90
98
  <pre>
91
99
  $ sudo gem install ulmul
@@ -114,11 +122,11 @@ ulmul.rbは状態遷移 (state machine) ライブラリaasmを使っていて、
114
122
  </p>
115
123
  <h4 id="LABEL-8">アスタリスクで始まる行は箇条書きになります (asterisk)</h4>
116
124
  <p>
117
- 5段までネストした箇条書きが可能です:
125
+ 4〜5段までネストした箇条書きが可能です:
118
126
  たとえば、
119
127
  </p>
120
128
  <pre>
121
- # Nesting is allowed uo to 5th level.
129
+ # Nesting is allowed uo to 4th--5th level.
122
130
  * First
123
131
  * Second
124
132
  * Third
@@ -163,7 +171,7 @@ EOF と "=end" が出てくると処理が終了します。
163
171
  </p>
164
172
  <h4 id="LABEL-11">無視される行 (ignore)</h4>
165
173
  <p>
166
- Lines starting with"#" and "=begin" are ignored.
174
+ "#" または "=begin" で始まる行は無視されます。
167
175
  </p>
168
176
  <h4 id="LABEL-12">その他の入力行 (normal)</h4>
169
177
  <p>
@@ -193,16 +201,19 @@ Mass $m$ can be converted into energy $E$ as
193
201
  出力:
194
202
  </p>
195
203
  <p>
196
- Mass <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>m</mi></math> can be converted into energy <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi></math> as
197
- <math id="Eq:Emc2" display='block' xmlns='http://www.w3.org/1998/Math/MathML'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
204
+ Mass <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>m</mi></math> can be converted into energy <math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>E</mi></math> as
205
+ <math id="Eq:Emc2" xmlns='http://www.w3.org/1998/Math/MathML' display='block'><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup><mo>.</mo></math>
206
+ </p>
207
+ <p>
208
+ 数式は"Eq:Einstein"のように参照します。こんなかんじ <a href="#Eq:Emc2">Eq. (1)</a> 。
198
209
  </p>
199
210
  <p>
200
211
  数式を正しくご覧いただくには
201
212
  </p>
202
213
 
203
214
  <ul>
204
- <li>Firefox4 <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
205
- <li>IE9</li>
215
+ <li>Firefox 4 <a href="http://mozilla.jp/firefox/">http://mozilla.jp/firefox/</a></li>
216
+ <li>IE9 <a href="http://windows.microsoft.com/ja-JP/internet-explorer/downloads/ie">http://windows.microsoft.com/ja-JP/internet-explorer/downloads/ie</a></li>
206
217
  </ul>
207
218
  <p>
208
219
  などのブラウザを試してみて下さい。
@@ -219,8 +230,9 @@ Mass <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>m</mi
219
230
  </p>
220
231
  <pre>
221
232
  \Fig:ruby ruby.jpg
222
- The is a dummy figure for an example.
223
- Cute red logo of Ruby, isn't it?
233
+ これは図のキャプションの例です。
234
+ Rubyのロゴを描いてみました。
235
+ キャプションに数式を$ax^2+bx+c=0$と書くこともできます。
224
236
  /Fig:ruby
225
237
  </pre>
226
238
  <p>
@@ -229,8 +241,9 @@ Mass <math display='inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>m</mi
229
241
  <figure id="Fig:ruby">
230
242
  <img src="ruby.jpg" alt="ruby.jpg" />
231
243
  <figcaption>
232
- Figure 1: The is a dummy figure for an example.
233
- Cute red logo of Ruby, isn't it?
244
+ Figure 1: これは図のキャプションの例です。
245
+ Rubyのロゴを描いてみました。
246
+ キャプションに数式を<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><mi>a</mi><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mi>b</mi><mi>x</mi><mo>+</mo><mi>c</mi><mo>=</mo><mn>0</mn></math>と書くこともできます。
234
247
  </figcaption>
235
248
  </figure>
236
249
  <h3 id="LABEL-16">表の挿入方法</h3>
@@ -329,7 +342,20 @@ JavaScriptのファイル名を指定します。
329
342
 
330
343
 
331
344
  <div class="slide">
332
- <h2 id="LABEL-29">Usage of ulmul2latex</h2>
345
+ <h2 id="LABEL-29">ulmul2mathjaxの使用方法</h2>
346
+ <p>
347
+ 数式を MathJax <a href="http://www.mathjax.org/">http://www.mathjax.org/</a> で出力します。
348
+ </p>
349
+ <pre>
350
+ $ ulmul2mathjax --help
351
+ $ ulmul2mathjax -s ulmul2html5.css -s google-code-prettify/src/prettify.css -j google-code-prettify/src/prettify.js \
352
+ -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html
353
+ </pre>
354
+ </div>
355
+
356
+
357
+ <div class="slide">
358
+ <h2 id="LABEL-30">ulmul2latexの使用方法</h2>
333
359
  <pre>
334
360
  $ ulmul2latex --help
335
361
  $ ulmul2latex test.ulmul | tee test.tex
@@ -344,7 +370,7 @@ ulmul2latexはまだ発展途上です。
344
370
 
345
371
 
346
372
  <div class="slide">
347
- <h2 id="LABEL-30">最新のソース・ツリーの入手方法</h2>
373
+ <h2 id="LABEL-31">最新のソース・ツリーの入手方法</h2>
348
374
  <p>
349
375
  ソース・ツリーはRubyForge.orgのSubversionレポジトリで管理されています。
350
376
  svn(1)コマンドを使って
@@ -359,7 +385,7 @@ $ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul
359
385
 
360
386
 
361
387
  <div class="slide">
362
- <h2 id="LABEL-31">著作権表示</h2>
388
+ <h2 id="LABEL-32">著作権表示</h2>
363
389
  <p>
364
390
  Copyright © 2008-2011 by Takeshi Nishimatsu
365
391
  </p>
@@ -389,7 +415,7 @@ Apache License, Version 2.0.
389
415
 
390
416
 
391
417
  <div class="slide">
392
- <h2 id="LABEL-32">作者</h2>
418
+ <h2 id="LABEL-33">作者</h2>
393
419
  <p>
394
420
  西松タケシ (t_nissie{at}yahoo.co.jp) <a href="http://t-nissie.users.sourceforge.net/">http://t-nissie.users.sourceforge.net/</a>
395
421
  </p>