卒研発表1. 電大 つ電
組る
く子
子矢
情研
報究
工室
学 版ク籍
書
ラ
科
五 シウを
年
スド
矢 のテ
口
裕
開ム
也 発
7. <html>
<title>こころ</title>
HTML <author>夏目漱石</author>
<h2>上 先生と私</h2>
<rb>私</rb><rt>わたくし</
rt>はその人を常に先生と呼
んでいた。<br />
evalbook ......
PDF
8. 従来 evalbookの方式
端末 端末
PDF / image
viewer
電子書籍
アプリ
サーバ
evalbook
9. 従来 evalbook
1つのサーバ上
端末毎にアプリ で動作するプロ
の開発が必要 グラムだけで済
む
10. evalbook
Web UI
pLaTeX code generator
HTML parser
pLaTeX
13. <%= %>の部分に動的に値/
文字列が埋め込まれる
1 documentclass[a4j,<%=t.column%>]{tarticle}
2 usepackage[dvipdfm]{graphicx}
3 usepackage[deluxe, burasage]{otf}
4 usepackage[dvipdfm]{color}
5 usepackage[dvipdfm,%
6 bookmarks=true,%
7 bookmarksnumbered=true,%
8 colorlinks=true]{hyperref}
9 usepackage{fancyvrb}
10 usepackage{fancyhdr}
14. <%= %>の部分に動的に値/
文字列が埋め込まれる
1 documentclass[a4j,<%=t.column%>]{tarticle}
・onecolumn
・twocolumn
15. normalsize, largeなどを再定義する.
フォントの大きさは対象デバイス・
ユーザの指定により毎回変化する
12 makeatletter
13 DeclareFontShape{JT1}{hmc}{m}{n}{<-> s *
[0.9375] brsgnmlminr-v}{}
14 renewcommand{normalsize}{@setfontsize
normalsize{<%=t.normalsize%>pt}{<
%=t.lineskip(t.normalsize)%>}}
15 renewcommand{tiny}{@setfontsizetiny{<
%=t.tiny%>pt}{<%=t.lineskip(t.tiny)%>}}
........
19 renewcommand{huge}{@setfontsizehuge{<
%=t.huge%>pt}{<%=t.lineskip(t.huge)%>}}
16. normalsize, largeなどを再定義する.
フォントの大きさは対象デバイス・
ユーザの指定により毎回変化する
フォントサイズ
13pt
14 renewcommand{normalsize}{@setfontsize
normalsize{<%=t.normalsize%>pt}{<
%=t.lineskip(t.normalsize)%>}}
行送り
19.5pt = 13pt × 1.5
17. 本の作者・タイトルの情報があ
れば各ページのヘッダに挿入
21 defps@myhead{letps@jpl@inps@headnombre
22 let@oddfoot@emptylet@evenfoot@empty
23 def@evenhead{{tiny <%= t.title || ''
%> <%= t.author || '' %>hfill thepage{}}}%
24 def@oddhead{{tiny <%= t.title || '' %>
<%= t.author || '' %>hfill thepage{}}}%
25 let@mkbothmarkboth
26 }
27 pagestyle{myhead}
28 makeatother
18. 本の作者・タイトルの情報があ
れば各ページのヘッダに挿入
タイトル
奇数ページ こころ
23 def@evenhead{{tiny <%= t.title || ''
%> <%= t.author || '' %>hfill thepage{}}}%
24 def@oddhead{{tiny <%= t.title || '' %>
<%= t.author || '' %>hfill thepage{}}}%
偶数ページ 著者
夏目漱石
20. Ruby内部DSLによる再帰的なHTMLパー
サ・pLaTeXコードジェネレータ使用例
93 tag(:rb) {"kana{#{recur}}"}
94 tag(:rt) {"{#{recur}}"}
95 tag(:rp) {""}
96
97 tag(:br) {'par{}'}
98 tag :hr do
99 "
100 vspace{1zw plus .1zw minus .4zw}nn
101 nnnoindent
102 hfil
103 rule{#{@t.textwidth_consider_column *
0.7}pt}{.01zw}
104 hfillnn"
22. pLaTeX等の実行
24 open("#{$dir_tmp}/#{filename}.tex", 'w'){|fp|
fp.write(Erubis::Eruby.new(template).result(binding))}
25 open("#{$dir_tmp}/#{filename}.sh", 'w'){|fp|
fp.write(<<-"EOF")}
26 ebb *.pdf
27 platex -interaction=nonstopmode #{$dir_tmp}/
#{filename}.tex
28 dvipdfmx -f #{$dir_sty}/notembed.map -p
#{t.width}pt,#{t.height}pt #{$dir_tmp}/#{filename}.dvi
29 mv #{filename}.pdf #{$dir_public_tmp}
30 rm #{filename}.tex #{filename}.dvi
31 EOF
32 do_command($dir_tmp, "sh #{filename}.sh")
27. 各パラメタの計算
66 def textheight
67 ((width * 0.925 / lineskip(@fontsize)).to_i - 1) *
lineskip(@fontsize) + @fontsize
68 end
69
70 def oddsidemargin
71 (width - textheight - tiny / 2) / 2
72 end
73
74 def column
75 if textwidth / @fontsize > 40
76 "twocolumn"
77 else
78 "onecolumn"
79 end
80 end
32. 171 def a_img width, height
172 "
173 begingroup
174 catcode`_=11
175 catcode`%=11
176 catcode`#=11
177 catcode`$=11
178 catcode`&=11
179 special{pdf:ann width #{width}pt height
#{height}pt
180 << /Subtype /Link /A << /S /URI /URI
(#{@a_url}) >> >>}endgroup
181 "
182 end
33. URLに使う記号(_%#...)
をTeXで通常の文字列
174 catcode`_=11
として扱うように
175 catcode`%=11
176 catcode`#=11
177 catcode`$=11
178 catcode`&=11
34. special命令(TeXでは解釈され
ずdviwareにそのまま届く命
令)で画像の上に同じ大きさの
480
ハイパーリンクを重ねる
179 special{pdf:ann width #{width}pt height
#{height}pt
180 << /Subtype /Link /A << /S /URI /URI
(#{@a_url}) >> >>} 640
http://example.com/hoge_fuga.php?a=b&c=d
39. 1 bop [8]
ParseDVI
2 down 3113.3460235595703125
3 down -3164.9630889892578125
4 right -52.047943115234375
5 xxx color push gray 0
6 xxx pdf:dest (page.8) [@thispage /XYZ @xpos @ypos]
7 right 442.75
8 xxx color pop
9 down 319.6875
10 right -52.047943115234375
11 down -319.6875
12 dir tate
13 down -437.59375
14 fnt brsgnmlminr-v 10.3125
15 set ち
16 w -0.0062408447265625
17 set な
18 w0 -0.0062408447265625
19 set み
40. 今ある/今後でる
ほぼ全てのデバイスに対応
PC
Kindle DX
Kindle 2
PSP
iPad
iPhone
evalbook Android
WindowsPhone7
Galapagos
携帯電話(au)
携帯電話(docomo)
携帯電話(softbank)
41. が 人 分 い い う
感 つ ひ か に か の
じ も ど ら は し だ も と
ま そ い 悪 、 ら か の こ
し の 思 く 言 、 ら に そ
攻 い 言 い と 、 い違 、
撃 違 わ 争 思 も な 謂
を い れ い い は い わ
ば
両立
黙 を る も 込 や 、
し し と 自 ん 人 自 万
て 、 己 で 間 分 一世
い い 弁 し と に 系
る か 解 ま 一 は の
よ に も う 緒 そ 人
も 出 の に の 間
、 来 で 住 真 の
も な し め 理 ﹁
っ い た な を 真
43. 利用したプログラム・コ
ンテンツ
•Ruby, 各種gemライブラリ
•pLaTeX, 各種マクロファイル
• Google Search API
• 青空文庫
44. 画像などの引用
• http://www.apple.com/jp/iphone/gallery/
• http://www.au.kddi.com/seihin/ichiran/
smartphone/is12t/index.html
• http://jp.samsungmobile.com/galaxys/
• http://www.android.com/
• http://www.microsoft.com/ja-jp/windowsphone/
design/7/phones.aspx
• http://itunes.apple.com/jp/app/id369061574?
mt=8