はてなブログで数式
授業で使うパワポ資料からテストプリントなどなど、慣れたmarkdownで記述してpandocでpdfなりに出力しています。 なのでもちろんはてなブログもmarkdownで記述しているのですが、数式の埋め込み方がわからなかったのでメモ
参考にしたサイト
はてなブログの LaTeX 数式表示がデフォルトで MathJax 化された - 余白の書きなぐり
数式を独立した行(ブロック)で表示
↓
[tex:{ \displaystyle \theta_j := \theta_j - \alpha\frac{\partial}{\partial\theta_j}J(\theta_0,\theta_1)\space(for \space j = 0 \space and \space j = 1) }]
\displaystyle
を入れる理由は、数式を後述するインライン表示ではなく、独立したブロック表示にしたいため
The displaystyle setting adds displaystyle="true" to the math. As per the MathML spec display="block" entails displaystyle="true" but not vice versa; the main difference is that the former is set as block element while displaystyle controls the layout behavior (so you can choose that independently).
javascript - how to display asciimath equation in displaystyle (MathJax) - Stack Overflow
数式を文章にインライン表示する
とは同時(simultaneous)に更新する
↓
[tex: {\theta_0}]と[tex: {\theta_1}]は同時(simultaneous)に更新する
ようは[tex: {数式}]
を挿入するだけなので簡単ですね
MathJaxに関連するサイト
- MathJax basic tutorial and quick reference - Mathematics Meta Stack Exchange
基本的なMathJaxのレファレンス - Detexify LaTeX handwritten symbol recognition
各種記号をどうMathJaxで表現するのか、読み方がわからない時とか手書きできるので重宝 - MathJax Dynamic Math Test Page
リアルタイムプレビューでMathJaxの数式は表示されず、数式確認のためにプレビューを毎回するのは嫌なので、ここでMathJaxが問題ないか確認