To render a long latex equation in two lines in quarto
---
title: "ABC"
description: "XYZ"
format:
html:
page-layout: full
toc-location: left
html-math-method: katex
---
The attempts and renders are as follows:
Attempt 1
$$
v_n(t+\tau) = {min} \left\{v_n(t) + 2.5 a_n\tau (1-v_n(t)/V_n){(0.025+v_n(t)/V_n)}^{1/2}, \\ b_n\tau+\sqrt{b_n^2\tau^2 -b_n [ 2[x_{n-1}(t)-s_{n-1}-x_n(t)] - v_n(t)\tau- v_{n-1}(t)^2\hat{b}]}\right\}
$$
Attempt 2
$$
\begin{split}
v_n(t+\tau) = {min} \left \{v_n(t) + 2.5 a_n\tau(1-v_n(t)/V_n){(0.025+v_n(t)/V_n)}^{1/2}, \\ b_n \tau + \sqrt{b_n^2 \tau^2 - b_n [2 [x_{n-1}(t) - s_{n-1} - x_n(t)]] - v_n(t) \tau - v_{n-1}(t)^2 \hat{b}]} \right \}
\end{split}
$$
Attempt 3: Remove \left
and \right
But I want large braces. How can I fix this?
Line break will not work inside the \left..\right
group. Instead, try \biggl..\biggr
.
---
title: "ABC"
description: "XYZ"
format:
html:
page-layout: full
toc-location: left
html-math-method: katex
---
## Quarto
### Long Math equation
$$
v_n(t+\tau) = {min} \biggl\{v_n(t) + 2.5 a_n\tau (1-v_n(t)/V_n){(0.025+v_n(t)/V_n)}^{1/2}, \\ b_n\tau+\sqrt{b_n^2\tau^2 -b_n [ 2[x_{n-1}(t)-s_{n-1}-x_n(t)] - v_n(t)\tau- v_{n-1}(t)^2\hat{b}]}\biggr\}
$$
The rendered document looks like this,
Also note that, you cannot use eqnarray
here, because this environment is not supported in katex
. see here what environments are supported in katex