Algorithm not showing correctly
- Dominant language
- No language data
- Stars
- 42
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
### Description
The algorithm environment does not translate very well to the HTML view.
Same result in Firefox and Google Chrome (newest versions at time of viewing) on Ubuntu 22.04.4 LTS
### (Optional:) Please add any files, screenshots, or other information here.

Should look like:

In the source file (line 162-184):
```latex
\begin{algorithm2e*}[htb!]
\label{alg:MADM}
\(\textbf{Input: } x\in N^{d_1\times d_2\times d_3}\)\\
\(\textbf{Initialize \#1: }t_s\in[0, T]\text{: the start timestep of denoising process}\)\\
\(\textbf{Initialize \#2: }s\text{: the number of adjacent slices loaded as 2.5D condition input}\)\\
\(\textbf{Initialize \#3: }\epsilon \sim N(0, I) \)\\
\(y_{\text{prior}} = f_{\text{prior}}(x)\) \Comment*[r]{One-step inference to generate prior image}
\(\bar{y}_{\text{prior}} = \sqrt{\bar{a}_{t_0}} y_{\text{prior}} + \sqrt{1 - \bar{a}_{t_0}} \epsilon\) \Comment*[r]{Diffuse, i.e. add noise, to the prior image}
\For{$t = t_s, t_{s}-1, ..., 0$}{
\(y^{\text{avg}}_{t} = \bar{y}_{\text{prior}}\text{ if }t == t_s\) \Comment*[r]{Start the reverse process at $t_s$ based on diffused prior image}
\(z \sim \mathcal{N}(0, \mathcal{I})\text{ if }t > 1\text{, else }z = 0\)\\
\For{$i = 1, 2, ..., d_1$}{
\(y^{\text{co}}_{t-1}[i,:,:] = \frac{1}{\sqrt{\alpha_t}}(y^{\text{avg}}_t[i,:,:] - \frac{1-\alpha_t}{\sqrt{1-\bar{\alpha_t}}}f^{co}_{\theta}(y^{\text{avg}}_t[i,:,:], x[i-s:i+s,:,:], t)) + \sigma_t z\) \Comment*[r]{Coronal view 2.5D reverse}
}
\For{$i = 1, 2, ..., d_2$}{
\(y^{\text{sa}}_{t-1}[:,i,:] = \frac{1}{\sqrt{\alpha_t}}(y^{\text{avg}}_t[:,i,:] - \frac{1-\alpha_t}{\sqrt{1-\bar{\alpha_t}}}f^{sa}_{\theta}(y^{\text{avg}}_t[:,i,:], x[:,i-s:i+s,:], t)) + \sigma_t z\) \Comment*[r]{Sagittal view 2.5D reverse}
}
\For{$i = 1, 2, ..., d_3$}{
\(y^{\text{ax}}_{t-1}[:,:,i] = \frac{1}{\sqrt{\alpha_t}}(y^{\text{avg}}_t[:,:,i] - \frac{1-\alpha_t}{\sqrt{1-\bar{\alpha_t}}}f^{ax}_{\theta}(y^{\text{avg}}_t[:,:,i], x[:,:,i-s:i+s], t)) + \sigma_t z\) \Comment*[r]{Axial view 2.5D reverse}
}
\(y^{\text{avg}}_{t-1} = \frac{y^{\text{co}}_{t-1} + y^{\text{ax}}_{t-1} + y^{\text{sa}}_{t-1}}{3}\) \Comment*[r]{Averaging volumes from multiple 2.5D view models}
}
\end{algorithm2e*}
```
### (Required) What is this issue most closely related to? Select one.
Formula
### Internal issue ID
4e90f572-b518-4283-b511-e77c049d4c50
### Paper URL
https://arxiv.org/html/2406.08374v2
### Browser
Firefox/135.0
### Device Type
Desktop
Contributor guide
Research direction
Start with the algorithm environment at lines 162–184 of the paper linked in the issue and compare its HTML rendering with the expected screenshot in the report. Trace how this LaTeX algorithm is converted to HTML, then verify that the displayed structure and formulas match the expected result in both listed browsers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, latex
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100