github / markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
MIT License
5.83k stars 3.4k forks source link

Latex after block math not working #1584

Closed WillNickols closed 3 weeks ago

WillNickols commented 2 years ago

It looks like text in which there is a latex in-line like $y=mx+b$ followed by a math block like

$$y=mx+b$$

followed by more latex in-line like $y=mx+b$ isn't currently working.

Removing the paragraph breaks between the math block and the in-line latex solves the initial rendering issue, but then using an aligned environment fails: $$\begin{align} w_0&\leftarrow w_0-\alpha\frac{\partial L(\hat{y},y)}{\partial w_0}\ w_1&\leftarrow w_1-\alpha\frac{\partial L(\hat{y},y)}{\partial w_1} \end{align}$$

even though it otherwise works:

$$\begin{align} w_0&\leftarrow w_0-\alpha\frac{\partial L(\hat{y},y)}{\partial w_0}\ w_1&\leftarrow w_1-\alpha\frac{\partial L(\hat{y},y)}{\partial w_1} \end{align}$$

This didn't seem to be an issue as of a week ago. Are there any known workarounds? Thanks!

devindg commented 2 years ago

I'm having the same exact problem, which I noticed today. It was working not that long ago.

For reference, below is the markdown that is not rendering correctly. The paragraph after the math block $$...$$ is not rendering the inline math.

Model

A structural time series model with level, trend, seasonal, and regression components takes the form:

$$ y_t = \mu_t + \gamma_t + \mathbf x_t^\prime \boldsymbol{\beta} + \epsilon_t $$

where $\mu_t$ specifies an unobserved dynamic level component, $\gamma_t$ an unobserved dynamic seasonal component, $\mathbf x_t^\prime \boldsymbol{\beta}$ a partially unobserved regression component (the regressors $\mathbf x_t$ are observed, but the coefficients $\boldsymbol{\beta}$ are not), and $\epsilont \sim N(0, \sigma{\epsilon}^2)$ an unobserved irregular component. The equation describing the outcome $y_t$ is commonly referred to as the observation equation, and the transition equations governing the evolution of the unobserved states are known as the state equations.

samlouiscohen commented 2 years ago

Experiencing this issue as well. Every paragraph after the first fails to properly render.

ghost commented 2 years ago

Experiencing this issue as well. Some inline formulas cannot be rendered, but block-level formulas can be rendered normally. There are also some bugs, such as displaying $\tag{1}$ in long formula, which is very badly formatted in LaTeX notation.

image image

devindg commented 2 years ago

It seems like this repo is not very active. We may have to consider alternative options for displaying math.

ghost commented 2 years ago

It seems like this repo is not very active. We may have to consider alternative options for displaying math.

gitlab may be an option, but unfortunately it does not support the syntax of the $ $ format inline math, so many contents cannot be migrated.

LordFckHelmchen commented 7 months ago

A workaround is to use a [math-block]( instead of $$ to signify the latex code block (see here for more details on why). This however, is not rendered in VS Code.

github-actions[bot] commented 4 weeks ago

Stale issue message