shivaseの日記

SIer→Web→教師→SIer→ベンチャー(SRE)と異色な人生を歩んでいるエンジニアの日記

はてなブログで数式

授業で使うパワポ資料からテストプリントなどなど、慣れたmarkdownで記述してpandocでpdfなりに出力しています。 なのでもちろんはてなブログもmarkdownで記述しているのですが、数式の埋め込み方がわからなかったのでメモ

参考にしたサイト

はてなブログの LaTeX 数式表示がデフォルトで MathJax 化された - 余白の書きなぐり

数式を独立した行(ブロック)で表示

{ \displaystyle
\theta_j := \theta_j - \alpha\frac{\partial}{\partial\theta_j}J(\theta_0,\theta_1)\space
}

[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

数式を文章にインライン表示する

 {\theta_0} {\theta_1}は同時(simultaneous)に更新する

[tex: {\theta_0}][tex: {\theta_1}]は同時(simultaneous)に更新する

ようは[tex: {数式}]を挿入するだけなので簡単ですね

MathJaxに関連するサイト

【スポンサーリンク】