%%HTML
<link rel="stylesheet" type="text/css" href="css/sage_table_form.css">
# python2.7カーネルでsageの関数を使う
%load_ext sage
# jupyter用のdisplayメソッド
from IPython.display import display, Latex, HTML, Math, JSON
# テンプレートエンジン
load('script/JinjaMagics.py')
# ユーティリティ
load('script/sage_util.py')
hdr=["円周率", "自然体数の底", "虚数単位", "無限大"]
sts=[pi, e, I, oo]
%%capture output
html.table([(h, str(st), "$%s$"%latex(st) ) for (h, st) in zip(hdr, sts)])
HTML(output.stdout)
円周率 | pi | |
自然体数の底 | e | |
虚数単位 | I | |
無限大 | +Infinity |
pp({'test':'あ'})
{ "test": "あ" }
s_plt = plot(sin(x), [x, -pi, pi], figsize=4)
c_plt = plot(cos(x), [x, -pi, pi], figsize=4)
%%capture output
html.table([[_to_png(s_plt), _to_png(c_plt)]], header=["sin", "cos"])
HTML(output.stdout)
sin | cos |
---|---|
Graphics2Html(c_plt)
a = 1/2 + 1/3
Math(latex(a))
x = var('x')
f(x) = x^3 - x^2 - 2*x
Math(latex(f(x)))
Table2Html([[_to_png(s_plt), _to_png(c_plt)]], header=["sin", "cos"])
sin | cos |
---|---|