Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Markdown・LaTeX 記法リファレンス

Colab のテキストセルや Jupyter Notebook では,Markdown で文章を,LaTeX で数式を記述できる.本ページはその書き方のリファレンスである.

Markdown

見出し

# を重ねることで見出し・小見出しを作成できる.行頭で使う.

# 見出し
## 小見出し
### 小小見出し

リスト

番号なしリスト:*-+ で表現する.

* 要素1
* 要素2
* 要素3

番号ありリスト:数字. で番号ありリストを作れる.番号は自動で振られる.

1. 要素1
1. 要素2
1. 要素3

リンク

[表示テキスト](URL) でリンクを表現する.

[演習用Webページ](https://koji.noshita.net/courses/compbio/)

コードとコードブロック

バッククォートで囲むとインラインコード(code)を表現する.

バッククォート3つで複数行を囲むとコードブロックになる.言語名を指定するとシンタックスハイライトが使える.

```python
import math
```

LaTeX 数式

インライン数式とディスプレイ数式

インライン数式:文章中に $...$ で埋め込む.例:f(x)=axf(x) = ax

ディスプレイ数式:$$...$$ で独立した行に表示する:

f(x)=axf(x) = ax

基本的な演算子

記法表示説明
+, -++, -和,差
\cdot\cdotドット積
\times×\timesクロス積

分数

\frac{分子}{分母} で分数を表現する.

x=abx = \frac{a}{b}

添字

上付き添字 ^,下付き添字 _ を使う.文字・数字が複数の場合は {} で囲む.

x(t)=x0eatx(t) = x_0 e^{at}

フォントの装飾

記法表示用途
\mathbf{A}A\mathbf{A}太字(ベクトル・行列)
\mathrm{x}x\mathrm{x}立体(単位,関数名)
\mathit{1}1\mathit{1}イタリック

ギリシャ文字

\名前 で表現する.大文字は先頭を大文字にする.

α,β,γ,δ,ϵ,λ,μ,σ,ω,\alpha, \beta, \gamma, \delta, \epsilon, \lambda, \mu, \sigma, \omega, \cdots
Δ,Φ,Ω,\Delta, \Phi, \Omega, \cdots

改行

\\ で数式内の改行を表現する.

f(x)=x2g(x)=x2+2x+1f(x) = x^2 \\ g(x) = x^2 + 2x + 1

ドット・三点リーダ

記法表示方向
\cdot\cdot中黒
\cdots\cdots水平
\vdots\vdots垂直
\ddots\ddots斜め
\ldots\ldots底面

イタリックにしない関数

名前のついている関数はコマンドが用意されている.

sin(θ),cos(θ),tan(θ),exp(at),log(x)\sin(\theta),\quad \cos(\theta),\quad \tan(\theta),\quad \exp(at),\quad \log(x)

括弧の大きさの自動調整

\left( ... \right) で高さが自動調整される.[]||\{\} にも使える.

dxdt=r(1xK)x\frac{dx}{dt} = r \left(1 - \frac{x}{K}\right) x

数式の整列

align 環境で & を揃えたい位置に配置する.

Xˉ+nt+1=f(Xˉ+nt)=f(Xˉ)+dfdXnt+12d2fdX2nt2+\begin{align} \bar{X} + n_{t+1} &= f\left(\bar{X} + n_t\right) \\ &= f\left(\bar{X}\right) + \frac{df}{dX} n_t + \frac{1}{2} \frac{d^2 f}{dX^2} n_t^2 + \cdots \end{align}

ベクトル・行列

\begin{pmatrix} ... \end{pmatrix} で囲み,& で列,\\ で行を区切る.

ベクトル:

x=(x1x2x3)\mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}

行列:

A=(a11a12a1na21a22a2nam1am2amn)\mathbf{A} = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}