# KaTeX render test

> Source: https://aiwiki.ai/wiki/katex_render_test
> Updated: 2026-07-09
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
> From AI Wiki (https://aiwiki.ai), the free encyclopedia of artificial intelligence. Reuse freely with attribution to "AI Wiki (aiwiki.ai)".

Temporary internal test page for math rendering. It will be deleted after verification.

## Display math

The Bellman optimality equation for the state-value function:[1]

$$
V^*(s) = \max_a \sum_{s'} P(s' \mid s, a)\left[R(s, a, s') + \gamma V^*(s')\right]
$$

The action-value form:

$$
Q^*(s,a) = \sum_{s'} P(s' \mid s, a)\left[R(s, a, s') + \gamma \max_{a'} Q^*(s', a')\right]
$$

The discounted return:

$$
G_t = R_{t+1} + \gamma R_{t+2} + \gamma^2 R_{t+3} + \cdots = \sum_{k=0}^{\infty} \gamma^k R_{t+k+1}
$$

A deliberately wide equation to test horizontal scrolling on narrow screens:

$$
\mathrm{Attention}(Q, K, V) = \mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right)V \qquad \mathcal{L}(\theta) = -\mathbb{E}_{(x,y)\sim\mathcal{D}}\left[\sum_{t=1}^{T} \log p_\theta(y_t \mid y_{<t}, x)\right] + \lambda \lVert \theta \rVert_2^2
$$

## Inline math

The discount factor $$\gamma \in [0, 1)$$ controls how much the agent values future rewards, and the policy $$\pi_\theta(a \mid s)$$ is parameterized by $$\theta$$. TD error is $$\delta_t = r_{t+1} + \gamma V(s_{t+1}) - V(s_t)$$ inside a sentence.[2]

## Things that must NOT become math

OpenAI raised $6 billion in one round and later $250 million in another; Anthropic raised $8 billion from Amazon. A single $ sign stays text.

Inline code with dollars: `price = "$$100"` and `echo $$PATH`.

```python
# Code fence: dollars stay literal
cost = "$$not math$$"
total = price * 2  # $50
```

| Metric | Formula |
| --- | --- |
| MCC | $$\frac{TP \cdot TN - FP \cdot FN}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}}$$ |
| Accuracy | $$\frac{TP + TN}{TP + TN + FP + FN}$$ |

Citation marker near math: the value $$V^\pi(s)$$ was introduced earlier.[1] See [reinforcement learning](/wiki/reinforcement_learning).

## References

[1] Sutton, R. S., & Barto, A. G. (2018). Reinforcement Learning: An Introduction (2nd ed.). MIT Press. http://incompleteideas.net/book/the-book-2nd.html

[2] Bellman, R. (1957). Dynamic Programming. Princeton University Press.

