heyheytower

日々のメモです。誰かのお役に立てれば幸いです。

黒背景のブログに、数式を載せるためのメモ

目的

灰色背景で構成されている当ブログにおいて、一般的な数式表示方法では黒文字がデフォルトで視認性が悪い。
数式表示方法の試行錯誤を記載する共に、最終的に Google Chart API を用いた経緯を書く。

要件
  • 背景「黒・灰色」で用いるために、数式は白文字にする。
  • TeX の書式を用いる。
  • 画像を生成する方法は用いない。(白文字・背景透過処理で実現できるが、アップロードが面倒*1

試行錯誤

第一案:はてなmimetex を使う(正攻法だが、白文字不可なので不採用)
  • 数式記載方法

http://d.hatena.ne.jp/keyword/mimetex

当サイトは「テーマ:Nimbus」を用いているため、下記背景色指定を行った。(デフォルトの背景白では数式が浮いてしまうため)

img.tex {
background-color: #303030;
}

引用内の"["は表示のため全角を用いていることに注意)

TeX:{e^{i\pi} = \cos \pi + i \sin \pi \\ \:\:\:\:\:\: =-1}]

{e^{i\pi} = \cos \pi + i \sin \pi \\ \:\:\:\:\:\: =-1}

tex:x^2 + y^2 = z^2]

x^2 + y^2 = z^2

tex:e^{i\pi} = -1]

e^{i\pi} = -1

やはり、灰色背景で黒文字では見難いですし、そのためだけにブログを白背景に設定すること、数式の背景だけ白にすること、は否です。


第二案:webサービスを探す(これらも白文字不可につき不採用)

http://www.forkosh.com/

http://formula.s21g.com/

www.codecogs.com

formulaサービス以外は、アンチエイリアス処理により灰色背景では使い物になりません。


第三案:Google Chart API を用いる(要件を満たすため、採用)

http://webbackwriter.blogspot.jp/2012/06/google-chart-api.htmlを参考にした。


実際のコマンドとしては下記を用いる。*3

$ maxima -q
(%i1) tex(sqrt(y)/5+x^2*%pi);
$${{\sqrt{y}}\over{5}}+\pi\,x^2$$
(%o5) false
(%i2) quit();

$ echo "{{\sqrt{y}}\over{5}}+\pi\,x^2" | perl -MURI::Escape -lne 'print uri_escape($_)'
%7B%7B%5Csqrt%7By%7D%7D%5Cover%7B5%7D%7D%2B%5Cpi%5C%2Cx%5E2

上記のURLエンコード結果を用いて下記タグを作製する。(引用内の"<"は表示のため全角を用いていることに注意)
(数式確認のため、適宜タグテスト - HTMLタグを入力してブラウザ表示チェック/ホームページマスターでタグテストを行います。最終行の式はメモのため)

<img src="http://chart.apis.google.com/chart?
cht=tx&
chf=bg,s,303030&
chco=FFFFFF&
chl=
%7B%7B%5Csqrt%7By%7D%7D%5Cover%7B5%7D%7D%2B%5Cpi%5C%2Cx%5E2
"sqrt(y)/5+x^2*%pi / >


※2013/11/11追記
 +記号などがなければ、URLエンコードがなくとも数式が表示されるようであった。


以上。

『生命科学の新しい潮流 理論生物学』を読んで


書名:『生命科学の新しい潮流 理論生物学』
編者:望月敦史

所感

兵庫大学の本多久夫さんが書かれた、第4章「形態形成」が読みたく、この本を手に取りました。
感想を書いても仕様が無いので、下記に無料で手に入る関連論文を示します。

第4章「形態形成」で参照されている、無料で手に入る関連論文一覧

1. Bretschneider, T., Vasiev, B. & Weijer, C. A model for dictyostelium slug movement. J. Theor. Biol. 199, 125–36 (1999).
2. Drasdo, D. & Forgacs, G. Modeling the interplay of generic and genetic mechanisms in cleavage, blastulation, and gastrulation. Dev. Dyn. 219, 182–91 (2000).
3. Epithelial, I., Weliky, M. & Oster, G. The mechanical basis of cell rearrangement. 386, 373–386 (1990).
4. Gibson, W. T. & Gibson, M. C. Cell topology, geometry, and morphogenesis in proliferating epithelia. Curr. Top. Dev. Biol. 89, 87–114 (Elsevier Inc., 2009).
5. Glazier, F. G. J. A. Simulation_of_Biological_Cell_Sorting_Using_a_Two-Dimensional_Exterded_Potts_Model.pdf. (1992).
6. Honda, H., Tanemura, M. & Yoshida, a. Estimation of neuroblast numbers in insect neurogenesis using the lateral inhibition hypothesis of cell differentiation. Development 110, 1349–52 (1990).
7. Honda, H., Yamanaka, H. & Eguchi, G. Transformation of a polygonal cellular pattern during sexual maturation of the avian oviduct epithelium: computer simulation. J. Embryol. Exp. Morphol. 98, 1–19 (1986).
8. Honda, H., Motosugi, N., Nagai, T., Tanemura, M. & Hiiragi, T. Computer simulation of emerging asymmetry in the mouse blastocyst. Development 135, 1407–14 (2008).
9. Honda, H., Nagai, T. & Tanemura, M. Two different mechanisms of planar cell intercalation leading to tissue elongation. Dev. Dyn. 237, 1826–36 (2008).
10. Honda, H. T. M. Spontaneous_Architectural_Organization_of_Mammalian_Epidermis_from_Random_Cell_packing.pdf. (1996).
11. Marée, a F. & Hogeweg, P. How amoeboids self-organize into a fruiting body: multicellular coordination in Dictyostelium discoideum. Proc. Natl. Acad. Sci. U. S. A. 98, 3879–83 (2001).
12. Mombach, J. C. M., de Almeida, R. M. C., Thomas, G. L., Upadhyaya, a. & Glazier, J. a. Bursts and cavity formation in Hydra cells aggregates: experiments and simulations. Phys. A Stat. Mech. its Appl. 297, 495–508 (2001).
13. Morishita, Y. & Iwasa, Y. Growth based morphogenesis of vertebrate limb bud. Bull. Math. Biol. 70, 1957–78 (2008).
14. Newman, S. a & Comper, W. D. “Generic” physical mechanisms of morphogenesis and pattern formation. Development 110, 1–18 (1990).
15. Sun, J. Geometric models for calculating cell biovolume and surface area for phytoplankton. J. Plankton Res. 25, 1331–1346 (2003).
16. Zallen, J. a & Wieschaus, E. Patterned gene expression directs bipolar planar polarity in Drosophila. Dev. Cell 6, 343–55 (2004).

※論文管理ソフト「mendeley」*1のリストから、Nature引用形式でコピーしました。

関連分野のお勧め書籍

関連分野と思われる「数理生物学」の書籍から平易なものを、下記紹介いたします。
生物統計に微分積分学を利用して、生物の用いた戦略の有用性などを解析的に紹介しており、とても理解がしやすかったです。


書名:『数理生物学入門 生物社会のダイナミックスを探る』
著者:巌佐 庸


以上。